##// END OF EJS Templates
copies: teach copies about dirstate.copies...
Matt Mackall -
r6646:9eb274d7 default
parent child Browse files
Show More
@@ -2644,20 +2644,18 b' def status(ui, repo, *pats, **opts):'
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:
@@ -109,6 +109,10 b' def copies(repo, c1, c2, ca, checkdirs=F'
109 if not c1 or not c2 or c1 == c2:
109 if not c1 or not c2 or c1 == c2:
110 return {}, {}
110 return {}, {}
111
111
112 # avoid silly behavior for parent -> working dir
113 if c2.node() == None and c1.node() == repo.dirstate.parents()[0]:
114 return repo.dirstate.copies(), {}
115
112 limit = _findlimit(repo, c1.rev(), c2.rev())
116 limit = _findlimit(repo, c1.rev(), c2.rev())
113 m1 = c1.manifest()
117 m1 = c1.manifest()
114 m2 = c2.manifest()
118 m2 = c2.manifest()
@@ -13,7 +13,6 b' r 0 -1 foo1'
13 copy: foo -> foo1
13 copy: foo -> foo1
14 R bar
14 R bar
15 R foo1
15 R foo1
16 foo
17 % readding foo1 and bar
16 % readding foo1 and bar
18 adding bar
17 adding bar
19 adding foo1
18 adding foo1
General Comments 0
You need to be logged in to leave comments. Login now