diff mercurial/cmdutil.py @ 48841:770e1352e9f9 stable

amend: don't remove unselected removals from memctx When there are removed files in the working copy and they are not selected to be amended into the parent, the `filectxfn` we create for the `memctx` would still return `None` before this patch. That's clearly incorrect; we should return the `filectx` from the unamended commit. Somehow it seems to not matter much except for the case with copies stored in changesets. Thanks to Kyle Lippincott for doing all the debugging and identifying the fix for this issue. Differential Revision: https://phab.mercurial-scm.org/D12573
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 18 Apr 2022 20:45:38 -0700
parents 877d7e1a4223
children df68d64b0d50 ea98850a136e
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Mon Apr 18 20:39:31 2022 -0700
+++ b/mercurial/cmdutil.py	Mon Apr 18 20:45:38 2022 -0700
@@ -2935,7 +2935,7 @@
             def filectxfn(repo, ctx_, path):
                 try:
                     # Return None for removed files.
-                    if path in wctx.removed():
+                    if path in wctx.removed() and path in filestoamend:
                         return None
 
                     # If the file being considered is not amongst the files