# HG changeset patch # User Laurent Charignon # Date 2015-06-23 20:46:58 # Node ID 88d244f4edfd58105ee33fea1562bf178f9c5817 # Parent b8b73652c1c97600e7cabea1f628561e00ecd127 revert: change a test to make the change of direction of revert -i easier Currently we are handling editing of newly-added files with the interactive interface. We are not handling editing of deleted files. In the test for revert, we were editing a newly-added file. Since we want to change the direction of revert -i, this editing of a newly-added file will become editing of a deleted file. Since we don't support that, this patch changes the test to make the rest of the series cleaner. diff --git a/tests/test-revert-interactive.t b/tests/test-revert-interactive.t --- a/tests/test-revert-interactive.t +++ b/tests/test-revert-interactive.t @@ -282,44 +282,30 @@ 1) Create a dummy editor changing 1 to 4 > mv tt "$1" > __EOF__ -2) Remove f - $ hg rm f - $ hg commit -m "remove f" +2) Add k + $ printf "1\n" > k + $ hg add k + $ hg commit -m "add k" -3) Do another commit on top - $ touch k; hg add k - $ hg commit -m "add k" - $ hg st - -4) Use interactive revert to recover f and change it on the fly - $ HGEDITOR="\"sh\" \"${TESTTMP}/editor.sh\"" hg revert -i -r ".^^" < k + $ HGEDITOR="\"sh\" \"${TESTTMP}/editor.sh\"" hg revert -i < y > e > EOF - adding f - removing k - diff --git a/f b/f - new file mode 100644 - examine changes to 'f'? [Ynesfdaq?] y + reverting k + diff --git a/k b/k + 1 hunks, 2 lines changed + examine changes to 'k'? [Ynesfdaq?] y - @@ -0,0 +1,7 @@ - +a + @@ -1,2 +1,1 @@ + -0 + -2 +1 - +2 - +3 - +4 - +5 - +b - record this change to 'f'? [Ynesfdaq?] e + record this change to 'k'? [Ynesfdaq?] e - $ cat f - a + $ cat k 42 - 2 - 3 - 4 - 5 - b Check the experimental config to invert the selection: $ cat <> $HGRCPATH @@ -332,7 +318,7 @@ Check the experimental config to invert 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ printf 'firstline\nc\n1\n2\n3\n 3\n5\nd\nlastline\n' > folder1/g $ hg diff --nodates - diff -r 5a858e056dc0 folder1/g + diff -r a3d963a027aa folder1/g --- a/folder1/g +++ b/folder1/g @@ -1,7 +1,9 @@ @@ -383,7 +369,7 @@ Check the experimental config to invert record change 3/3 to 'folder1/g'? [Ynesfdaq?] n $ hg diff --nodates - diff -r 5a858e056dc0 folder1/g + diff -r a3d963a027aa folder1/g --- a/folder1/g +++ b/folder1/g @@ -5,3 +5,4 @@