comparison mercurial/context.py @ 19061:36067f5baf24

annotate: discard refcount of discarded annotation for memory efficiency Before this patch, refcount (managed in "needed") of the annotation result is kept as 1, even if corresponding annotation result is discarded from "hist", because it isn't decreased and discarded. In the history tree including merging revision, the most recent common ancestor of merged revisions is scanned twice. Refcount of such ancestor never becomes 0, because refcount is started from 1 at the second scanning. This prevents annotation results of merging revision in "hist" from being discarded, and decreases memory efficiency. This patch discards refcount of the annotation result, when the corresponding annotation is discarded from "hist".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Thu, 18 Apr 2013 19:50:04 +0900
parents 0fd0612dc855
children 921b64e1f7b9
comparison
equal deleted inserted replaced
19060:c010cb6fdef7 19061:36067f5baf24
711 for p in pl: 711 for p in pl:
712 if not reusable: 712 if not reusable:
713 curr = pair(hist[p], curr) 713 curr = pair(hist[p], curr)
714 if needed[p] == 1: 714 if needed[p] == 1:
715 del hist[p] 715 del hist[p]
716 del needed[p]
716 else: 717 else:
717 needed[p] -= 1 718 needed[p] -= 1
718 719
719 hist[f] = curr 720 hist[f] = curr
720 pcache[f] = [] 721 pcache[f] = []