Differences between revisions 3 and 4
Revision 3 as of 2005-08-26 01:24:15
Size: 3623
Editor: waste
Comment:
Revision 4 as of 2005-08-26 01:32:00
Size: 3653
Editor: waste
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== [Tutorial] - examining repository history == == Tutorial - examining repository history ==
Line 9: Line 9:
 $ hg log
 changeset: 2:bd2fb7137c85cd5e6b04db4c72a45699e0d90ea9
 tag: tip
 user: bos@camp4.serpentine.com
 date: Wed Jun 29 12:04:20 2005
 summary: Add a helpful, descriptive comment to the makefile.
 changeset: 1:4a17053ec93dd51ea37340f639db457c42065da6
 user: bos@camp4.serpentine.com
 date: Wed Jun 29 12:03:45 2005
 summary: Add description to hello.c.
 changeset: 0:5931063e4b0fb17fc4625447b69296356ca6cdfc
 user: bos@camp4.serpentine.com
 date: Wed Jun 29 12:02:36 2005
 summary: Add hello, world.
  $ hg log
  changeset: 2:bd2fb7137c85cd5e6b04db4c72a45699e0d90ea9
  tag: tip
  user: bos@camp4.serpentine.com
  date: Wed Jun 29 12:04:20 2005
  summary: Add a helpful, descriptive comment to the makefile.

 
changeset: 1:4a17053ec93dd51ea37340f639db457c42065da6
  user: bos@camp4.serpentine.com
  date: Wed Jun 29 12:03:45 2005
  summary: Add description to hello.c.

 
changeset: 0:5931063e4b0fb17fc4625447b69296356ca6cdfc
  user: bos@camp4.serpentine.com
  date: Wed Jun 29 12:02:36 2005
  summary: Add hello, world.
Line 42: Line 45:
 revision: 1:1c18e981f8b0bd07d2b3343825486c010a82ad6a
 changeset: 1:4a17053ec93dd51ea37340f639db457c42065da6
 user: bos@camp4.serpentine.com
 date: Wed Jun 29 12:03:45 2005
 files: hello.c
 description:
Add description to hello.c.
 ...
  revision: 1:1c18e981f8b0bd07d2b3343825486c010a82ad6a
  changeset: 1:4a17053ec93dd51ea37340f639db457c42065da6
  user: bos@camp4.serpentine.com
  date: Wed Jun 29 12:03:45 2005
  files: hello.c
  description:
 
Add description to hello.c.

  ...

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.

 $ cd my-hello
  $ hg log
  changeset:   2:bd2fb7137c85cd5e6b04db4c72a45699e0d90ea9
  tag:         tip
  user:        bos@camp4.serpentine.com
  date:        Wed Jun 29 12:04:20 2005
  summary:     Add a helpful, descriptive comment to the makefile.

  changeset:   1:4a17053ec93dd51ea37340f639db457c42065da6
  user:        bos@camp4.serpentine.com
  date:        Wed Jun 29 12:03:45 2005
  summary:     Add description to hello.c.

  changeset:   0:5931063e4b0fb17fc4625447b69296356ca6cdfc
  user:        bos@camp4.serpentine.com
  date:        Wed Jun 29 12:02:36 2005
  summary:     Add hello, world.

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 -v log
  revision:    1:1c18e981f8b0bd07d2b3343825486c010a82ad6a
  changeset:   1:4a17053ec93dd51ea37340f639db457c42065da6
  user:        bos@camp4.serpentine.com
  date:        Wed Jun 29 12:03:45 2005
  files:       hello.c
  description:
  Add description to hello.c.

  ...

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)