mercurial/copies.py
changeset 42594 d013099c551b
parent 42593 11ceb1b8fd74
child 42595 819712deac69
equal deleted inserted replaced
42593:11ceb1b8fd74 42594:d013099c551b
   283                 if dst not in copies:
   283                 if dst not in copies:
   284                     # If it was copied on the p1 side, leave it as copied from
   284                     # If it was copied on the p1 side, leave it as copied from
   285                     # that side, even if it was also copied on the p2 side.
   285                     # that side, even if it was also copied on the p2 side.
   286                     copies[dst] = copies2[dst]
   286                     copies[dst] = copies2[dst]
   287         if r == b.rev():
   287         if r == b.rev():
   288             _filter(a, b, copies)
       
   289             return copies
   288             return copies
   290         for i, c in enumerate(children[r]):
   289         for i, c in enumerate(children[r]):
   291             childctx = repo[c]
   290             childctx = repo[c]
   292             if r == childctx.p1().rev():
   291             if r == childctx.p1().rev():
   293                 parent = 1
   292                 parent = 1
   319     # check for working copy
   318     # check for working copy
   320     if b.rev() is None:
   319     if b.rev() is None:
   321         cm = _committedforwardcopies(a, b.p1(), match)
   320         cm = _committedforwardcopies(a, b.p1(), match)
   322         # combine copies from dirstate if necessary
   321         # combine copies from dirstate if necessary
   323         copies = _chain(cm, _dirstatecopies(b._repo, match))
   322         copies = _chain(cm, _dirstatecopies(b._repo, match))
   324         _filter(a, b, copies)
       
   325     else:
   323     else:
   326         copies  = _committedforwardcopies(a, b, match)
   324         copies  = _committedforwardcopies(a, b, match)
   327     return copies
   325     return copies
   328 
   326 
   329 def _backwardrenames(a, b, match):
   327 def _backwardrenames(a, b, match):
   371     else:
   369     else:
   372         if debug:
   370         if debug:
   373             repo.ui.debug('debug.copies: search mode: combined\n')
   371             repo.ui.debug('debug.copies: search mode: combined\n')
   374         copies = _chain(_backwardrenames(x, a, match=match),
   372         copies = _chain(_backwardrenames(x, a, match=match),
   375                         _forwardcopies(a, y, match=match))
   373                         _forwardcopies(a, y, match=match))
   376         _filter(x, y, copies)
   374     _filter(x, y, copies)
   377     return copies
   375     return copies
   378 
   376 
   379 def mergecopies(repo, c1, c2, base):
   377 def mergecopies(repo, c1, c2, base):
   380     """
   378     """
   381     Finds moves and copies between context c1 and c2 that are relevant for
   379     Finds moves and copies between context c1 and c2 that are relevant for