Differences between revisions 11 and 12
Revision 11 as of 2005-09-21 20:12:01
Size: 3673
Editor: AdrienBeau
Comment: Fact-checked, completed and corrected
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 20: 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 37: Line 57:
   * Most of the times there is only one parent, which is listed just below. This is the case in our example.    * 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 39: 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 48: Line 68:
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

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)