[PATCH] filemerge: convert a couple of wvfs calls in internal mergetools to contexts

Yuya Nishihara yuya at tcha.org
Sat Jul 1 01:09:59 UTC 2017


On Mon, 26 Jun 2017 23:03:17 -0700, Phil Cohen wrote:
> # HG changeset patch
> # User Phil Cohen <phillco at fb.com>
> # Date 1498542735 25200
> #      Mon Jun 26 22:52:15 2017 -0700
> # Node ID 016ce3d8fee0968dd30894bf78c3812a19a240d9
> # Parent  d2f2b5a60476e18e69fdcd76ac296d37bb69b112
> filemerge: convert a couple of wvfs calls in internal mergetools to contexts

[...]

> +def _underlyingfctxifabsent(filectx):
> +    """Sometimes when resolving, our fcd is actually an absentfilectx, but
> +    we want to write to it (to do the resolve). This helper returns the
> +    underyling workingfilectx in that case.
> +    """
> +    if filectx.isabsent():
> +        return filectx.changectx()[filectx.path()]
> +    else:
> +        return filectx

I think lesser abstraction is good if we have no better alternative. Queued,
thanks.


More information about the Mercurial-devel mailing list