114 |
114 |
115 old = old.keys() |
115 old = old.keys() |
116 old.sort() |
116 old.sort() |
117 return old |
117 return old |
118 |
118 |
119 def findcopies(repo, m1, m2, limit): |
119 def findcopies(repo, m1, m2, ma, limit): |
120 """ |
120 """ |
121 Find moves and copies between m1 and m2 back to limit linkrev |
121 Find moves and copies between m1 and m2 back to limit linkrev |
122 """ |
122 """ |
123 |
123 |
124 if not repo.ui.config("merge", "followcopies"): |
124 if not repo.ui.configbool("merge", "followcopies", True): |
125 return {} |
125 return {} |
126 |
126 |
127 # avoid silly behavior for update from empty dir |
127 # avoid silly behavior for update from empty dir |
128 if not m1: |
128 if not m1: |
129 return {} |
129 return {} |
130 |
130 |
131 dcopies = repo.dirstate.copies() |
131 dcopies = repo.dirstate.copies() |
132 copy = {} |
132 copy = {} |
133 match = {} |
133 match = {} |
134 u1 = nonoverlap(m1, m2) |
134 u1 = nonoverlap(m1, m2, ma) |
135 u2 = nonoverlap(m2, m1) |
135 u2 = nonoverlap(m2, m1, ma) |
136 ctx = util.cachefunc(lambda f,n: repo.filectx(f, fileid=n[:20])) |
136 ctx = util.cachefunc(lambda f,n: repo.filectx(f, fileid=n[:20])) |
137 |
137 |
138 def checkpair(c, f2, man): |
138 def checkpair(c, f2, man): |
139 ''' check if an apparent pair actually matches ''' |
139 ''' check if an apparent pair actually matches ''' |
140 c2 = ctx(f2, man[f2]) |
140 c2 = ctx(f2, man[f2]) |
192 def act(msg, m, f, *args): |
192 def act(msg, m, f, *args): |
193 repo.ui.debug(" %s: %s -> %s\n" % (f, msg, m)) |
193 repo.ui.debug(" %s: %s -> %s\n" % (f, msg, m)) |
194 action.append((f, m) + args) |
194 action.append((f, m) + args) |
195 |
195 |
196 if not (backwards or overwrite): |
196 if not (backwards or overwrite): |
197 copy = findcopies(repo, m1, m2, pa.rev()) |
197 copy = findcopies(repo, m1, m2, ma, pa.rev()) |
198 |
198 |
199 # Compare manifests |
199 # Compare manifests |
200 for f, n in m1.iteritems(): |
200 for f, n in m1.iteritems(): |
201 if partial and not partial(f): |
201 if partial and not partial(f): |
202 continue |
202 continue |