Mercurial > hg-stable
changeset 24411:5a12ef618c03 stable
adjustlinkrev: handle 'None' value as source
When the source rev value is 'None', the ctx is a working context. We
cannot compute the ancestors from there so we directly skip to its
parents. This will be necessary to allow 'None' value for
'_descendantrev' itself necessary to make all contexts used in
'mergecopies' reuse the same '_ancestrycontext'.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 19 Mar 2015 23:57:34 -0700 |
parents | 86de531e07e1 |
children | 9372180b8c9b |
files | mercurial/context.py |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Thu Mar 19 23:52:26 2015 -0700 +++ b/mercurial/context.py Thu Mar 19 23:57:34 2015 -0700 @@ -774,9 +774,15 @@ # hack to reuse ancestor computation when searching for renames memberanc = getattr(self, '_ancestrycontext', None) iteranc = None - revs = [srcrev] + if srcrev is None: + # wctx case, used by workingfilectx during mergecopy + revs = [p.rev() for p in self._repo[None].parents()] + inclusive = True # we skipped the real (revless) source + else: + revs = [srcrev] if memberanc is None: - memberanc = iteranc = cl.ancestors(revs, lkr, inclusive=inclusive) + memberanc = iteranc = cl.ancestors(revs, lkr, + inclusive=inclusive) # check if this linkrev is an ancestor of srcrev if lkr not in memberanc: if iteranc is None: