amend: add test showing poor behavior when copies are involved stable
authorKyle Lippincott <spectral@google.com>
Wed, 11 May 2022 17:56:10 -0700
branchstable
changeset 49178 dc342071297f
parent 49166 77b5a190571c
child 49179 df68d64b0d50
amend: add test showing poor behavior when copies are involved Differential Revision: https://phab.mercurial-scm.org/D12624
tests/test-amend.t
--- a/tests/test-amend.t	Wed May 04 17:40:23 2022 +0100
+++ b/tests/test-amend.t	Wed May 11 17:56:10 2022 -0700
@@ -609,3 +609,20 @@
   >   hg status
   > fi
   OK.
+
+Amending a commit that has copies but not specifying those copies shouldn't
+cause them to be lost
+
+  $ cd $TESTTMP
+  $ hg init dont-lose-copies; cd dont-lose-copies
+  $ echo r0 > r0; hg commit -qAm "r0"
+  $ hg cp r0 r0_copied; hg commit -qm "copy r0"
+  $ echo hi > new_file_amend_me
+  $ hg status --change . --copies
+  A r0_copied
+    r0
+  $ hg amend -qA new_file_amend_me
+  $ hg status --change . --copies
+  A new_file_amend_me
+  A r0_copied
+    r0 (missing-correct-output !)