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