mercurial/branchmap.py
branchstable
changeset 25266 38117278f295
parent 24728 75688a6f0bca
child 25660 328739ea70c3
--- a/mercurial/branchmap.py	Sun May 24 10:29:33 2015 +0900
+++ b/mercurial/branchmap.py	Sat May 23 11:14:00 2015 +0900
@@ -341,6 +341,10 @@
         changelog = self._repo.changelog
         rbcrevidx = rev * _rbcrecsize
 
+        # avoid negative index, changelog.read(nullrev) is fast without cache
+        if rev == nullrev:
+            return changelog.branchinfo(rev)
+
         # if requested rev is missing, add and populate all missing revs
         if len(self._rbcrevs) < rbcrevidx + _rbcrecsize:
             self._rbcrevs.extend('\0' * (len(changelog) * _rbcrecsize -