Patchwork D12624: amend: add test showing poor behavior when copies are involved

login
register
mail settings
Submitter phabricator
Date May 12, 2022, 1:16 a.m.
Message ID <differential-rev-PHID-DREV-cspuhakixgexqefvk5mz-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50976/
State New
Headers show

Comments

phabricator - May 12, 2022, 1:16 a.m.
spectral created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12624

AFFECTED FILES
  tests/test-amend.t

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-amend.t b/tests/test-amend.t
--- a/tests/test-amend.t
+++ b/tests/test-amend.t
@@ -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 !)