Mercurial > public > mercurial-scm > hg
diff tests/test-revert-interactive.t @ 25424:69609f43c752
revert: add an experimental config to use inverted selection
We had a discussion on the list about the interactive ui for revert. This patch
adds a flag to allow people to test the second alternative (referred to as
proposition 2 on the mailing list). It effectively inverts the signs in the
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Fri, 29 May 2015 13:11:52 -0700 |
parents | 48b1d8944406 |
children | 88d244f4edfd |
line wrap: on
line diff
--- a/tests/test-revert-interactive.t Wed May 20 11:44:06 2015 -0500 +++ b/tests/test-revert-interactive.t Fri May 29 13:11:52 2015 -0700 @@ -320,3 +320,74 @@ 4 5 b + +Check the experimental config to invert the selection: + $ cat <<EOF >> $HGRCPATH + > [experimental] + > revertalternateinteractivemode=True + > EOF + + + $ hg up -C . + 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 + --- a/folder1/g + +++ b/folder1/g + @@ -1,7 +1,9 @@ + +firstline + c + 1 + 2 + 3 + -4 + + 3 + 5 + d + +lastline + $ hg revert -i <<EOF + > y + > y + > y + > n + > EOF + reverting folder1/g (glob) + diff --git a/folder1/g b/folder1/g + 3 hunks, 3 lines changed + examine changes to 'folder1/g'? [Ynesfdaq?] y + + @@ -1,4 +1,5 @@ + +firstline + c + 1 + 2 + 3 + record change 1/3 to 'folder1/g'? [Ynesfdaq?] y + + @@ -1,7 +2,7 @@ + c + 1 + 2 + 3 + -4 + + 3 + 5 + d + record change 2/3 to 'folder1/g'? [Ynesfdaq?] y + + @@ -6,2 +7,3 @@ + 5 + d + +lastline + record change 3/3 to 'folder1/g'? [Ynesfdaq?] n + + $ hg diff --nodates + diff -r 5a858e056dc0 folder1/g + --- a/folder1/g + +++ b/folder1/g + @@ -5,3 +5,4 @@ + 4 + 5 + d + +lastline