mercurial/copies.py
changeset 43300 ffd04bc9f57d
parent 43299 83bb1e89ab9b
child 43301 90213d027154
equal deleted inserted replaced
43299:83bb1e89ab9b 43300:ffd04bc9f57d
   268                 childcopies = p2copies
   268                 childcopies = p2copies
   269             if not alwaysmatch:
   269             if not alwaysmatch:
   270                 childcopies = {
   270                 childcopies = {
   271                     dst: src for dst, src in childcopies.items() if match(dst)
   271                     dst: src for dst, src in childcopies.items() if match(dst)
   272                 }
   272                 }
   273             # Copy the dict only if later iterations will also need it
   273             newcopies = copies
   274             if i != len(children[r]) - 1:
       
   275                 newcopies = copies.copy()
       
   276             else:
       
   277                 newcopies = copies
       
   278             if childcopies:
   274             if childcopies:
   279                 newcopies = _chain(newcopies, childcopies)
   275                 newcopies = _chain(newcopies, childcopies)
       
   276                 # _chain makes a copies, we can avoid doing so in some
       
   277                 # simple/linear cases.
       
   278                 assert newcopies is not copies
   280             for f in removed:
   279             for f in removed:
   281                 if f in newcopies:
   280                 if f in newcopies:
       
   281                     if newcopies is copies:
       
   282                         # copy on write to avoid affecting potential other
       
   283                         # branches.  when there are no other branches, this
       
   284                         # could be avoided.
       
   285                         newcopies = copies.copy()
   282                     del newcopies[f]
   286                     del newcopies[f]
   283             othercopies = all_copies.get(c)
   287             othercopies = all_copies.get(c)
   284             if othercopies is None:
   288             if othercopies is None:
   285                 all_copies[c] = newcopies
   289                 all_copies[c] = newcopies
   286             else:
   290             else: