Mercurial > public > mercurial-scm > hg-stable
diff mercurial/bundlerepo.py @ 4979:06abdaf78788
revlog: add a magic null revision to our index
We expand our index by one entry so that index[nullrev] points to a
unique entry, the null revision. This naturally eliminates numerous
extra tests in the performance-sensitive index access functions, most
of which are now trivial again.
Adding new entries is now done with insert(-1, e) rather than
append(e).
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 23 Jul 2007 20:44:08 -0500 |
parents | e017d3a82e1d |
children | b4066fcbd6ba |
line wrap: on
line diff
--- a/mercurial/bundlerepo.py Mon Jul 23 20:44:08 2007 -0500 +++ b/mercurial/bundlerepo.py Mon Jul 23 20:44:08 2007 -0500 @@ -58,13 +58,10 @@ if not prev: prev = p1 # start, size, base is not used, link, p1, p2, delta ref - if self.version == revlog.REVLOGV0: - e = (start, size, None, link, p1, p2, node) - else: - e = (revlog.offset_type(start, 0), size, -1, None, link, - self.rev(p1), self.rev(p2), node) + e = (revlog.offset_type(start, 0), size, -1, None, link, + self.rev(p1), self.rev(p2), node) self.basemap[n] = prev - self.index.append(e) + self.index.insert(-1, e) self.nodemap[node] = n prev = node n += 1