Mercurial > public > mercurial-scm > hg-stable
diff tests/test-copies-in-changeset.t @ 42865:2b869a515ba6
context: filter out invalid copies from workingctx.p[12]copies()
workingctx normally gets its lists of modified, added, removed files
etc. based on the dirstate status. Its constructor also accepts a
"changes" argument to override the status from the dirstate. This is
used for partial commits. If a "changed" argument was passed, we
should clearly also filter out copies to those paths, which I had
previously missed. This patch adds that filtering and fixes the bugs
demonstrated in the previous patch.
Differential Revision: https://phab.mercurial-scm.org/D6750
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 19 Aug 2019 15:43:27 -0700 |
parents | 170b070ec6a5 |
children | 6f0273558c4b |
line wrap: on
line diff
--- a/tests/test-copies-in-changeset.t Mon Aug 19 12:30:02 2019 -0700 +++ b/tests/test-copies-in-changeset.t Mon Aug 19 15:43:27 2019 -0700 @@ -197,13 +197,37 @@ $ 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 + $ hg --config ui.interactive=yes split <<EOF > y > y > n > y > EOF - mercurial.error.ProgrammingError: some copy targets missing from file list + diff --git a/a b/a + 1 hunks, 1 lines changed + examine changes to 'a'? + (enter ? for help) [Ynesfdaq?] y + + @@ -1,1 +1,1 @@ + -a + +a2 + record this change to 'a'? + (enter ? for help) [Ynesfdaq?] y + + diff --git a/b b/c + rename from b + rename to c + examine changes to 'b' and 'c'? + (enter ? for help) [Ynesfdaq?] n + + created new head + diff --git a/b b/c + rename from b + rename to c + examine changes to 'b' and 'c'? + (enter ? for help) [Ynesfdaq?] y + + saved backup bundle to $TESTTMP/split/.hg/strip-backup/9a396d463e04-2d9e6864-split.hg $ cd .. Test committing half a rename @@ -213,6 +237,5 @@ $ 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 + $ hg ci -m 'remove a' a $ cd ..