Patchwork D6308: context: check file exists before getting data from _wrappedctx

login
register
mail settings
Submitter phabricator
Date April 24, 2019, 6:23 p.m.
Message ID <6c1df7fbcbbf5528b1f1023a4aa783d9@localhost.localdomain>
Download mbox | patch
Permalink /patch/39818/
State Not Applicable
Headers show

Comments

phabricator - April 24, 2019, 6:23 p.m.
pulkit updated this revision to Diff 14911.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6308?vs=14910&id=14911

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

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

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: martinvonz, 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
@@ -797,5 +797,9 @@ 
   $ hg rebase -r . -d 1 --config ui.merge=internal:merge3
   rebasing 2:4c5d7dae8fbb "remove the whitespace again" (tip)
   merging foo
-  abort: foo.orig@1ed8791587a6: not found in manifest!
-  [255]
+  hit merge conflicts; re-running rebase without in-memory merge
+  rebasing 2:4c5d7dae8fbb "remove the whitespace again" (tip)
+  merging foo
+  warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
+  unresolved conflicts (see hg resolve, then hg rebase --continue)
+  [1]
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1824,7 +1824,7 @@ 
     def data(self, path):
         if self.isdirty(path):
             if self._cache[path]['exists']:
-                if self._cache[path]['data']:
+                if self._cache[path]['data'] is not None:
                     return self._cache[path]['data']
                 else:
                     # Must fallback here, too, because we only set flags.