branchmap: improve computation of target tip
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 24 Dec 2012 02:57:23 +0100
changeset 18167 59ac9a551bf4
parent 18166 3a2e810dd3d8
child 18168 c351759ab0a0
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.
mercurial/branchmap.py
--- a/mercurial/branchmap.py	Fri Dec 28 00:13:32 2012 +0100
+++ b/mercurial/branchmap.py	Mon Dec 24 02:57:23 2012 +0100
@@ -60,7 +60,7 @@
     # If cacheable tip were lower than actual tip, we need to update the
     # cache up to tip. This update (from cacheable to actual tip) is not
     # written to disk since it's not cacheable.
-    tiprev = len(repo) - 1
+    tiprev = cl.rev(cl.tip())
     if partial.tiprev < tiprev:
         ctxgen = (repo[r] for r in cl.revs(partial.tiprev + 1, tiprev))
         partial.update(repo, ctxgen)