mercurial/copies.py
changeset 42487 5ceb91136ebe
parent 42486 35d674a3d5db
child 42488 c0b51449bf6b
equal deleted inserted replaced
42486:35d674a3d5db 42487:5ceb91136ebe
   295         else:
   295         else:
   296             copies = copies1
   296             copies = copies1
   297         if r == b.rev():
   297         if r == b.rev():
   298             _filter(a, b, copies)
   298             _filter(a, b, copies)
   299             return copies
   299             return copies
   300         for c in children[r]:
   300         for i, c in enumerate(children[r]):
   301             childctx = repo[c]
   301             childctx = repo[c]
   302             if r == childctx.p1().rev():
   302             if r == childctx.p1().rev():
   303                 parent = 1
   303                 parent = 1
   304                 childcopies = childctx.p1copies()
   304                 childcopies = childctx.p1copies()
   305             else:
   305             else:
   307                 parent = 2
   307                 parent = 2
   308                 childcopies = childctx.p2copies()
   308                 childcopies = childctx.p2copies()
   309             if not match.always():
   309             if not match.always():
   310                 childcopies = {dst: src for dst, src in childcopies.items()
   310                 childcopies = {dst: src for dst, src in childcopies.items()
   311                                if match(dst)}
   311                                if match(dst)}
   312             childcopies = _chain(copies, childcopies)
   312             # Copy the dict only if later iterations will also need it
       
   313             if i != len(children[r]) - 1:
       
   314                 copies = copies.copy()
       
   315             if childcopies:
       
   316                 childcopies = _chain(copies, childcopies)
       
   317             else:
       
   318                 childcopies = copies
   313             for f in childctx.filesremoved():
   319             for f in childctx.filesremoved():
   314                 if f in childcopies:
   320                 if f in childcopies:
   315                     del childcopies[f]
   321                     del childcopies[f]
   316             heapq.heappush(work, (c, parent, childcopies))
   322             heapq.heappush(work, (c, parent, childcopies))
   317     assert False
   323     assert False