diff mercurial/context.py @ 42528:e079e001d536

rebase: fix in-memory rebasing of copy of empty file Classic Python mistake of unintentionally treating None and empty string the same. Differential Revision: https://phab.mercurial-scm.org/D6570
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 24 Jun 2019 16:01:22 -0700
parents 87a34c767384
children 97b03f0e7c7b
line wrap: on
line diff
--- a/mercurial/context.py	Mon Jun 24 16:07:59 2019 -0700
+++ b/mercurial/context.py	Mon Jun 24 16:01:22 2019 -0700
@@ -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,