mercurial/copies.py
changeset 42520 898b36f74f75
parent 42519 907cef396635
child 42548 4ebbd7c4a3c5
equal deleted inserted replaced
42519:907cef396635 42520:898b36f74f75
   266 
   266 
   267     roots = set(children) - set(missingrevs)
   267     roots = set(children) - set(missingrevs)
   268     # 'work' contains 3-tuples of a (revision number, parent number, copies).
   268     # 'work' contains 3-tuples of a (revision number, parent number, copies).
   269     # The parent number is only used for knowing which parent the copies dict
   269     # The parent number is only used for knowing which parent the copies dict
   270     # came from.
   270     # came from.
       
   271     # NOTE: To reduce costly copying the 'copies' dicts, we reuse the same
       
   272     # instance for *one* of the child nodes (the last one). Once an instance
       
   273     # has been put on the queue, it is thus no longer safe to modify it.
       
   274     # Conversely, it *is* safe to modify an instance popped off the queue.
   271     work = [(r, 1, {}) for r in roots]
   275     work = [(r, 1, {}) for r in roots]
   272     heapq.heapify(work)
   276     heapq.heapify(work)
   273     alwaysmatch = match.always()
   277     alwaysmatch = match.always()
   274     while work:
   278     while work:
   275         r, i1, copies = heapq.heappop(work)
   279         r, i1, copies = heapq.heappop(work)