Mercurial > public > mercurial-scm > hg
diff mercurial/context.py @ 41949:e1ceefab9bca
rebase: fix crash with in-memory rebase and copies
When using regular on-disk rebase, filectx.markcopies() calls to
dirstate.copy(), which happily records the copy. Then it's simply
ignored if it doesn't matter for the commit (as in the test case I
added in the previous patch). Let's do the same for overlayworkingctx.
Differential Revision: https://phab.mercurial-scm.org/D6133
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 14 Mar 2019 14:46:29 -0700 |
parents | 2ba96fca8528 |
children | 21cc92fea2aa |
line wrap: on
line diff
--- a/mercurial/context.py Thu Mar 14 13:53:20 2019 -0700 +++ b/mercurial/context.py Thu Mar 14 14:46:29 2019 -0700 @@ -1891,10 +1891,8 @@ return self._wrappedctx[path].date() def markcopied(self, path, origin): - if self.isdirty(path): - self._cache[path]['copied'] = origin - else: - raise error.ProgrammingError('markcopied() called on clean context') + self._markdirty(path, exists=True, date=self.filedate(path), + flags=self.flags(path), copied=origin) def copydata(self, path): if self.isdirty(path): @@ -2098,7 +2096,8 @@ del self._cache[path] return keys - def _markdirty(self, path, exists, data=None, date=None, flags=''): + def _markdirty(self, path, exists, data=None, date=None, flags='', + copied=None): # data not provided, let's see if we already have some; if not, let's # grab it from our underlying context, so that we always have data if # the file is marked as existing. @@ -2111,7 +2110,7 @@ 'data': data, 'date': date, 'flags': flags, - 'copied': None, + 'copied': copied, } def filectx(self, path, filelog=None):