Skip to content
Snippets Groups Projects
Commit 2896f535 authored by Matt Mackall's avatar Matt Mackall
Browse files

filectx: use _descendantrev in parents()

This lets us be lazy about linkrev adjustments when tracing history.
parent ff070a53
No related branches found
No related tags found
No related merge requests found
......@@ -835,7 +835,7 @@
# If self is associated with a changeset (probably explicitly
# fed), ensure the created filectx is associated with a
# changeset that is an ancestor of self.changectx.
rev = self._adjustlinkrev(path, l, fnode, self.rev())
fctx = filectx(self._repo, path, fileid=fnode, filelog=l,
changeid=rev)
# This lets us later use _adjustlinkrev to get a correct link.
fctx = filectx(self._repo, path, fileid=fnode, filelog=l)
fctx._descendantrev = self.rev()
fctx._ancestrycontext = getattr(self, '_ancestrycontext', None)
......@@ -841,5 +841,9 @@
fctx._ancestrycontext = getattr(self, '_ancestrycontext', None)
elif '_descendantrev' in vars(self):
# Otherwise propagate _descendantrev if we have one associated.
fctx = filectx(self._repo, path, fileid=fnode, filelog=l)
fctx._descendantrev = self._descendantrev
fctx._ancestrycontext = getattr(self, '_ancestrycontext', None)
else:
fctx = filectx(self._repo, path, fileid=fnode, filelog=l)
ret.append(fctx)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment