Differences between revisions 25 and 26
Revision 25 as of 2008-01-05 13:56:46
Size: 6251
Editor: abuehl
Comment: linking "Merge"
Revision 26 as of 2008-01-12 13:49:33
Size: 6389
Editor: abuehl
Comment: lowercase links
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: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.
Line 24: Line 24:
 * Each paragraph describes a particular ChangeSet. A changeset is a modification of one or more files, grouped together into a logical unit.  * Each paragraph describes a particular [:ChangeSet:changeset]. A changeset is a modification of one or more files, grouped together into a logical unit.
Line 27: Line 27:
   * 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 hexadecimal string after the colon is a short-form ["ChangeSetID"]; it 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 revision number.
 * {{{tag}}} is a ["Tag"], an arbitrary symbolic name for a changeset.
   * The first number before the colon is a [:RevisionNumber:revision number]; it is a local short-hand way of identifying the changeset. It is only valid within this repository.
   * The hexadecimal string after the colon is a short-form [:ChangeSetID:changeset ID]; it 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 revision number.
 * {{{tag}}} is a [:Tag:tag], an arbitrary symbolic name for a changeset.
Line 31: Line 31:
   * 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), the {{{tip}}} tag will be removed from the most recent changeset and will be added to the new changeset.    * The special tag named {{{tip}}} always identifies the [:Tip:tip], which is the most recent changeset in the repository. If you create another changeset (and we will, soon), the {{{tip}}} tag will be removed from the most recent changeset and will be added to the new changeset.
Line 34: Line 34:
 * {{{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"] changesets, in case there are more than one, which happens when you ["Merge"] changes from several repositories.
 * {{{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 (see also ["ChangeSetComments"]).
 * {{{parent}}} identifies the [:Parent:parent] changesets, in case there are more than one, which happens when you [:Merge:merge] changes from several repositories.
Line 69: Line 69:
 * {{{changeset}}} now gives the unabbreviated ChangeSetID.  * {{{changeset}}} now gives the unabbreviated changeset ID.
Line 75: Line 75:
The --debug output adds the following fields to the verbose output: The --debug output adds the following fields to the verbose output (see also ["DebuggingFeatures"]):
Line 79: Line 79:
 * {{{manifest}}} gives the ["Manifest"] ID for this changeset.  * {{{manifest}}} gives the [:Manifest:manifest] ID for this changeset.
Line 94: Line 94:
<!> The {{{-r}}} option actually supports a very flexible syntax to select range of changesets. However, due to limited number of changesets available in our sample repository, we are unable to provide a good demonstration. Please consult Mercurial's [http://www.selenic.com/mercurial/hg.1.html manpage] for more information. <!> The {{{-r}}} option actually supports a very flexible syntax to select range of changesets. However, due to limited number of changesets available in our sample repository, we are unable to provide a good demonstration. Please consult the [http://www.selenic.com/mercurial/hg.1.html manpage] for more information.

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: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:   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: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 changesets.
  • changeset identifies a changeset.

    • The first number before the colon is a [:RevisionNumber:revision number]; it is a local short-hand way of identifying the changeset. It is only valid within this repository.

    • The hexadecimal string after the colon is a short-form [:ChangeSetID:changeset ID]; it 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 revision number.

  • tag is a [:Tag:tag], an arbitrary symbolic name for a changeset.

    • You can assign one or more tags to any changeset. Actually, not that many changeset will have tags associated with them, so the tag line will seldom be present.

    • The special tag named tip always identifies the [:Tip:tip], which is the most recent changeset in the repository. If you create another changeset (and we will, soon), the tip tag will be removed from the most recent changeset and will be added to the new changeset.

  • 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 the local 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 (see also ["ChangeSetComments"]).

  • parent identifies the [:Parent:parent] changesets, in case there are more than one, which happens when you [:Merge: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 changeset ID.

  • 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.

The --debug output adds the following fields to the verbose output (see also ["DebuggingFeatures"]):

  • file+ lists the file added in this changeset.

  • file- lists the file removed in this changeset.

  • manifest gives the [:Manifest:manifest] ID for this changeset.

  • two parent fields giving the changeset ID of both parents for this changeset, where -1:0000000000000000000000000000000000000000 refers to a non-existant parent.

The log command comes with a -r option to view specific changesets.

$ 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

<!> The -r option actually supports a very flexible syntax to select range of changesets. However, due to limited number of changesets available in our sample repository, we are unable to provide a good demonstration. Please consult the [http://www.selenic.com/mercurial/hg.1.html manpage] for more information.

The log command also comes with a -p option to show the patches associated with the changesets:

$ 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

We can also use the tip command to show info of the tip, i.e. the latest, changeset. The tip command may be considered a shortcut to log -r tip.

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

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

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


CategoryTutorial

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