Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 49067: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 | ea98850a136e df68d64b0d50 |
comparison
equal
deleted
inserted
replaced
49066:65eda809b943 | 49067:770e1352e9f9 |
---|---|
2933 ] | 2933 ] |
2934 | 2934 |
2935 def filectxfn(repo, ctx_, path): | 2935 def filectxfn(repo, ctx_, path): |
2936 try: | 2936 try: |
2937 # Return None for removed files. | 2937 # Return None for removed files. |
2938 if path in wctx.removed(): | 2938 if path in wctx.removed() and path in filestoamend: |
2939 return None | 2939 return None |
2940 | 2940 |
2941 # If the file being considered is not amongst the files | 2941 # If the file being considered is not amongst the files |
2942 # to be amended, we should use the file context from the | 2942 # to be amended, we should use the file context from the |
2943 # old changeset. This avoids issues when only some files in | 2943 # old changeset. This avoids issues when only some files in |