[Pkg-bazaar-commits] ./bzr/unstable r221: Revfile: new command total-text-size
mbp at sourcefrog.net
mbp at sourcefrog.net
Fri Apr 10 07:51:28 UTC 2009
------------------------------------------------------------
revno: 221
committer: mbp at sourcefrog.net
timestamp: Sat 2005-04-09 15:49:27 +1000
message:
Revfile: new command total-text-size
modified:
bzrlib/revfile.py
-------------- next part --------------
=== modified file 'bzrlib/revfile.py'
--- a/bzrlib/revfile.py 2005-04-09 05:46:59 +0000
+++ b/bzrlib/revfile.py 2005-04-09 05:49:27 +0000
@@ -401,14 +401,10 @@
" revfile add\n"
" revfile add-delta BASE\n"
" revfile get IDX\n"
- " revfile find-sha HEX\n")
+ " revfile find-sha HEX\n"
+ " revfile total-text-size\n")
return 1
-
- # TODO: Something to show compression ratio, e.g. total size of
- # all files vs size of index and data files.
-
-
if cmd == 'add':
new_idx = r.add(sys.stdin.read())
print new_idx
@@ -442,7 +438,11 @@
return 1
else:
print idx
-
+ elif cmd == 'total-text-size':
+ t = 0L
+ for idx in range(len(r)):
+ t += len(r.get(idx))
+ print t
else:
sys.stderr.write("unknown command %r\n" % cmd)
return 1
More information about the Pkg-bazaar-commits
mailing list