tests: show invalid copies when turning off copies-in-changeset
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 16 Jul 2019 21:15:35 -0700
changeset 42860 6f0273558c4b
parent 42859 2b869a515ba6
child 42861 57ea0a81a65c
tests: show invalid copies when turning off copies-in-changeset If you turn on copies in changesets and write a commit with a copy, then turn it off and amend the commit while undoing the copy, the invalid copy information will remain. The read path doesn't crash in invalid copy data, but it seems better to not produce the invalid data. Differential Revision: https://phab.mercurial-scm.org/D6751
tests/test-copies-in-changeset.t
--- a/tests/test-copies-in-changeset.t	Mon Aug 19 15:43:27 2019 -0700
+++ b/tests/test-copies-in-changeset.t	Tue Jul 16 21:15:35 2019 -0700
@@ -133,6 +133,20 @@
   a -> j
   $ hg showcopies --config experimental.copies.read-from=filelog-only
   a -> j
+Existing copy information in the changeset gets removed on amend and writing
+copy information on to the filelog
+  $ hg ci --amend -m 'copy a to j, v2' \
+  > --config experimental.copies.write-to=filelog-only
+  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/dd7bb9581359-a6e6b6d2-amend.hg
+  $ hg changesetcopies
+  files: j
+  filesadded: 0
+  filesremoved: 
+  
+  p1copies: 0\x00a (esc)
+  p2copies: 
+  $ hg showcopies --config experimental.copies.read-from=filelog-only
+  a -> j
 The entries should be written to extras even if they're empty (so the client
 won't have to fall back to reading from filelogs)
   $ echo x >> j