61 def workingmanifest(repo, man, status): |
61 def workingmanifest(repo, man, status): |
62 """ |
62 """ |
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: |
73 del man[f] |
74 del man[f] |
74 |
75 |
130 def findcopies(repo, m1, m2, limit): |
131 def findcopies(repo, m1, m2, limit): |
131 """ |
132 """ |
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) |
138 u2 = nonoverlap(m2, m1) |
140 u2 = nonoverlap(m2, m1) |
139 ctx = util.cachefunc(lambda f,n: repo.filectx(f, fileid=n[:20])) |
141 ctx = util.cachefunc(lambda f,n: repo.filectx(f, fileid=n[:20])) |
352 (overwrite, branchmerge, bool(partial))) |
354 (overwrite, branchmerge, bool(partial))) |
353 repo.ui.debug(_(" ancestor %s local %s remote %s\n") % |
355 repo.ui.debug(_(" ancestor %s local %s remote %s\n") % |
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: |
360 checkunknown(repo, m2, status) |
367 checkunknown(repo, m2, status) |
361 if not branchmerge: |
368 if not branchmerge: |
362 action += forgetremoved(m2, status) |
369 action += forgetremoved(m2, status) |
363 |
|
364 copy = {} |
|
365 if not (backwards or overwrite): |
|
366 copy = findcopies(repo, m1, m2, repo.changelog.rev(pa)) |
|
367 |
370 |
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 |
371 ### apply phase |
374 ### apply phase |