Differences between revisions 1 and 11 (spanning 10 versions)
Revision 1 as of 2005-08-26 00:58:33
Size: 3633
Editor: waste
Comment:
Revision 11 as of 2005-09-21 20:12:01
Size: 3673
Editor: AdrienBeau
Comment: Fact-checked, completed and corrected
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== ["Tutorial"] - examining repository history == == Tutorial - examining repository history ==
Line 3: Line 3:
At this point, we have followed TutorialClone to clone a ["Repository"]; our local copy is called ''my-hello''. At this point, we have followed TutorialClone to clone a ["Repository"]; our local copy is called {{{my-hello}}}.
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.
Line 8: Line 8:
 $ 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.
}}}
$ 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
Line 17: Line 16:
{{{
 
changeset: 1:4a17053ec93dd51ea37340f639db457c42065da6
 user: bos@camp4.serpentine.com
 date: Wed Jun 29 12:03:45 2005
 summary: Add description to hello.c.
}}}
changeset: 0:0a04b987be5a
user: mpm@selenic.com
date: Fri Aug 26 01:20:50 2005 -0700
summary: Create a standard "hello, world" program
Line 24: Line 21:
{{{
 changeset: 0:5931063e4b0fb17fc4625447b69296356ca6cdfc
 user: bos@camp4.serpentine.com
 date: Wed Jun 29 12:02:36 2005
 summary: Add hello, world.
Line 34: Line 26:
 * 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.
   * 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 listed just below. This is the case in our example.
Line 48: Line 42:
 $ 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.
}}}
$ 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
Line 58: Line 51:
{{{
 ...
(...)
Line 64: Line 56:
 * ''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.
 * {{{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.

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:   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 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 listed just below. This is the case in our example.

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.

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