# HG changeset patch # User Martin von Zweigbergk # Date 1566243002 25200 # Node ID 170b070ec6a58a70ea947e013903c3efb4ea5d77 # Parent 3316e59b0105c4056c9e78fad1d074a9fd02a318 tests: demonstrate crash when committing subset of copies to changeset 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. Differential Revision: https://phab.mercurial-scm.org/D6749 diff -r 3316e59b0105 -r 170b070ec6a5 tests/test-copies-in-changeset.t --- a/tests/test-copies-in-changeset.t Thu Aug 22 20:36:13 2019 +0300 +++ b/tests/test-copies-in-changeset.t Mon Aug 19 12:30:02 2019 -0700 @@ -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) < 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 ..