diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py index 19ecd39223dcd0383be39f4d240d25db48e147e0_bWVyY3VyaWFsL2NtZHV0aWwucHk=..3649c3f2cd90c8aec395ca8af5adae33defff12c_bWVyY3VyaWFsL2NtZHV0aWwucHk= 100644 --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -3790,9 +3790,8 @@ operation = 'discard' reversehunks = True if node != parent: - operation = 'revert' - reversehunks = repo.ui.configbool('experimental', - 'revertalternateinteractivemode') + operation = 'apply' + reversehunks = False if reversehunks: diff = patch.diff(repo, ctx.node(), None, m, opts=diffopts) else: diff --git a/mercurial/configitems.py b/mercurial/configitems.py index 19ecd39223dcd0383be39f4d240d25db48e147e0_bWVyY3VyaWFsL2NvbmZpZ2l0ZW1zLnB5..3649c3f2cd90c8aec395ca8af5adae33defff12c_bWVyY3VyaWFsL2NvbmZpZ2l0ZW1zLnB5 100644 --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -439,9 +439,6 @@ coreconfigitem('experimental', 'rebase.multidest', default=False, ) -coreconfigitem('experimental', 'revertalternateinteractivemode', - default=True, -) coreconfigitem('experimental', 'revlogv2', default=None, ) diff --git a/mercurial/patch.py b/mercurial/patch.py index 19ecd39223dcd0383be39f4d240d25db48e147e0_bWVyY3VyaWFsL3BhdGNoLnB5..3649c3f2cd90c8aec395ca8af5adae33defff12c_bWVyY3VyaWFsL3BhdGNoLnB5 100644 --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -997,5 +997,6 @@ def getmessages(): return { 'multiple': { + 'apply': _("apply change %d/%d to '%s'?"), 'discard': _("discard change %d/%d to '%s'?"), 'record': _("record change %d/%d to '%s'?"), @@ -1000,5 +1001,4 @@ 'discard': _("discard change %d/%d to '%s'?"), 'record': _("record change %d/%d to '%s'?"), - 'revert': _("revert change %d/%d to '%s'?"), }, 'single': { @@ -1003,4 +1003,5 @@ }, 'single': { + 'apply': _("apply this change to '%s'?"), 'discard': _("discard this change to '%s'?"), 'record': _("record this change to '%s'?"), @@ -1005,5 +1006,4 @@ 'discard': _("discard this change to '%s'?"), 'record': _("record this change to '%s'?"), - 'revert': _("revert this change to '%s'?"), }, 'help': { @@ -1008,5 +1008,15 @@ }, 'help': { + 'apply': _('[Ynesfdaq?]' + '$$ &Yes, apply this change' + '$$ &No, skip this change' + '$$ &Edit this change manually' + '$$ &Skip remaining changes to this file' + '$$ Apply remaining changes to this &file' + '$$ &Done, skip remaining changes and files' + '$$ Apply &all changes to all remaining files' + '$$ &Quit, applying no changes' + '$$ &? (display help)'), 'discard': _('[Ynesfdaq?]' '$$ &Yes, discard this change' '$$ &No, skip this change' @@ -1027,16 +1037,6 @@ '$$ Record &all changes to all remaining files' '$$ &Quit, recording no changes' '$$ &? (display help)'), - 'revert': _('[Ynesfdaq?]' - '$$ &Yes, revert this change' - '$$ &No, skip this change' - '$$ &Edit this change manually' - '$$ &Skip remaining changes to this file' - '$$ Revert remaining changes to this &file' - '$$ &Done, skip remaining changes and files' - '$$ Revert &all changes to all remaining files' - '$$ &Quit, reverting no changes' - '$$ &? (display help)') } } diff --git a/tests/test-revert-interactive.t b/tests/test-revert-interactive.t index 19ecd39223dcd0383be39f4d240d25db48e147e0_dGVzdHMvdGVzdC1yZXZlcnQtaW50ZXJhY3RpdmUudA==..3649c3f2cd90c8aec395ca8af5adae33defff12c_dGVzdHMvdGVzdC1yZXZlcnQtaW50ZXJhY3RpdmUudA== 100644 --- a/tests/test-revert-interactive.t +++ b/tests/test-revert-interactive.t @@ -60,10 +60,10 @@ 2 hunks, 2 lines changed examine changes to 'f'? [Ynesfdaq?] y - @@ -1,5 +1,6 @@ - +a + @@ -1,6 +1,5 @@ + -a 1 2 3 4 5 @@ -65,7 +65,7 @@ 1 2 3 4 5 - revert change 1/6 to 'f'? [Ynesfdaq?] y + apply change 1/6 to 'f'? [Ynesfdaq?] y @@ -71,7 +71,7 @@ - @@ -1,5 +2,6 @@ + @@ -2,6 +1,5 @@ 1 2 3 4 5 @@ -73,12 +73,12 @@ 1 2 3 4 5 - +b - revert change 2/6 to 'f'? [Ynesfdaq?] y + -b + apply change 2/6 to 'f'? [Ynesfdaq?] y diff --git a/folder1/g b/folder1/g 2 hunks, 2 lines changed examine changes to 'folder1/g'? [Ynesfdaq?] y @@ -80,12 +80,12 @@ diff --git a/folder1/g b/folder1/g 2 hunks, 2 lines changed examine changes to 'folder1/g'? [Ynesfdaq?] y - @@ -1,5 +1,6 @@ - +c + @@ -1,6 +1,5 @@ + -c 1 2 3 4 5 @@ -87,7 +87,7 @@ 1 2 3 4 5 - revert change 3/6 to 'folder1/g'? [Ynesfdaq?] ? + apply change 3/6 to 'folder1/g'? [Ynesfdaq?] ? @@ -93,5 +93,5 @@ - y - yes, revert this change + y - yes, apply this change n - no, skip this change e - edit this change manually s - skip remaining changes to this file @@ -95,5 +95,5 @@ n - no, skip this change e - edit this change manually s - skip remaining changes to this file - f - revert remaining changes to this file + f - apply remaining changes to this file d - done, skip remaining changes and files @@ -99,4 +99,4 @@ d - done, skip remaining changes and files - a - revert all changes to all remaining files - q - quit, reverting no changes + a - apply all changes to all remaining files + q - quit, applying no changes ? - ? (display help) @@ -102,3 +102,3 @@ ? - ? (display help) - revert change 3/6 to 'folder1/g'? [Ynesfdaq?] y + apply change 3/6 to 'folder1/g'? [Ynesfdaq?] y @@ -104,7 +104,7 @@ - @@ -1,5 +2,6 @@ + @@ -2,6 +1,5 @@ 1 2 3 4 5 @@ -106,10 +106,10 @@ 1 2 3 4 5 - +d - revert change 4/6 to 'folder1/g'? [Ynesfdaq?] n + -d + apply change 4/6 to 'folder1/g'? [Ynesfdaq?] n diff --git a/folder2/h b/folder2/h 2 hunks, 2 lines changed @@ -157,7 +157,7 @@ 1 hunks, 1 lines changed examine changes to 'folder1/g'? [Ynesfdaq?] y - @@ -3,3 +3,4 @@ + @@ -3,4 +3,3 @@ 3 4 5 @@ -161,8 +161,8 @@ 3 4 5 - +d - revert this change to 'folder1/g'? [Ynesfdaq?] n + -d + apply this change to 'folder1/g'? [Ynesfdaq?] n $ ls folder1/ g @@ -173,7 +173,7 @@ 1 hunks, 1 lines changed examine changes to 'folder1/g'? [Ynesfdaq?] y - @@ -3,3 +3,4 @@ + @@ -3,4 +3,3 @@ 3 4 5 @@ -177,8 +177,8 @@ 3 4 5 - +d - revert this change to 'folder1/g'? [Ynesfdaq?] y + -d + apply this change to 'folder1/g'? [Ynesfdaq?] y $ ls folder1/ g @@ -206,10 +206,10 @@ 2 hunks, 2 lines changed examine changes to 'f'? [Ynesfdaq?] y - @@ -1,5 +1,6 @@ - +a + @@ -1,6 +1,5 @@ + -a 1 2 3 4 5 @@ -211,7 +211,7 @@ 1 2 3 4 5 - revert change 1/6 to 'f'? [Ynesfdaq?] y + apply change 1/6 to 'f'? [Ynesfdaq?] y @@ -217,7 +217,7 @@ - @@ -1,5 +2,6 @@ + @@ -2,6 +1,5 @@ 1 2 3 4 5 @@ -219,12 +219,12 @@ 1 2 3 4 5 - +b - revert change 2/6 to 'f'? [Ynesfdaq?] y + -b + apply change 2/6 to 'f'? [Ynesfdaq?] y diff --git a/folder1/g b/folder1/g 2 hunks, 2 lines changed examine changes to 'folder1/g'? [Ynesfdaq?] y @@ -226,12 +226,12 @@ diff --git a/folder1/g b/folder1/g 2 hunks, 2 lines changed examine changes to 'folder1/g'? [Ynesfdaq?] y - @@ -1,5 +1,6 @@ - +c + @@ -1,6 +1,5 @@ + -c 1 2 3 4 5 @@ -233,7 +233,7 @@ 1 2 3 4 5 - revert change 3/6 to 'folder1/g'? [Ynesfdaq?] y + apply change 3/6 to 'folder1/g'? [Ynesfdaq?] y @@ -239,7 +239,7 @@ - @@ -1,5 +2,6 @@ + @@ -2,6 +1,5 @@ 1 2 3 4 5 @@ -241,10 +241,10 @@ 1 2 3 4 5 - +d - revert change 4/6 to 'folder1/g'? [Ynesfdaq?] n + -d + apply change 4/6 to 'folder1/g'? [Ynesfdaq?] n diff --git a/folder2/h b/folder2/h 2 hunks, 2 lines changed @@ -368,77 +368,6 @@ $ cat k 42 -Check the experimental config to invert the selection: - $ cat <<EOF >> $HGRCPATH - > [experimental] - > revertalternateinteractivemode=False - > 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 a3d963a027aa 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 - discard change 1/3 to 'folder1/g'? [Ynesfdaq?] y - - @@ -1,7 +2,7 @@ - c - 1 - 2 - 3 - -4 - + 3 - 5 - d - discard change 2/3 to 'folder1/g'? [Ynesfdaq?] y - - @@ -6,2 +7,3 @@ - 5 - d - +lastline - discard change 3/3 to 'folder1/g'? [Ynesfdaq?] n - - $ hg diff --nodates - diff -r a3d963a027aa folder1/g - --- a/folder1/g - +++ b/folder1/g - @@ -5,3 +5,4 @@ - 4 - 5 - d - +lastline - $ hg update -C . 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg purge @@ -463,11 +392,6 @@ When a line without EOL is selected during "revert -i" (issue5651) - $ cat <<EOF >> $HGRCPATH - > [experimental] - > %unset revertalternateinteractivemode - > EOF - $ hg init $TESTTMP/revert-i-eol $ cd $TESTTMP/revert-i-eol $ echo 0 > a @@ -487,5 +411,5 @@ 1 hunks, 1 lines changed examine changes to 'a'? [Ynesfdaq?] y - @@ -1,1 +1,2 @@ + @@ -1,2 +1,1 @@ 0 @@ -491,3 +415,3 @@ 0 - +1 + -1 \ No newline at end of file @@ -493,5 +417,5 @@ \ No newline at end of file - revert this change to 'a'? [Ynesfdaq?] y + apply this change to 'a'? [Ynesfdaq?] y $ cat a 0