Patchwork D6570: rebase: fix in-memory rebasing of copy of empty file

login
register
mail settings
Submitter phabricator
Date June 27, 2019, 4:20 p.m.
Message ID <6efd74450f42092ab665e4c37deb1cbb@localhost.localdomain>
Download mbox | patch
Permalink /patch/40696/
State Not Applicable
Headers show

Comments

phabricator - June 27, 2019, 4:20 p.m.
Closed by commit rHGe079e001d536: rebase: fix in-memory rebasing of copy of empty file (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6570?vs=15653&id=15680

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6570/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6570

AFFECTED FILES
  mercurial/context.py
  tests/test-rebase-inmemory.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -795,12 +795,10 @@ 
   $ hg co -q 0
   $ hg mv a b
   $ hg ci -qm 'rename a to b'
-BROKEN: shouldn't crash
   $ hg rebase -d 1
   rebasing 2:b977edf6f839 "rename a to b" (tip)
   merging a and b to b
-  abort: b@c71e275f666f: not found in manifest!
-  [255]
+  saved backup bundle to $TESTTMP/rebase-rename-empty/.hg/strip-backup/b977edf6f839-0864f570-rebase.hg
   $ hg st --copies --change .
   A b
     a
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -2159,7 +2159,9 @@ 
         # the file is marked as existing.
         if exists and data is None:
             oldentry = self._cache.get(path) or {}
-            data = oldentry.get('data') or self._wrappedctx[path].data()
+            data = oldentry.get('data')
+            if data is None:
+                data = self._wrappedctx[path].data()
 
         self._cache[path] = {
             'exists': exists,