##// END OF EJS Templates
findcopies: use dirstate rename information
Matt Mackall -
r3155:56c59ba7 default
parent child Browse files
Show More
@@ -63,10 +63,11 b' def workingmanifest(repo, man, status):'
63 Update manifest to correspond to the working directory
63 Update manifest to correspond to the working directory
64 """
64 """
65
65
66 copied = repo.dirstate.copies()
66 modified, added, removed, deleted, unknown = status[:5]
67 modified, added, removed, deleted, unknown = status[:5]
67 for i,l in (("a", added), ("m", modified), ("u", unknown)):
68 for i,l in (("a", added), ("m", modified), ("u", unknown)):
68 for f in l:
69 for f in l:
69 man[f] = man.get(f, nullid) + i
70 man[f] = man.get(copied.get(f, f), nullid) + i
70 man.set(f, util.is_exec(repo.wjoin(f), man.execf(f)))
71 man.set(f, util.is_exec(repo.wjoin(f), man.execf(f)))
71
72
72 for f in deleted + removed:
73 for f in deleted + removed:
@@ -132,6 +133,7 b' def findcopies(repo, m1, m2, limit):'
132 Find moves and copies between m1 and m2 back to limit linkrev
133 Find moves and copies between m1 and m2 back to limit linkrev
133 """
134 """
134
135
136 dcopies = repo.dirstate.copies()
135 copy = {}
137 copy = {}
136 match = {}
138 match = {}
137 u1 = nonoverlap(m1, m2)
139 u1 = nonoverlap(m1, m2)
@@ -147,7 +149,7 b' def findcopies(repo, m1, m2, limit):'
147 copy[f2] = c.path()
149 copy[f2] = c.path()
148
150
149 for f in u1:
151 for f in u1:
150 c = ctx(f, m1[f])
152 c = ctx(dcopies.get(f, f), m1[f])
151 for of in findold(c, limit):
153 for of in findold(c, limit):
152 if of in m2:
154 if of in m2:
153 checkpair(c, of, m2)
155 checkpair(c, of, m2)
@@ -354,6 +356,11 b' def update(repo, node, branchmerge=False'
354 (short(p1), short(p2), short(pa)))
356 (short(p1), short(p2), short(pa)))
355
357
356 action = []
358 action = []
359
360 copy = {}
361 if not (backwards or overwrite):
362 copy = findcopies(repo, m1, m2, repo.changelog.rev(pa))
363
357 m1 = workingmanifest(repo, m1, status)
364 m1 = workingmanifest(repo, m1, status)
358
365
359 if not force:
366 if not force:
@@ -361,10 +368,6 b' def update(repo, node, branchmerge=False'
361 if not branchmerge:
368 if not branchmerge:
362 action += forgetremoved(m2, status)
369 action += forgetremoved(m2, status)
363
370
364 copy = {}
365 if not (backwards or overwrite):
366 copy = findcopies(repo, m1, m2, repo.changelog.rev(pa))
367
368 action += manifestmerge(repo.ui, m1, m2, ma, overwrite, backwards, partial)
371 action += manifestmerge(repo.ui, m1, m2, ma, overwrite, backwards, partial)
369 del m1, m2, ma
372 del m1, m2, ma
370
373
General Comments 0
You need to be logged in to leave comments. Login now