mercurial/commands.py
changeset 6646 9eb274d773d9
parent 6642 c8c7248f6172
child 6658 7ca74741259f
equal deleted inserted replaced
6645:37eedb1a1848 6646:9eb274d773d9
  2642     stat = repo.status(node1, node2, cmdutil.match(repo, pats, opts),
  2642     stat = repo.status(node1, node2, cmdutil.match(repo, pats, opts),
  2643                        'ignored' in show, 'clean' in show, 'unknown' in show)
  2643                        'ignored' in show, 'clean' in show, 'unknown' in show)
  2644     changestates = zip(states, 'MAR!?IC', stat)
  2644     changestates = zip(states, 'MAR!?IC', stat)
  2645 
  2645 
  2646     if (opts['all'] or opts['copies']) and not opts['no_status']:
  2646     if (opts['all'] or opts['copies']) and not opts['no_status']:
  2647         if opts.get('rev') == []:
  2647         ctxn = repo.changectx(nullid)
  2648             # fast path, more correct with merge parents
  2648         ctx1 = repo.changectx(node1)
  2649             copy = repo.dirstate.copies()
  2649         ctx2 = repo.changectx(node2)
  2650         else:
  2650         added = stat[1]
  2651             ctxn = repo.changectx(nullid)
  2651         if node2 is None:
  2652             ctx1 = repo.changectx(node1)
  2652             added = stat[0] + stat[1] # merged?
  2653             ctx2 = repo.changectx(node2)
  2653             ctx2 = repo.workingctx()
  2654             if node2 is None:
  2654         for k, v in copies.copies(repo, ctx1, ctx2, ctxn)[0].items():
  2655                 ctx2 = repo.workingctx()
  2655             if k in added:
  2656             for k, v in copies.copies(repo, ctx1, ctx2, ctxn)[0].items():
  2656                 copy[k] = v
  2657                 if v in stat[1]:
  2657             elif v in added:
  2658                     copy[v] = k
  2658                 copy[v] = k
  2659                 elif k in stat[1]:
       
  2660                     copy[k] = v
       
  2661 
  2659 
  2662     for state, char, files in changestates:
  2660     for state, char, files in changestates:
  2663         if state in show:
  2661         if state in show:
  2664             format = "%s %%s%s" % (char, end)
  2662             format = "%s %%s%s" % (char, end)
  2665             if opts['no_status']:
  2663             if opts['no_status']: