Mercurial > public > mercurial-scm > hg
diff hgext/graphlog.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 | 53465a7464e2 |
children | f67d1468ac50 |
line wrap: on
line diff
--- a/hgext/graphlog.py Thu Jun 26 14:35:50 2008 -0500 +++ b/hgext/graphlog.py Thu Jun 26 14:35:50 2008 -0500 @@ -89,7 +89,7 @@ assert start_rev >= stop_rev curr_rev = start_rev revs = [] - filerev = repo.file(path).count() - 1 + filerev = len(repo.file(path)) - 1 while filerev >= 0: fctx = repo.filectx(path, fileid=filerev) @@ -198,7 +198,7 @@ revs = revrange(repo, rev_opt) return (max(revs), min(revs)) else: - return (repo.changelog.count() - 1, 0) + return (len(repo) - 1, 0) def graphlog(ui, repo, path=None, **opts): """show revision history alongside an ASCII revision graph