Mercurial > public > mercurial-scm > hg
comparison mercurial/branchmap.py @ 18167:59ac9a551bf4
branchmap: improve computation of target tip
With revision filtering the effective revision number of "tip" may be lower than:
len(changelog) - 1
We now use a more correct version preventing useless writing on disk in some
case.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 24 Dec 2012 02:57:23 +0100 |
parents | 3a2e810dd3d8 |
children | c351759ab0a0 |
comparison
equal
deleted
inserted
replaced
18166:3a2e810dd3d8 | 18167:59ac9a551bf4 |
---|---|
58 partial.update(repo, ctxgen) | 58 partial.update(repo, ctxgen) |
59 partial.write(repo) | 59 partial.write(repo) |
60 # If cacheable tip were lower than actual tip, we need to update the | 60 # If cacheable tip were lower than actual tip, we need to update the |
61 # cache up to tip. This update (from cacheable to actual tip) is not | 61 # cache up to tip. This update (from cacheable to actual tip) is not |
62 # written to disk since it's not cacheable. | 62 # written to disk since it's not cacheable. |
63 tiprev = len(repo) - 1 | 63 tiprev = cl.rev(cl.tip()) |
64 if partial.tiprev < tiprev: | 64 if partial.tiprev < tiprev: |
65 ctxgen = (repo[r] for r in cl.revs(partial.tiprev + 1, tiprev)) | 65 ctxgen = (repo[r] for r in cl.revs(partial.tiprev + 1, tiprev)) |
66 partial.update(repo, ctxgen) | 66 partial.update(repo, ctxgen) |
67 repo._branchcache = partial | 67 repo._branchcache = partial |
68 | 68 |