<div dir="ltr">Queued, thanks!</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 3, 2017 at 9:34 AM, Denis Laxalde <span dir="ltr"><<a href="mailto:denis@laxalde.org" target="_blank">denis@laxalde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Denis Laxalde <<a href="mailto:denis.laxalde@logilab.fr">denis.laxalde@logilab.fr</a>><br>
# Date 1509716857 -3600<br>
# Fri Nov 03 14:47:37 2017 +0100<br>
# Node ID 095ef7f12cb36330d5e2b35b6c93fe<wbr>27f6c1aacc<br>
# Parent 7ebf850d3166a64ff33b4b85adb481<wbr>b533ddbf86<br>
# Available At <a href="http://hg.logilab.org/users/dlaxalde/hg" rel="noreferrer" target="_blank">http://hg.logilab.org/users/<wbr>dlaxalde/hg</a><br>
# hg pull <a href="http://hg.logilab.org/users/dlaxalde/hg" rel="noreferrer" target="_blank">http://hg.logilab.org/users/<wbr>dlaxalde/hg</a> -r 095ef7f12cb3<br>
# EXP-Topic revert-interactive<br>
revert: do not reverse hunks in interactive when REV is not parent (issue5096)<br>
<br>
And introduce a new "apply" operation verb for this case as suggested in<br>
issue5096. This replaces the no longer used "revert" operation.<br>
<br>
In interactive revert, when reverting to something else that the parent<br>
revision, display an "apply this change" message with a diff that is not<br>
reversed.<br>
<br>
The rationale is that `hg revert -i -r REV` will show hunks of the diff from<br>
the working directory to REV and prompt the user to select them for applying<br>
(to working directory). This contradicts dcc56e10c23b in which it was<br>
decided to have the "direction" of prompted hunks reversed. Later on<br>
[1], there was a broad consensus (but no decision) towards the "as to<br>
be applied direction". Now that --interactive is no longer experimental<br>
(5910db5d1913), it's time to switch and thus we drop no longer used<br>
"experimental.<wbr>revertalternateinteractivemode<wbr>" configuration option.<br>
<br>
[1]: <a href="https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-November/090142.html" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/<wbr>pipermail/mercurial-devel/<wbr>2016-November/090142.html</a><br>
<br>
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py<br>
--- a/mercurial/cmdutil.py<br>
+++ b/mercurial/cmdutil.py<br>
@@ -3790,9 +3790,8 @@ def _performrevert(repo, parents, ctx, a<br>
operation = 'discard'<br>
reversehunks = True<br>
if node != parent:<br>
- operation = 'revert'<br>
- reversehunks = repo.ui.configbool('<wbr>experimental',<br>
- '<wbr>revertalternateinteractivemode<wbr>')<br>
+ operation = 'apply'<br>
+ reversehunks = False<br>
if reversehunks:<br>
diff = patch.diff(repo, ctx.node(), None, m, opts=diffopts)<br>
else:<br>
diff --git a/mercurial/configitems.py b/mercurial/configitems.py<br>
--- a/mercurial/configitems.py<br>
+++ b/mercurial/configitems.py<br>
@@ -439,9 +439,6 @@ coreconfigitem('experimental', 'obsmarke<br>
coreconfigitem('experimental', 'rebase.multidest',<br>
default=False,<br>
)<br>
-coreconfigitem('experimental'<wbr>, '<wbr>revertalternateinteractivemode<wbr>',<br>
- default=True,<br>
-)<br>
coreconfigitem('experimental', 'revlogv2',<br>
default=None,<br>
)<br>
diff --git a/mercurial/patch.py b/mercurial/patch.py<br>
--- a/mercurial/patch.py<br>
+++ b/mercurial/patch.py<br>
@@ -997,16 +997,26 @@ class recordhunk(object):<br>
def getmessages():<br>
return {<br>
'multiple': {<br>
+ 'apply': _("apply change %d/%d to '%s'?"),<br>
'discard': _("discard change %d/%d to '%s'?"),<br>
'record': _("record change %d/%d to '%s'?"),<br>
- 'revert': _("revert change %d/%d to '%s'?"),<br>
},<br>
'single': {<br>
+ 'apply': _("apply this change to '%s'?"),<br>
'discard': _("discard this change to '%s'?"),<br>
'record': _("record this change to '%s'?"),<br>
- 'revert': _("revert this change to '%s'?"),<br>
},<br>
'help': {<br>
+ 'apply': _('[Ynesfdaq?]'<br>
+ '$$ &Yes, apply this change'<br>
+ '$$ &No, skip this change'<br>
+ '$$ &Edit this change manually'<br>
+ '$$ &Skip remaining changes to this file'<br>
+ '$$ Apply remaining changes to this &file'<br>
+ '$$ &Done, skip remaining changes and files'<br>
+ '$$ Apply &all changes to all remaining files'<br>
+ '$$ &Quit, applying no changes'<br>
+ '$$ &? (display help)'),<br>
'discard': _('[Ynesfdaq?]'<br>
'$$ &Yes, discard this change'<br>
'$$ &No, skip this change'<br>
@@ -1027,16 +1037,6 @@ def getmessages():<br>
'$$ Record &all changes to all remaining files'<br>
'$$ &Quit, recording no changes'<br>
'$$ &? (display help)'),<br>
- 'revert': _('[Ynesfdaq?]'<br>
- '$$ &Yes, revert this change'<br>
- '$$ &No, skip this change'<br>
- '$$ &Edit this change manually'<br>
- '$$ &Skip remaining changes to this file'<br>
- '$$ Revert remaining changes to this &file'<br>
- '$$ &Done, skip remaining changes and files'<br>
- '$$ Revert &all changes to all remaining files'<br>
- '$$ &Quit, reverting no changes'<br>
- '$$ &? (display help)')<br>
}<br>
}<br>
<br>
diff --git a/tests/test-revert-<wbr>interactive.t b/tests/test-revert-<wbr>interactive.t<br>
--- a/tests/test-revert-<wbr>interactive.t<br>
+++ b/tests/test-revert-<wbr>interactive.t<br>
@@ -60,56 +60,56 @@ 10 run the same test than 8 from within<br>
2 hunks, 2 lines changed<br>
examine changes to 'f'? [Ynesfdaq?] y<br>
<br>
- @@ -1,5 +1,6 @@<br>
- +a<br>
+ @@ -1,6 +1,5 @@<br>
+ -a<br>
1<br>
2<br>
3<br>
4<br>
5<br>
- revert change 1/6 to 'f'? [Ynesfdaq?] y<br>
+ apply change 1/6 to 'f'? [Ynesfdaq?] y<br>
<br>
- @@ -1,5 +2,6 @@<br>
+ @@ -2,6 +1,5 @@<br>
1<br>
2<br>
3<br>
4<br>
5<br>
- +b<br>
- revert change 2/6 to 'f'? [Ynesfdaq?] y<br>
+ -b<br>
+ apply change 2/6 to 'f'? [Ynesfdaq?] y<br>
<br>
diff --git a/folder1/g b/folder1/g<br>
2 hunks, 2 lines changed<br>
examine changes to 'folder1/g'? [Ynesfdaq?] y<br>
<br>
- @@ -1,5 +1,6 @@<br>
- +c<br>
+ @@ -1,6 +1,5 @@<br>
+ -c<br>
1<br>
2<br>
3<br>
4<br>
5<br>
- revert change 3/6 to 'folder1/g'? [Ynesfdaq?] ?<br>
+ apply change 3/6 to 'folder1/g'? [Ynesfdaq?] ?<br>
<br>
- y - yes, revert this change<br>
+ y - yes, apply this change<br>
n - no, skip this change<br>
e - edit this change manually<br>
s - skip remaining changes to this file<br>
- f - revert remaining changes to this file<br>
+ f - apply remaining changes to this file<br>
d - done, skip remaining changes and files<br>
- a - revert all changes to all remaining files<br>
- q - quit, reverting no changes<br>
+ a - apply all changes to all remaining files<br>
+ q - quit, applying no changes<br>
? - ? (display help)<br>
- revert change 3/6 to 'folder1/g'? [Ynesfdaq?] y<br>
+ apply change 3/6 to 'folder1/g'? [Ynesfdaq?] y<br>
<br>
- @@ -1,5 +2,6 @@<br>
+ @@ -2,6 +1,5 @@<br>
1<br>
2<br>
3<br>
4<br>
5<br>
- +d<br>
- revert change 4/6 to 'folder1/g'? [Ynesfdaq?] n<br>
+ -d<br>
+ apply change 4/6 to 'folder1/g'? [Ynesfdaq?] n<br>
<br>
diff --git a/folder2/h b/folder2/h<br>
2 hunks, 2 lines changed<br>
@@ -157,12 +157,12 @@ Test that a noop revert doesn't do an un<br>
1 hunks, 1 lines changed<br>
examine changes to 'folder1/g'? [Ynesfdaq?] y<br>
<br>
- @@ -3,3 +3,4 @@<br>
+ @@ -3,4 +3,3 @@<br>
3<br>
4<br>
5<br>
- +d<br>
- revert this change to 'folder1/g'? [Ynesfdaq?] n<br>
+ -d<br>
+ apply this change to 'folder1/g'? [Ynesfdaq?] n<br>
<br>
$ ls folder1/<br>
g<br>
@@ -173,12 +173,12 @@ Test --no-backup<br>
1 hunks, 1 lines changed<br>
examine changes to 'folder1/g'? [Ynesfdaq?] y<br>
<br>
- @@ -3,3 +3,4 @@<br>
+ @@ -3,4 +3,3 @@<br>
3<br>
4<br>
5<br>
- +d<br>
- revert this change to 'folder1/g'? [Ynesfdaq?] y<br>
+ -d<br>
+ apply this change to 'folder1/g'? [Ynesfdaq?] y<br>
<br>
$ ls folder1/<br>
g<br>
@@ -206,45 +206,45 @@ Test --no-backup<br>
2 hunks, 2 lines changed<br>
examine changes to 'f'? [Ynesfdaq?] y<br>
<br>
- @@ -1,5 +1,6 @@<br>
- +a<br>
+ @@ -1,6 +1,5 @@<br>
+ -a<br>
1<br>
2<br>
3<br>
4<br>
5<br>
- revert change 1/6 to 'f'? [Ynesfdaq?] y<br>
+ apply change 1/6 to 'f'? [Ynesfdaq?] y<br>
<br>
- @@ -1,5 +2,6 @@<br>
+ @@ -2,6 +1,5 @@<br>
1<br>
2<br>
3<br>
4<br>
5<br>
- +b<br>
- revert change 2/6 to 'f'? [Ynesfdaq?] y<br>
+ -b<br>
+ apply change 2/6 to 'f'? [Ynesfdaq?] y<br>
<br>
diff --git a/folder1/g b/folder1/g<br>
2 hunks, 2 lines changed<br>
examine changes to 'folder1/g'? [Ynesfdaq?] y<br>
<br>
- @@ -1,5 +1,6 @@<br>
- +c<br>
+ @@ -1,6 +1,5 @@<br>
+ -c<br>
1<br>
2<br>
3<br>
4<br>
5<br>
- revert change 3/6 to 'folder1/g'? [Ynesfdaq?] y<br>
+ apply change 3/6 to 'folder1/g'? [Ynesfdaq?] y<br>
<br>
- @@ -1,5 +2,6 @@<br>
+ @@ -2,6 +1,5 @@<br>
1<br>
2<br>
3<br>
4<br>
5<br>
- +d<br>
- revert change 4/6 to 'folder1/g'? [Ynesfdaq?] n<br>
+ -d<br>
+ apply change 4/6 to 'folder1/g'? [Ynesfdaq?] n<br>
<br>
diff --git a/folder2/h b/folder2/h<br>
2 hunks, 2 lines changed<br>
@@ -368,77 +368,6 @@ 3) Use interactive revert with editing (<br>
$ cat k<br>
42<br>
<br>
-Check the experimental config to invert the selection:<br>
- $ cat <<EOF >> $HGRCPATH<br>
- > [experimental]<br>
- > revertalternateinteractivemode<wbr>=False<br>
- > EOF<br>
-<br>
-<br>
- $ hg up -C .<br>
- 1 files updated, 0 files merged, 0 files removed, 0 files unresolved<br>
- $ printf 'firstline\nc\n1\n2\n3\n 3\n5\nd\nlastline\n' > folder1/g<br>
- $ hg diff --nodates<br>
- diff -r a3d963a027aa folder1/g<br>
- --- a/folder1/g<br>
- +++ b/folder1/g<br>
- @@ -1,7 +1,9 @@<br>
- +firstline<br>
- c<br>
- 1<br>
- 2<br>
- 3<br>
- -4<br>
- + 3<br>
- 5<br>
- d<br>
- +lastline<br>
- $ hg revert -i <<EOF<br>
- > y<br>
- > y<br>
- > y<br>
- > n<br>
- > EOF<br>
- reverting folder1/g (glob)<br>
- diff --git a/folder1/g b/folder1/g<br>
- 3 hunks, 3 lines changed<br>
- examine changes to 'folder1/g'? [Ynesfdaq?] y<br>
-<br>
- @@ -1,4 +1,5 @@<br>
- +firstline<br>
- c<br>
- 1<br>
- 2<br>
- 3<br>
- discard change 1/3 to 'folder1/g'? [Ynesfdaq?] y<br>
-<br>
- @@ -1,7 +2,7 @@<br>
- c<br>
- 1<br>
- 2<br>
- 3<br>
- -4<br>
- + 3<br>
- 5<br>
- d<br>
- discard change 2/3 to 'folder1/g'? [Ynesfdaq?] y<br>
-<br>
- @@ -6,2 +7,3 @@<br>
- 5<br>
- d<br>
- +lastline<br>
- discard change 3/3 to 'folder1/g'? [Ynesfdaq?] n<br>
-<br>
- $ hg diff --nodates<br>
- diff -r a3d963a027aa folder1/g<br>
- --- a/folder1/g<br>
- +++ b/folder1/g<br>
- @@ -5,3 +5,4 @@<br>
- 4<br>
- 5<br>
- d<br>
- +lastline<br>
-<br>
$ hg update -C .<br>
1 files updated, 0 files merged, 0 files removed, 0 files unresolved<br>
$ hg purge<br>
@@ -463,11 +392,6 @@ Check the experimental config to invert<br>
<br>
When a line without EOL is selected during "revert -i" (issue5651)<br>
<br>
- $ cat <<EOF >> $HGRCPATH<br>
- > [experimental]<br>
- > %unset revertalternateinteractivemode<br>
- > EOF<br>
-<br>
$ hg init $TESTTMP/revert-i-eol<br>
$ cd $TESTTMP/revert-i-eol<br>
$ echo 0 > a<br>
@@ -487,11 +411,11 @@ When a line without EOL is selected duri<br>
1 hunks, 1 lines changed<br>
examine changes to 'a'? [Ynesfdaq?] y<br>
<br>
- @@ -1,1 +1,2 @@<br>
+ @@ -1,2 +1,1 @@<br>
0<br>
- +1<br>
+ -1<br>
\ No newline at end of file<br>
- revert this change to 'a'? [Ynesfdaq?] y<br>
+ apply this change to 'a'? [Ynesfdaq?] y<br>
<br>
$ cat a<br>
0<br>
</blockquote></div><br></div>