Patchwork D12386: tests: demonstrate that copy info in changeset gets lost on amend

login
register
mail settings
Submitter phabricator
Date March 19, 2022, 5:05 a.m.
Message ID <differential-rev-PHID-DREV-rtmxkgwuovkh6pf6plsz-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50730/
State New
Headers show

Comments

phabricator - March 19, 2022, 5:05 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  When copy information is stored in changesets, it gets lost on
  amend. We didn't notice that until now because our users at Google
  have the config set to `compatibility`, which means copy information
  is stored in both changeset and filelogs.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  tests/test-copies-in-changeset.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-copies-in-changeset.t b/tests/test-copies-in-changeset.t
--- a/tests/test-copies-in-changeset.t
+++ b/tests/test-copies-in-changeset.t
@@ -316,6 +316,15 @@ 
   a -> k
 #endif
 
+Existing copy information is preserved by amend
+  $ hg cp a l
+  $ hg ci -m 'copy a to l'
+  $ hg showcopies
+  a -> l
+  $ hg ci --amend -m 'new description'
+  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-*-amend.hg (glob)
+  $ hg showcopies
+  a -> l (no-extra !)
   $ cd ..
 
 Test rebasing a commit with copy information