Show More
@@ -6397,30 +6397,29 b' def revert(ui, repo, *pats, **opts):' | |||||
6397 | Returns 0 on success. |
|
6397 | Returns 0 on success. | |
6398 | """ |
|
6398 | """ | |
6399 |
|
6399 | |||
6400 | opts = pycompat.byteskwargs(opts) |
|
6400 | if opts.get("date"): | |
6401 | if opts.get(b"date"): |
|
6401 | cmdutil.check_incompatible_arguments(opts, 'date', ['rev']) | |
6402 | cmdutil.check_incompatible_arguments(opts, b'date', [b'rev']) |
|
6402 | opts["rev"] = cmdutil.finddate(ui, repo, opts["date"]) | |
6403 | opts[b"rev"] = cmdutil.finddate(ui, repo, opts[b"date"]) |
|
|||
6404 |
|
6403 | |||
6405 | parent, p2 = repo.dirstate.parents() |
|
6404 | parent, p2 = repo.dirstate.parents() | |
6406 |
if not opts.get( |
|
6405 | if not opts.get('rev') and p2 != repo.nullid: | |
6407 | # revert after merge is a trap for new users (issue2915) |
|
6406 | # revert after merge is a trap for new users (issue2915) | |
6408 | raise error.InputError( |
|
6407 | raise error.InputError( | |
6409 | _(b'uncommitted merge with no revision specified'), |
|
6408 | _(b'uncommitted merge with no revision specified'), | |
6410 | hint=_(b"use 'hg update' or see 'hg help revert'"), |
|
6409 | hint=_(b"use 'hg update' or see 'hg help revert'"), | |
6411 | ) |
|
6410 | ) | |
6412 |
|
6411 | |||
6413 |
rev = opts.get( |
|
6412 | rev = opts.get('rev') | |
6414 | if rev: |
|
6413 | if rev: | |
6415 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') |
|
6414 | repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn') | |
6416 | ctx = logcmdutil.revsingle(repo, rev) |
|
6415 | ctx = logcmdutil.revsingle(repo, rev) | |
6417 |
|
6416 | |||
6418 | if not ( |
|
6417 | if not ( | |
6419 | pats |
|
6418 | pats | |
6420 |
or opts.get( |
|
6419 | or opts.get('include') | |
6421 |
or opts.get( |
|
6420 | or opts.get('exclude') | |
6422 |
or opts.get( |
|
6421 | or opts.get('all') | |
6423 |
or opts.get( |
|
6422 | or opts.get('interactive') | |
6424 | ): |
|
6423 | ): | |
6425 | msg = _(b"no files or directories specified") |
|
6424 | msg = _(b"no files or directories specified") | |
6426 | if p2 != repo.nullid: |
|
6425 | if p2 != repo.nullid: | |
@@ -6454,7 +6453,7 b' def revert(ui, repo, *pats, **opts):' | |||||
6454 | hint = _(b"use --all to revert all files") |
|
6453 | hint = _(b"use --all to revert all files") | |
6455 | raise error.InputError(msg, hint=hint) |
|
6454 | raise error.InputError(msg, hint=hint) | |
6456 |
|
6455 | |||
6457 |
return cmdutil.revert(ui, repo, ctx, *pats, ** |
|
6456 | return cmdutil.revert(ui, repo, ctx, *pats, **opts) | |
6458 |
|
6457 | |||
6459 |
|
6458 | |||
6460 | @command( |
|
6459 | @command( |
General Comments 0
You need to be logged in to leave comments.
Login now