[PATCH 02 of 14 RFC] context: add a method to convert node to ctx

Kevin Bullock kbullock+mercurial at ringworld.org
Thu Jul 11 14:11:32 CDT 2013


On 9 Jul 2013, at 5:17 PM, Sean Farley wrote:

> mpm at selenic.com writes:
> 
>> On Tue, 2013-07-09 at 16:54 -0500, Sean Farley wrote:
>>> # HG changeset patch
>>> # User Sean Farley <sean.michael.farley at gmail.com>
>>> # Date 1373322965 18000
>>> #      Mon Jul 08 17:36:05 2013 -0500
>>> # Node ID bf0f87c072f524b8e054de72af143a0dfc2fcffb
>>> # Parent  2bda9c94e65cff8c6968d82cfc07ec6049b194c0
>>> context: add a method to convert node to ctx
>>> 
>>> I had a hard time deciding where to place this function. Perhaps it could go
>>> into scmutil or util?
>>> 
>>> This adds a method as a common place for testing if an object is a context
>>> object, and if it isn't, then to find the corresponding context object in the
>>> repo.
>> 
>> How about simply letting the context constructor.. accept contexts? It
>> already accepts everything else.
> 
> Heh, fair enough. I'll change it in the next version.

That right there will change the next three patches as well. You seem to have a natural break in your series after patch 5 anyway; when you re-send, here's approximately how I'd like to see them broken up:

1. Patch 1: optional ipdb support.
2. Patches 2-5: let patch.diff take contexts.
3. Patches 7 & 9: uncontroversial additions of __repr__ methods.
4. Patches 6 & 8: memctx extends workingctx.
5. Patches 10-14: memfilectx work.

Note that I'm still not sure why the patches in #5 are needed, because they almost all have one-line commit messages. Convince us. :)

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list