[PATCH 2 of 3 v2] merge: support calculating merge actions against non-working contexts

Siddharth Agarwal sid0 at fb.com
Wed Nov 28 14:01:01 CST 2012


On 11/27/2012 05:13 PM, Bryan O'Sullivan wrote:
>
> These uses of isinstance make me wince.
>
> The first one could be addressed by adding a no-op dirty method to 
> whatever type tctx is when it's not a workingctx, and have it always 
> return the right value for the branch to evaluate correctly. That 
> would make the code easier to understand, I think.
>
> Maybe something similar could be done for the second case, too? I 
> haven't thought about that in any depth.

This should basically be the same thing -- _forgetremoved checks 
deleted() and removed(), and so does workingctx.dirty() among other 
things. Both in turn are guided by a (possibly cached) _status. One 
solution would be to move everything to changectx, and set _status to 
empty for changectxs that aren't workingctxs.


More information about the Mercurial-devel mailing list