Rev 3: Optional path in http://people.ubuntu.com/~robertc/baz2.0/plugins/repodetails/trunk

Robert Collins robertc at robertcollins.net
Fri Oct 17 04:19:30 BST 2008


At http://people.ubuntu.com/~robertc/baz2.0/plugins/repodetails/trunk

------------------------------------------------------------
revno: 3
revision-id: robertc at robertcollins.net-20081017031930-xo8c5rxqi06qztzd
parent: robertc at robertcollins.net-20081017031136-ucaw6x6oc0axse22
committer: Robert Collins <robertc at robertcollins.net>
branch nick: trunk
timestamp: Fri 2008-10-17 14:19:30 +1100
message:
  Optional path
modified:
  __init__.py                    __init__.py-20081017014933-iriuw53viune2txe-2
=== modified file '__init__.py'
--- a/__init__.py	2008-10-17 03:11:36 +0000
+++ b/__init__.py	2008-10-17 03:19:30 +0000
@@ -198,6 +198,8 @@
     or may break... who knows.
     """
 
+    takes_args = ["path?"]
+
     def _format_object(self, objectstats, total):
         # Mangle the percentages for very small repos to avoid divide by zero.
         raw_percent = (objectstats.raw_size + 1)*100/(total.raw_size + 1)
@@ -206,8 +208,8 @@
             raw_percent, objectstats.compressed_size/1024, compressed_percent,
             objectstats.objects)
 
-    def run(self):
-        repo = repository.Repository.open(".")
+    def run(self, path="."):
+        repo = repository.Repository.open(path)
         stats = gather_stats(repo)
         self.outf.write("Commits: %d\n" % stats.revision_count)
         self.outf.write("                    Raw    %  Compressed    %  Objects\n")




More information about the bazaar-commits mailing list