diff mercurial/cmdutil.py @ 34974:0ba3b928f9a9 stable

amend: do not take untracked files as modified or clean (issue5732) fctx.exists() shouldn't be used here as it checks if a file physically exists, which may disagree with the dirstate.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 04 Nov 2017 23:45:59 +0900
parents 527655a049ee
children 5f40efa472db
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sat Nov 04 23:40:26 2017 +0900
+++ b/mercurial/cmdutil.py	Sat Nov 04 23:45:59 2017 +0900
@@ -3180,12 +3180,11 @@
                     if path not in filestoamend:
                         return old.filectx(path)
 
+                    # Return None for removed files.
+                    if path in wctx.removed():
+                        return None
+
                     fctx = wctx[path]
-
-                    # Return None for removed files.
-                    if not fctx.exists():
-                        return None
-
                     flags = fctx.flags()
                     mctx = context.memfilectx(repo,
                                               fctx.path(), fctx.data(),