Mercurial > hg
changeset 41769:e9413a3be093
context: rewrite renamed() in terms of new copysource() where appropriate
It's only the filectx for committed files that have the copy source's
nodeid easily available; workingfilectx's and overlayfilectx's
renamed() simply find the nodeid by looking in the changeset's p1's
manifest.
Differential Revision: https://phab.mercurial-scm.org/D6009
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sun, 25 Mar 2018 21:28:30 -0700 |
parents | 041d829575ed |
children | c7a843aa4b42 |
files | mercurial/context.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Sun Mar 25 21:32:16 2018 -0700 +++ b/mercurial/context.py Sun Mar 25 21:28:30 2018 -0700 @@ -1701,7 +1701,7 @@ def data(self): return self._repo.wread(self._path) def renamed(self): - rp = self._repo.dirstate.copied(self._path) + rp = self.copysource() if not rp: return None return rp, self._changectx._parents[0]._manifest.get(rp, nullid) @@ -2147,7 +2147,7 @@ return self._parent.exists(self._path) def renamed(self): - path = self._parent.copydata(self._path) + path = self.copysource() if not path: return None return path, self._changectx._parents[0]._manifest.get(path, nullid)