# HG changeset patch # User Pierre-Yves David # Date 2015-04-11 16:26:54 # Node ID a85c4ed1132f5d7c415635ab367f0d146dae3c02 # Parent 52ff737c63d2b2cb41185549aa9c35bc47317032 revert: do not requires '--all' if '--interative' is present The '--all' option have been introduced in 890e285c52a1 (August 2006), most probably to prevent user shooting themselves in the foot. As the record process will let you, view and select the set of files and change you want to revert, I feel like the '--all' flag is superfluous in the '--interactive' case. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -5514,7 +5514,7 @@ def revert(ui, repo, *pats, **opts): ctx = scmutil.revsingle(repo, opts.get('rev')) - if not pats and not opts.get('all'): + if not pats and not (opts.get('all') or opts.get('interactive')): msg = _("no files or directories specified") if p2 != nullid: hint = _("uncommitted merge, use --all to discard all changes," 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 @@ -121,6 +121,21 @@ 10 run the same test than 8 from within 4 5 f + +Test that --interactive lift the need for --all + + $ echo q | hg revert -i -r 2 + reverting folder1/g (glob) + reverting folder2/h (glob) + diff -r 89ac3d72e4a4 folder1/g + 1 hunks, 1 lines changed + examine changes to 'folder1/g'? [Ynesfdaq?] q + + abort: user quit + [255] + $ rm folder1/g.orig + + $ hg update -C 6 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg revert -i -r 2 --all -- << EOF