mercurial/commands.py
changeset 44808 aac816f584ad
parent 44800 a9ff0742c8ea
child 44809 07a6a29d25ea
equal deleted inserted replaced
44807:16596f5e1afa 44808:aac816f584ad
  2473           hg diff -r 9353^2:9353  # compare against the second parent
  2473           hg diff -r 9353^2:9353  # compare against the second parent
  2474 
  2474 
  2475     Returns 0 on success.
  2475     Returns 0 on success.
  2476     """
  2476     """
  2477 
  2477 
       
  2478     cmdutil.check_at_most_one_arg(opts, 'rev', 'change')
  2478     opts = pycompat.byteskwargs(opts)
  2479     opts = pycompat.byteskwargs(opts)
  2479     revs = opts.get(b'rev')
  2480     revs = opts.get(b'rev')
  2480     change = opts.get(b'change')
  2481     change = opts.get(b'change')
  2481     stat = opts.get(b'stat')
  2482     stat = opts.get(b'stat')
  2482     reverse = opts.get(b'reverse')
  2483     reverse = opts.get(b'reverse')
  2483 
  2484 
  2484     if revs and change:
  2485     if change:
  2485         msg = _(b'cannot specify --rev and --change at the same time')
       
  2486         raise error.Abort(msg)
       
  2487     elif change:
       
  2488         repo = scmutil.unhidehashlikerevs(repo, [change], b'nowarn')
  2486         repo = scmutil.unhidehashlikerevs(repo, [change], b'nowarn')
  2489         ctx2 = scmutil.revsingle(repo, change, None)
  2487         ctx2 = scmutil.revsingle(repo, change, None)
  2490         ctx1 = ctx2.p1()
  2488         ctx1 = ctx2.p1()
  2491     else:
  2489     else:
  2492         repo = scmutil.unhidehashlikerevs(repo, revs, b'nowarn')
  2490         repo = scmutil.unhidehashlikerevs(repo, revs, b'nowarn')