Show More
@@ -3105,14 +3105,15 b' def revert(ui, repo, *pats, **opts):' | |||||
3105 | raise util.Abort(_("you can't specify a revision and a date")) |
|
3105 | raise util.Abort(_("you can't specify a revision and a date")) | |
3106 | opts["rev"] = cmdutil.finddate(ui, repo, opts["date"]) |
|
3106 | opts["rev"] = cmdutil.finddate(ui, repo, opts["date"]) | |
3107 |
|
3107 | |||
|
3108 | parent, p2 = repo.dirstate.parents() | |||
|
3109 | if not opts.get('rev') and p2 != nullid: | |||
|
3110 | raise util.Abort(_('uncommitted merge - ' | |||
|
3111 | 'use "hg update", see "hg help revert"')) | |||
|
3112 | ||||
3108 | if not pats and not opts.get('all'): |
|
3113 | if not pats and not opts.get('all'): | |
3109 | raise util.Abort(_('no files or directories specified; ' |
|
3114 | raise util.Abort(_('no files or directories specified; ' | |
3110 | 'use --all to revert the whole repo')) |
|
3115 | 'use --all to revert the whole repo')) | |
3111 |
|
3116 | |||
3112 | parent, p2 = repo.dirstate.parents() |
|
|||
3113 | if not opts.get('rev') and p2 != nullid: |
|
|||
3114 | raise util.Abort(_('uncommitted merge - please provide a ' |
|
|||
3115 | 'specific revision')) |
|
|||
3116 | ctx = cmdutil.revsingle(repo, opts.get('rev')) |
|
3117 | ctx = cmdutil.revsingle(repo, opts.get('rev')) | |
3117 | node = ctx.node() |
|
3118 | node = ctx.node() | |
3118 | mf = ctx.manifest() |
|
3119 | mf = ctx.manifest() |
@@ -58,8 +58,8 b' Should show a removed and b added:' | |||||
58 |
|
58 | |||
59 | Revert should fail: |
|
59 | Revert should fail: | |
60 |
|
60 | |||
61 |
$ hg revert |
|
61 | $ hg revert | |
62 |
abort: uncommitted merge - |
|
62 | abort: uncommitted merge - use "hg update", see "hg help revert" | |
63 | [255] |
|
63 | [255] | |
64 |
|
64 | |||
65 | Revert should be ok now: |
|
65 | Revert should be ok now: |
General Comments 0
You need to be logged in to leave comments.
Login now