Differences between revisions 8 and 12 (spanning 4 versions)
Revision 8 as of 2005-08-26 08:23:38
Size: 3262
Editor: mpm
Comment:
Revision 12 as of 2005-09-30 01:44:55
Size: 4868
Editor: TKSoh
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
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. 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. The {{{log}}} command comes with a {{{-r}}} option to view specific changesets, as well as a {{{-p}}} option to the patches associated with the changesets.
Line 8: Line 8:
$ cd my-hello
$ hg log
Line 18: Line 20:

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

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

diff -r 0a04b987be5a -r 82e55d328c8c Makefile
--- /dev/null Fri Aug 26 01:20:50 2005 -0700
+++ b/Makefile Fri Aug 26 01:21:28 2005 -0700
@@ -0,0 +1,1 @@
+all: hello
Line 19: Line 42:
Line 22: Line 46:
 * In the case above, we can see that the ["Repository"]'s history consists of four ["ChangeSet"]s.    * In our case above, we can see that the ["Repository"]'s history consists of two ["ChangeSet"]s.
Line 27: Line 51:
   * 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.    * You can assign one or more ["Tag"]s to any ChangeSet. Actually, not that many ["ChangeSet"]s will have ["Tag"]s associated with them, so the {{{tag}}} line will seldom be present.
Line 32: Line 56:
 * {{{parent}}} identifies the parent ["ChangeSet"]s, in case there are more than one, which happens when you merge changes from several repositories.
   * Most of the times there is only one parent, which is the one changeset older than itself. This is the case in our example above.
Line 33: Line 59:
We can get more detailed history information by asking for verbose output: We can get more detailed history information by asking for verbose output with the {{{-v}}} option, or the {{{--debug}}} global option for everything under the sun:
Line 36: Line 62:
$ hg log -v
Line 44: Line 71:
... (...)

$ hg log --debug
manifest: 1:0c7c1d435e6703e03ac6634a7c32da3a082d1600
changeset: 1:82e55d328c8ca4ee16520036c0aaace03a5beb65
tag: tip
parent: 0:0a04b987be5ae354b710cefeba0e2d9de7ad41a9
parent: -1:0000000000000000000000000000000000000000
user: mpm@selenic.com
date: Fri Aug 26 01:21:28 2005 -0700
files+: Makefile
description:
Create a makefile

(...)
Line 46: Line 87:
Line 48: Line 90:
 * {{{revision}}} is a field you can safely ignore.  * {{{changeset}}} now gives the unabbreviated ChangeSetID.
Line 51: Line 93:
   * In our case, the descriptions are only one-line long, so there's not much difference.

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. The log command comes with a -r option to view specific changesets, as well as a -p option to the patches associated with the changesets.

$ cd my-hello
$ 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

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

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

diff -r 0a04b987be5a -r 82e55d328c8c Makefile
--- /dev/null   Fri Aug 26 01:20:50 2005 -0700
+++ b/Makefile  Fri Aug 26 01:21:28 2005 -0700
@@ -0,0 +1,1 @@
+all: hello

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 our case above, we can see that the ["Repository"]'s history consists of two ["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. Actually, not that many ["ChangeSet"]s will have ["Tag"]s associated with them, so the tag line will seldom 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.

  • parent identifies the parent ["ChangeSet"]s, in case there are more than one, which happens when you merge changes from several repositories.

    • Most of the times there is only one parent, which is the one changeset older than itself. This is the case in our example above.

We can get more detailed history information by asking for verbose output with the -v option, or the --debug global option for everything under the sun:

$ 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

(...)

$ hg log --debug
manifest:    1:0c7c1d435e6703e03ac6634a7c32da3a082d1600
changeset:   1:82e55d328c8ca4ee16520036c0aaace03a5beb65
tag:         tip
parent:      0:0a04b987be5ae354b710cefeba0e2d9de7ad41a9
parent:      -1:0000000000000000000000000000000000000000
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.

  • changeset now gives the unabbreviated ChangeSetID.

  • files lists the files modified in this ChangeSet.

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

    • In our case, the descriptions are only one-line long, so there's not much difference.

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)