Mercurial > hg-stable
changeset 41995:6fef387af1da
memfilectx: override copysource() instead of using dummy nodeid
The "_copied" property in basefilectx is used by renamed() and
copysource(). committablefilectx (which memfilectx subclasses)
overrides renamed() and writes it in terms of copysource() instead of
_copied. That means that the nodeid part of "_copied" is memfilectx is
unused. Let's instead override copysource() too so we don't need the
"_copied".
Differential Revision: https://phab.mercurial-scm.org/D6159
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 19 Mar 2019 23:00:07 -0700 |
parents | 550a172a603b |
children | 77ef3498ceb3 |
files | mercurial/context.py |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Tue Mar 19 22:58:39 2019 -0700 +++ b/mercurial/context.py Tue Mar 19 23:00:07 2019 -0700 @@ -2393,9 +2393,10 @@ self._flags = 'x' else: self._flags = '' - self._copied = None - if copysource: - self._copied = (copysource, nullid) + self._copysource = copysource + + def copysource(self): + return self._copysource def cmp(self, fctx): return self.data() != fctx.data()