What constitutes the "identity" of a changeset?

Stephen J. Turnbull stephen at xemacs.org
Sat Mar 29 08:06:14 GMT 2008

James Westby writes:
 > My apologies, 
 > here is the end of my post.
 > On Fri, 2008-03-28 at 21:12 +0000, James Westby wrote:
 > > If you did the same thing in Mercurial then, assuming  followed
 > > certain rules along the way, 
 > mercurial would consider them identical, i.e. the last revision
 > in each branch would have the same name.

How do you access the revision name in Mercurial?  Consider:

chibi:tmp steve$ mkdir tryhg
chibi:tmp steve$ cd tryhg/
chibi:tryhg steve$ mkdir repo0
chibi:tryhg steve$ mkdir repo1
chibi:tryhg steve$ cd repo0 
chibi:repo0 steve$ hg init
chibi:repo0 steve$ echo content > A
chibi:repo0 steve$ hg add A
chibi:repo0 steve$ hg commit -m repo0 
chibi:repo0 steve$ cd ../repo1
chibi:repo1 steve$ hg init; echo content > A; hg add A; hg commit -m
chibi:repo1 steve$ hg identify
db9792bcd546 tip
chibi:repo1 steve$ cd ../repo0
chibi:repo0 steve$ hg identify
fee2de8234e3 tip
chibi:repo0 steve$ cd ..
chibi:tryhg steve$ mkdir repo2; cd repo2
chibi:repo2 steve$ hg init; echo content > A; hg add A; hg commit -m
chibi:repo2 steve$ hg identify
f3c6c0c2e24d tip

Now, git has a notion of trees, and in the equivalent case in git you
could do

$ git cat-file commit HEAD | grep tree

and you would get an oid that is the same for all three.  I don't know
how to achieve the equivalent in Mercurial.

More information about the bazaar mailing list