189 cm = _chain(a, w, cm, _dirstatecopies(w)) |
189 cm = _chain(a, w, cm, _dirstatecopies(w)) |
190 |
190 |
191 return cm |
191 return cm |
192 |
192 |
193 def _backwardrenames(a, b): |
193 def _backwardrenames(a, b): |
|
194 if a._repo.ui.configbool('experimental', 'disablecopytrace'): |
|
195 return {} |
|
196 |
194 # Even though we're not taking copies into account, 1:n rename situations |
197 # Even though we're not taking copies into account, 1:n rename situations |
195 # can still exist (e.g. hg cp a b; hg mv a c). In those cases we |
198 # can still exist (e.g. hg cp a b; hg mv a c). In those cases we |
196 # arbitrarily pick one of the renames. |
199 # arbitrarily pick one of the renames. |
197 f = _forwardcopies(b, a) |
200 f = _forwardcopies(b, a) |
198 r = {} |
201 r = {} |
261 return {}, {}, {}, {} |
264 return {}, {}, {}, {} |
262 |
265 |
263 # avoid silly behavior for parent -> working dir |
266 # avoid silly behavior for parent -> working dir |
264 if c2.node() is None and c1.node() == repo.dirstate.p1(): |
267 if c2.node() is None and c1.node() == repo.dirstate.p1(): |
265 return repo.dirstate.copies(), {}, {}, {} |
268 return repo.dirstate.copies(), {}, {}, {} |
|
269 |
|
270 # Copy trace disabling is explicitly below the node == p1 logic above |
|
271 # because the logic above is required for a simple copy to be kept across a |
|
272 # rebase. |
|
273 if repo.ui.configbool('experimental', 'disablecopytrace'): |
|
274 return {}, {}, {}, {} |
266 |
275 |
267 limit = _findlimit(repo, c1.rev(), c2.rev()) |
276 limit = _findlimit(repo, c1.rev(), c2.rev()) |
268 if limit is None: |
277 if limit is None: |
269 # no common ancestor, no copies |
278 # no common ancestor, no copies |
270 return {}, {}, {}, {} |
279 return {}, {}, {}, {} |
511 filter copy records. Any copies that occur between fromrev and |
520 filter copy records. Any copies that occur between fromrev and |
512 skiprev will not be duplicated, even if they appear in the set of |
521 skiprev will not be duplicated, even if they appear in the set of |
513 copies between fromrev and rev. |
522 copies between fromrev and rev. |
514 ''' |
523 ''' |
515 exclude = {} |
524 exclude = {} |
516 if skiprev is not None: |
525 if (skiprev is not None and |
|
526 not repo.ui.configbool('experimental', 'disablecopytrace')): |
|
527 # disablecopytrace skips this line, but not the entire function because |
|
528 # the line below is O(size of the repo) during a rebase, while the rest |
|
529 # of the function is much faster (and is required for carrying copy |
|
530 # metadata across the rebase anyway). |
517 exclude = pathcopies(repo[fromrev], repo[skiprev]) |
531 exclude = pathcopies(repo[fromrev], repo[skiprev]) |
518 for dst, src in pathcopies(repo[fromrev], repo[rev]).iteritems(): |
532 for dst, src in pathcopies(repo[fromrev], repo[rev]).iteritems(): |
519 # copies.pathcopies returns backward renames, so dst might not |
533 # copies.pathcopies returns backward renames, so dst might not |
520 # actually be in the dirstate |
534 # actually be in the dirstate |
521 if dst in exclude: |
535 if dst in exclude: |