mercurial/commands.py
changeset 46497 4a012e531066
parent 46496 d57e607d9e33
child 46663 a4c19a162615
equal deleted inserted replaced
46496:d57e607d9e33 46497:4a012e531066
    27     bookmarks,
    27     bookmarks,
    28     bundle2,
    28     bundle2,
    29     bundlecaches,
    29     bundlecaches,
    30     changegroup,
    30     changegroup,
    31     cmdutil,
    31     cmdutil,
    32     context as contextmod,
       
    33     copies,
    32     copies,
    34     debugcommands as debugcommandsmod,
    33     debugcommands as debugcommandsmod,
    35     destutil,
    34     destutil,
    36     dirstateguard,
    35     dirstateguard,
    37     discovery,
    36     discovery,
  2543     change = opts.get(b'change')
  2542     change = opts.get(b'change')
  2544     from_rev = opts.get(b'from')
  2543     from_rev = opts.get(b'from')
  2545     to_rev = opts.get(b'to')
  2544     to_rev = opts.get(b'to')
  2546     stat = opts.get(b'stat')
  2545     stat = opts.get(b'stat')
  2547     reverse = opts.get(b'reverse')
  2546     reverse = opts.get(b'reverse')
  2548     diffmerge = ui.configbool(b'diff', b'merge')
       
  2549 
  2547 
  2550     cmdutil.check_incompatible_arguments(opts, b'from', [b'rev', b'change'])
  2548     cmdutil.check_incompatible_arguments(opts, b'from', [b'rev', b'change'])
  2551     cmdutil.check_incompatible_arguments(opts, b'to', [b'rev', b'change'])
  2549     cmdutil.check_incompatible_arguments(opts, b'to', [b'rev', b'change'])
  2552     if change:
  2550     if change:
  2553         repo = scmutil.unhidehashlikerevs(repo, [change], b'nowarn')
  2551         repo = scmutil.unhidehashlikerevs(repo, [change], b'nowarn')
  2554         ctx2 = scmutil.revsingle(repo, change, None)
  2552         ctx2 = scmutil.revsingle(repo, change, None)
  2555         if diffmerge and ctx2.p2().node() != nullid:
  2553         ctx1 = logcmdutil.diff_parent(ctx2)
  2556             pctx1 = ctx2.p1()
       
  2557             pctx2 = ctx2.p2()
       
  2558             wctx = contextmod.overlayworkingctx(repo)
       
  2559             wctx.setbase(pctx1)
       
  2560             with ui.configoverride(
       
  2561                 {
       
  2562                     (
       
  2563                         b'ui',
       
  2564                         b'forcemerge',
       
  2565                     ): b'internal:merge3-lie-about-conflicts',
       
  2566                 },
       
  2567                 b'diff --merge',
       
  2568             ):
       
  2569                 repo.ui.pushbuffer()
       
  2570                 mergemod.merge(pctx2, wc=wctx)
       
  2571                 repo.ui.popbuffer()
       
  2572             ctx1 = wctx
       
  2573         else:
       
  2574             ctx1 = ctx2.p1()
       
  2575     elif from_rev or to_rev:
  2554     elif from_rev or to_rev:
  2576         repo = scmutil.unhidehashlikerevs(
  2555         repo = scmutil.unhidehashlikerevs(
  2577             repo, [from_rev] + [to_rev], b'nowarn'
  2556             repo, [from_rev] + [to_rev], b'nowarn'
  2578         )
  2557         )
  2579         ctx1 = scmutil.revsingle(repo, from_rev, None)
  2558         ctx1 = scmutil.revsingle(repo, from_rev, None)