D6749: tests: demonstrate crash when committing subset of copies to changeset

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Aug 20 16:29:19 UTC 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  When writing copy metadata to the changeset and not committing all
  copies in the dirstate, we get a ProgrammingError. This commit adds
  two tests showing how to trigger this bug.

REPOSITORY
  rHG Mercurial

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

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

CHANGE DETAILS

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
@@ -10,6 +10,7 @@
   > showcopies = log -r . -T '{file_copies % "{source} -> {name}\n"}'
   > [extensions]
   > rebase =
+  > split =
   > EOF
 
 Check that copies are recorded correctly
@@ -185,3 +186,33 @@
     a
   R a
   $ cd ..
+
+Test splitting a commit
+
+  $ hg init split
+  $ cd split
+  $ echo a > a
+  $ echo b > b
+  $ hg ci -Aqm 'add a and b'
+  $ echo a2 > a
+  $ hg mv b c
+  $ hg ci -m 'modify a, move b to c'
+  $ (hg --config ui.interactive=yes split 2>&1 | grep mercurial.error) <<EOF
+  > y
+  > y
+  > n
+  > y
+  > EOF
+  mercurial.error.ProgrammingError: some copy targets missing from file list
+  $ cd ..
+
+Test committing half a rename
+
+  $ hg init partial
+  $ cd partial
+  $ echo a > a
+  $ hg ci -Aqm 'add a'
+  $ hg mv a b
+  $ hg ci -m 'remove a' a 2>&1 | grep mercurial.error
+  mercurial.error.ProgrammingError: some copy targets missing from file list
+  $ cd ..



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


More information about the Mercurial-devel mailing list