Mercurial > public > mercurial-scm > hg-stable
diff mercurial/changelog.py @ 6750:fb42030d79d6
add __len__ and __iter__ methods to repo and revlog
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 26 Jun 2008 14:35:50 -0500 |
parents | d60aa0308b02 |
children | f67d1468ac50 |
line wrap: on
line diff
--- a/mercurial/changelog.py Thu Jun 26 14:35:50 2008 -0500 +++ b/mercurial/changelog.py Thu Jun 26 14:35:50 2008 -0500 @@ -82,7 +82,7 @@ "delay visibility of index updates to other readers" self._realopener = self.opener self.opener = self._delayopener - self._delaycount = self.count() + self._delaycount = len(self) self._delaybuf = [] self._delayname = None @@ -108,7 +108,7 @@ # if we're doing an initial clone, divert to another file if self._delaycount == 0: self._delayname = fp.name - if not self.count(): + if not len(self): # make sure to truncate the file mode = mode.replace('a', 'w') return self._realopener(name + ".a", mode) @@ -192,4 +192,4 @@ list.sort() l = [hex(manifest), user, parseddate] + list + ["", desc] text = "\n".join(l) - return self.addrevision(text, transaction, self.count(), p1, p2) + return self.addrevision(text, transaction, len(self), p1, p2)