hg convert changes a revision's node ID for an unknown reason

Peter Hosey boredzo at gmail.com
Sat Jun 25 17:26:07 CDT 2011


I'm converting a Mercurial repository to Mercurial using a filemap to exclude a couple of files.

Now you might be thinking “well yeah, excluding those files changes the revision that added them and all subsequent revs”, but that's not what I'm talking about.

This revision is way, way, *way* older than the excluded files. No other files are excluded, and there is no splicemap, branchmap, or authormap in place. The specific command I'm using is:

hg convert --sourcesort --filemap growl-nocrypto.filemap growl-development-cryptoencumbered growl-development-nocrypto

The filemap file contains:

exclude Core/Source/GNTPKey.h
exclude Core/Source/GNTPKey.m

Here's the log for revisions 182 and 183 in the source repo:

<?xml version="1.0"?>
<log>
<logentry revision="182" node="c7abe423a7879143ccd6b92e819f92a7b0223e43">
<author email="boredzo">boredzo</author>
<date>2004-07-26T06:10:23+00:00</date>
<msg xml:space="preserve">I Hate Distcc, part 2.</msg>
<paths>
<path action="M">Examples/Beep-Carbon/Beep-Carbon.xcode/project.pbxproj</path>
</paths>
</logentry>
<logentry revision="183" node="210fadd5840587b55a32fdb806b91cf00a7bc2dd">
<author email="tick">tick</author>
<date>2004-08-01T22:24:57+00:00</date>
<msg xml:space="preserve">Moving the whistle icon psd to the right place for icons</msg>
<paths>
<path action="A">images/icons/whistle.psd</path>
<path action="R">Examples/whistle.psd</path>
</paths>
<copies>
<copy source="Examples/whistle.psd">images/icons/whistle.psd</copy>
</copies>
</logentry>
</log>

And in the destination:

<?xml version="1.0"?>
<log>
<logentry revision="182" node="c7abe423a7879143ccd6b92e819f92a7b0223e43">
<author email="boredzo">boredzo</author>
<date>2004-07-26T06:10:23+00:00</date>
<msg xml:space="preserve">I Hate Distcc, part 2.</msg>
<paths>
<path action="M">Examples/Beep-Carbon/Beep-Carbon.xcode/project.pbxproj</path>
</paths>
</logentry>
<logentry revision="183" node="9ed2745b6b380e9892933e79184b4310fcb118bd">
<author email="tick">tick</author>
<date>2004-08-01T22:24:57+00:00</date>
<msg xml:space="preserve">Moving the whistle icon psd to the right place for icons</msg>
<paths>
<path action="A">images/icons/whistle.psd</path>
<path action="R">Examples/whistle.psd</path>
</paths>
<copies>
<copy source="Examples/whistle.psd">images/icons/whistle.psd</copy>
</copies>
</logentry>
</log>

If you diff these, you'll see that only the node ID for r183 is different.

I checked the SHA-1 of images/icons/whistle.psd in each repo. It's 52d8343c6b4cebe55e3b9f9b5eae2bd15344b326 in both. diff -s confirms that both files have identical contents.

So, why is the node ID different in the converted repo, and what can I do about this (or is it a bug)?



More information about the Mercurial mailing list