D5094: merge-tools: when calling external merge tool, describe the resolve inputs
yuja (Yuya Nishihara)
phabricator at mercurial-scm.org
Fri Nov 2 13:20:05 UTC 2018
yuja added a comment.
> > class mappingdict(mappable, _mappingsequence):
> > """Wrapper for a single template mapping
> >
> > This isn't a sequence in a way that the underlying dict won't be iterated
> > as a dict, but shares most of the _mappingsequence functions.
> > """
> >
> > def __init__(self, mapping, name=None, tmpl=None):
> > super(mappingdict, self).__init__(name, tmpl)
> > self._mapping = mapping
> >
> > def tomap(self, context):
> > return self._mapping
> >
> > def tobool(self, context, mapping):
> > # no idea when a template mapping should be considered an empty, but
> > # a mapping dict should have at least one item in practice, so always
> > # mark this as non-empty.
> > return True
> >
> > def tovalue(self, context, mapping):
> > return super(mappingdict, self).tovalue(context, mapping)[0]
>
> I copy/pasted this to https://phab.mercurial-scm.org/D5211. :)
I sent my version with `{p1}/{p2}` example.
You don't need to update this series. I'll queue it once my patches are
accepted.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5094
To: spectral, #hg-reviewers
Cc: yuja, mjpieters, mercurial-devel
More information about the Mercurial-devel
mailing list