What constitutes the "identity" of a changeset?

James Westby jw+debian at jameswestby.net
Sat Mar 29 11:30:01 GMT 2008


On Sat, 2008-03-29 at 17:06 +0900, Stephen J. Turnbull wrote:
> 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:

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

Mercurial will have a way to access that information, and the tree
will have the same name I am sure.

However, you are neglecting the caveat I put in to try and make the
discussion simpler, "assuming  certain rules along the way", which
I'm afraid I mangeled, and it should have read "assuming we both
followed certain rules along the way".

You seem to implicitly acknowledge that git's revision ids will be
different, and I'm sure you know why. As you did the commits
in sequence they will have different timestamps, and as the meta
data is input to the naming hash then you will get different names.
You must also use the same commiter emails etc. for each import.

An importer tool will extract the information from the tool it is
exporting from, so it works fine in the case of things like git-svn.

If you were to extract the inventory sha1s from bzr then they would
also be equal and you could use the same test for equality.

Thanks,

James






More information about the bazaar mailing list