Differences between revisions 8 and 9
Revision 8 as of 2005-08-26 08:23:38
Size: 3262
Editor: mpm
Comment:
Revision 9 as of 2005-09-03 20:12:54
Size: 3283
Comment:
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
$hg log
Line 36: Line 37:
$hg log -v

Tutorial - examining repository history

At this point, we have followed TutorialClone to clone a ["Repository"]; our local copy is called my-hello.

Let's take a look at the history of this repository. To do this, we use the log command. This prints a summary of every event that has occurred in the ["Repository"], going backwards in time from the most recent.

$hg log
changeset:   1:82e55d328c8c
tag:         tip
user:        mpm@selenic.com
date:        Fri Aug 26 01:21:28 2005 -0700
summary:     Create a makefile

changeset:   0:0a04b987be5a
user:        mpm@selenic.com
date:        Fri Aug 26 01:20:50 2005 -0700
summary:     Create a standard "hello, world" program

These lines of output bear some describing.

  • Each paragraph describes a particular ChangeSet. A ChangeSet is a modification of one or more files, grouped together into a logical unit.

  • In the case above, we can see that the ["Repository"]'s history consists of four ["ChangeSet"]s.

  • changeset identifies a ChangeSet.

    • The first number before the colon is a RevisionNumber; it is a local short-hand way of identifying the ChangeSet. It is only valid within this ["Repository"].

    • The long hexadecimal string after the colon is a ChangeSetID; it uniquely identifies the ChangeSet, and is the same in all repositories that contain this ChangeSet. If you are ever discussing a ChangeSet with someone else, use the ChangeSetID, not the RevisionNumber.

  • tag is a ["Tag"], an arbitrary symbolic name for a ChangeSet.

    • You can assign one or more ["Tag"]s to any ChangeSet. Naturally, not all ["ChangeSet"]s will have ["Tag"]s associated with them, so the tag line will not always be present.

    • The special ["Tag"] named tip always identifies the ["Tip"], which is the most recent ChangeSet in the ["Repository"]. If you create another ChangeSet (and we will, soon), that will become the ["Tip"].

  • user identifies the person who created the ChangeSet. This is a free-form string; it usually contains an email address, and sometimes a person's name, too.

  • date describes when the ChangeSet was created. These dates are printed in your local time zone, no matter what time zone the creator of the ChangeSet was in.

  • summary gives the first line of the description of the ChangeSet. This was entered by the creator of the ChangeSet at the time they created it, to help themselves and others understand the purpose of the ChangeSet.

We can get more detailed history information by asking for verbose output:

$hg log -v
changeset:   1:82e55d328c8ca4ee16520036c0aaace03a5beb65
tag:         tip
user:        mpm@selenic.com
date:        Fri Aug 26 01:21:28 2005 -0700
files:       Makefile
description:
Create a makefile

...

Verbose output contains a few more fields than the default output.

  • revision is a field you can safely ignore.

  • files lists the files modified in this ChangeSet.

  • description contains the complete multi-line description of the ChangeSet, rather than just the first line.

Now that we have some slight idea of what has happened, let's jump in and make some changes! Onwards, to TutorialFirstChange!

TutorialHistory (last edited 2012-11-06 16:17:07 by abuehl)