"hg transplant" extention and the "extra" field

Greg Ward greg-hg at gerg.ca
Wed Apr 14 20:35:44 CDT 2010


On Wed, Apr 14, 2010 at 8:58 PM, CG Linden <cg at lindenlab.com> wrote:
> It would appear that the code for the transplant extension does this:
>
> extra = {'transplant_source': node}

Yes.  You can see the effect with "hg log --debug" on a transplanted changeset.

> This effectively assigns an object pointer to that key. When this later gets
> serialized and de-serialized, I get some random string, effectively
> rendering this piece of metadata useless - or maybe I'm not understanding
> python correctly...

It's not a random string, it's the changeset ID of the source
changeset in binary.  "hg log --debug" renders it in hex.  If you're
working in Python, use mercurial.node.short() to get a short 12-digit
string, or mercurial.node.hex() to get the full 40-digit string.

Greg


More information about the Mercurial-devel mailing list