mercurial/commands.py
changeset 46087 64292addbe67
parent 46077 7a2b67e6b680
child 46088 8837498ae6e0
equal deleted inserted replaced
46086:ac9de799d390 46087:64292addbe67
  2454 
  2454 
  2455 @command(
  2455 @command(
  2456     b'diff',
  2456     b'diff',
  2457     [
  2457     [
  2458         (b'r', b'rev', [], _(b'revision'), _(b'REV')),
  2458         (b'r', b'rev', [], _(b'revision'), _(b'REV')),
       
  2459         (b'', b'from', b'', _(b'revision to diff from'), _(b'REV')),
       
  2460         (b'', b'to', b'', _(b'revision to diff to'), _(b'REV')),
  2459         (b'c', b'change', b'', _(b'change made by revision'), _(b'REV')),
  2461         (b'c', b'change', b'', _(b'change made by revision'), _(b'REV')),
  2460     ]
  2462     ]
  2461     + diffopts
  2463     + diffopts
  2462     + diffopts2
  2464     + diffopts2
  2463     + walkopts
  2465     + walkopts
  2528 
  2530 
  2529     cmdutil.check_at_most_one_arg(opts, 'rev', 'change')
  2531     cmdutil.check_at_most_one_arg(opts, 'rev', 'change')
  2530     opts = pycompat.byteskwargs(opts)
  2532     opts = pycompat.byteskwargs(opts)
  2531     revs = opts.get(b'rev')
  2533     revs = opts.get(b'rev')
  2532     change = opts.get(b'change')
  2534     change = opts.get(b'change')
       
  2535     from_rev = opts.get(b'from')
       
  2536     to_rev = opts.get(b'to')
  2533     stat = opts.get(b'stat')
  2537     stat = opts.get(b'stat')
  2534     reverse = opts.get(b'reverse')
  2538     reverse = opts.get(b'reverse')
  2535 
  2539 
       
  2540     cmdutil.check_incompatible_arguments(opts, b'from', [b'rev', b'change'])
       
  2541     cmdutil.check_incompatible_arguments(opts, b'to', [b'rev', b'change'])
  2536     if change:
  2542     if change:
  2537         repo = scmutil.unhidehashlikerevs(repo, [change], b'nowarn')
  2543         repo = scmutil.unhidehashlikerevs(repo, [change], b'nowarn')
  2538         ctx2 = scmutil.revsingle(repo, change, None)
  2544         ctx2 = scmutil.revsingle(repo, change, None)
  2539         ctx1 = ctx2.p1()
  2545         ctx1 = ctx2.p1()
       
  2546     elif from_rev or to_rev:
       
  2547         repo = scmutil.unhidehashlikerevs(
       
  2548             repo, [from_rev] + [to_rev], b'nowarn'
       
  2549         )
       
  2550         ctx1 = scmutil.revsingle(repo, from_rev, None)
       
  2551         ctx2 = scmutil.revsingle(repo, to_rev, None)
  2540     else:
  2552     else:
  2541         repo = scmutil.unhidehashlikerevs(repo, revs, b'nowarn')
  2553         repo = scmutil.unhidehashlikerevs(repo, revs, b'nowarn')
  2542         ctx1, ctx2 = scmutil.revpair(repo, revs)
  2554         ctx1, ctx2 = scmutil.revpair(repo, revs)
  2543 
  2555 
  2544     if reverse:
  2556     if reverse: