diff mercurial/context.py @ 34017:be814edf3306

metadataonlyctx: don't crash when reusing the manifest with deletions This was originally fixed by Mateusz Kwapich for the `metaedit` command in fb-hgext with a test for the `metaedit` command. It didn't get upstreamed because `metaedit` was not in core. This patch fixes the crash and adds a test about `metadataonlyctx` to avoid future regressions. Differential Revision: https://phab.mercurial-scm.org/D550
author Jun Wu <quark@fb.com>
date Mon, 28 Aug 2017 16:58:59 -0700
parents becce02036e1
children 65ae54582713
line wrap: on
line diff
--- a/mercurial/context.py	Mon Aug 28 16:49:41 2017 -0700
+++ b/mercurial/context.py	Mon Aug 28 16:58:59 2017 -0700
@@ -2371,7 +2371,7 @@
         for f in self._files:
             if not managing(f):
                 added.append(f)
-            elif self[f]:
+            elif f in self:
                 modified.append(f)
             else:
                 removed.append(f)