Mercurial > public > mercurial-scm > hg
diff mercurial/repair.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 | f6c00b17387c |
children | 63b5f4c73c98 |
line wrap: on
line diff
--- a/mercurial/repair.py Thu Jun 26 14:35:50 2008 -0500 +++ b/mercurial/repair.py Thu Jun 26 14:35:50 2008 -0500 @@ -23,7 +23,7 @@ """find out the filelogs affected by the strip""" files = {} - for x in xrange(striprev, repo.changelog.count()): + for x in xrange(striprev, len(repo)): for name in repo[x].files(): if name in files: continue @@ -37,7 +37,7 @@ """return the nodes that have to be saved before the strip""" def collectone(revlog): extra = [] - startrev = count = revlog.count() + startrev = count = len(revlog) # find the truncation point of the revlog for i in xrange(0, count): node = revlog.node(i) @@ -84,7 +84,7 @@ tostrip = {striprev: 1} saveheads = {} savebases = [] - for r in xrange(striprev + 1, cl.count()): + for r in xrange(striprev + 1, len(cl)): parents = cl.parentrevs(r) if parents[0] in tostrip or parents[1] in tostrip: # r is a descendant of striprev