Commit d1e8d4a5 authored by Pierre-Yves David's avatar Pierre-Yves David

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.
parent 52ff737c63d2
......@@ -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,"
......@@ -121,6 +121,21 @@ Revert interactive tests
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
$ 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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment