hglib patch: fetch parents when doing hg log, et al.

Alastair Houghton alastair at alastairs-place.net
Mon Oct 29 10:52:05 CDT 2012

Hi all,

Please find attached a patch to python-hglib that makes the library fetch parent information automatically.  This makes any iteration through the repository from the hglib client a *lot* quicker because it doesn't have to keep asking for the parent information separately.

You can get the new information from the revision tuples by asking for the "parents" property; it's encoded as a list of tuples of type parentinfo, each of which has a rev and node property.

I've also updated changectx to use this source for parent information, with the result that the parents property of a changectx will also be faster.

I was careful to add the new property at the end of the revision tuple, so that existing code that accesses it by index shouldn't be affected.

Kind regards,


p.s. I'm not a member of the mercurial-devel mailing list, so any replies will need to be copied to me.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: parents.patch
Type: application/octet-stream
Size: 4174 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121029/4aed06a1/attachment.obj>

More information about the Mercurial-devel mailing list