Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 24410:86de531e07e1 stable
adjustlinkrev: prepare source revs for ancestry only once
We'll need some more complex initialisation to handle workingfilectx
case. We do this small change in a different patch for clarity.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 19 Mar 2015 23:52:26 -0700 |
parents | dd01834a696f |
children | 5a12ef618c03 |
comparison
equal
deleted
inserted
replaced
24407:dd01834a696f | 24410:86de531e07e1 |
---|---|
772 fr = filelog.rev(fnode) | 772 fr = filelog.rev(fnode) |
773 lkr = filelog.linkrev(fr) | 773 lkr = filelog.linkrev(fr) |
774 # hack to reuse ancestor computation when searching for renames | 774 # hack to reuse ancestor computation when searching for renames |
775 memberanc = getattr(self, '_ancestrycontext', None) | 775 memberanc = getattr(self, '_ancestrycontext', None) |
776 iteranc = None | 776 iteranc = None |
777 revs = [srcrev] | |
777 if memberanc is None: | 778 if memberanc is None: |
778 memberanc = iteranc = cl.ancestors([srcrev], lkr, | 779 memberanc = iteranc = cl.ancestors(revs, lkr, inclusive=inclusive) |
779 inclusive=inclusive) | |
780 # check if this linkrev is an ancestor of srcrev | 780 # check if this linkrev is an ancestor of srcrev |
781 if lkr not in memberanc: | 781 if lkr not in memberanc: |
782 if iteranc is None: | 782 if iteranc is None: |
783 iteranc = cl.ancestors([srcrev], lkr, inclusive=inclusive) | 783 iteranc = cl.ancestors(revs, lkr, inclusive=inclusive) |
784 for a in iteranc: | 784 for a in iteranc: |
785 ac = cl.read(a) # get changeset data (we avoid object creation) | 785 ac = cl.read(a) # get changeset data (we avoid object creation) |
786 if path in ac[3]: # checking the 'files' field. | 786 if path in ac[3]: # checking the 'files' field. |
787 # The file has been touched, check if the content is | 787 # The file has been touched, check if the content is |
788 # similar to the one we search for. | 788 # similar to the one we search for. |