##// END OF EJS Templates
_adjustlinkrev: reuse ancestors set during rename detection (issue4514)...
Pierre-Yves David -
r23980:c1ce5442 stable
parent child Browse files
Show More
@@ -766,10 +766,17 b' class basefilectx(object):'
766 # fetch the linkrev
766 # fetch the linkrev
767 fr = filelog.rev(fnode)
767 fr = filelog.rev(fnode)
768 lkr = filelog.linkrev(fr)
768 lkr = filelog.linkrev(fr)
769 # hack to reuse ancestor computation when searching for renames
770 memberanc = getattr(self, '_ancestrycontext', None)
771 iteranc = None
772 if memberanc is None:
773 memberanc = iteranc = cl.ancestors([srcrev], lkr,
774 inclusive=inclusive)
769 # check if this linkrev is an ancestor of srcrev
775 # check if this linkrev is an ancestor of srcrev
770 anc = cl.ancestors([srcrev], lkr, inclusive=inclusive)
776 if lkr not in memberanc:
771 if lkr not in anc:
777 if iteranc is None:
772 for a in anc:
778 iteranc = cl.ancestors([srcrev], lkr, inclusive=inclusive)
779 for a in iteranc:
773 ac = cl.read(a) # get changeset data (we avoid object creation)
780 ac = cl.read(a) # get changeset data (we avoid object creation)
774 if path in ac[3]: # checking the 'files' field.
781 if path in ac[3]: # checking the 'files' field.
775 # The file has been touched, check if the content is
782 # The file has been touched, check if the content is
@@ -826,6 +833,8 b' class basefilectx(object):'
826 rev = self._adjustlinkrev(path, l, fnode, self.rev())
833 rev = self._adjustlinkrev(path, l, fnode, self.rev())
827 fctx = filectx(self._repo, path, fileid=fnode, filelog=l,
834 fctx = filectx(self._repo, path, fileid=fnode, filelog=l,
828 changeid=rev)
835 changeid=rev)
836 fctx._ancestrycontext = getattr(self, '_ancestrycontext', None)
837
829 else:
838 else:
830 fctx = filectx(self._repo, path, fileid=fnode, filelog=l)
839 fctx = filectx(self._repo, path, fileid=fnode, filelog=l)
831 ret.append(fctx)
840 ret.append(fctx)
@@ -170,8 +170,11 b' def _forwardcopies(a, b):'
170 missing = set(b.manifest().iterkeys())
170 missing = set(b.manifest().iterkeys())
171 missing.difference_update(a.manifest().iterkeys())
171 missing.difference_update(a.manifest().iterkeys())
172
172
173 ancestrycontext = a._repo.changelog.ancestors([b.rev()], inclusive=True)
173 for f in missing:
174 for f in missing:
174 ofctx = _tracefile(b[f], am, limit)
175 fctx = b[f]
176 fctx._ancestrycontext = ancestrycontext
177 ofctx = _tracefile(fctx, am, limit)
175 if ofctx:
178 if ofctx:
176 cm[f] = ofctx.path()
179 cm[f] = ofctx.path()
177
180
General Comments 0
You need to be logged in to leave comments. Login now