[Pkg-bazaar-commits] ./bzr/unstable r588: - change inventory command to not show ids by default

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:19:52 UTC 2009


------------------------------------------------------------
revno: 588
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Mon 2005-05-30 12:21:00 +1000
message:
  - change inventory command to not show ids by default
modified:
  NEWS
  bzrlib/commands.py
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2005-05-27 02:57:50 +0000
+++ b/NEWS	2005-05-30 02:21:00 +0000
@@ -13,6 +13,10 @@
     * ``bzr log`` runs from most-recent to least-recent, the reverse
       of the previous order.  The previous behaviour can be obtained
       with the ``--forward`` option.
+        
+    * ``bzr inventory`` by default shows only filenames, and also ids
+      if ``--show-ids`` is given, in which case the id is the second
+      field.
 
 
   ENHANCEMENTS:

=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2005-05-30 01:49:40 +0000
+++ b/bzrlib/commands.py	2005-05-30 02:21:00 +0000
@@ -334,9 +334,9 @@
 
 class cmd_inventory(Command):
     """Show inventory of the current working copy or a revision."""
-    takes_options = ['revision']
+    takes_options = ['revision', 'show-ids']
     
-    def run(self, revision=None):
+    def run(self, revision=None, show_ids=False):
         b = Branch('.')
         if revision == None:
             inv = b.read_working_inventory()
@@ -344,7 +344,10 @@
             inv = b.get_revision_inventory(b.lookup_revision(revision))
 
         for path, entry in inv.entries():
-            print '%-50s %s' % (entry.file_id, path)
+            if show_ids:
+                print '%-50s %s' % (path, entry.file_id)
+            else:
+                print path
 
 
 class cmd_move(Command):



More information about the Pkg-bazaar-commits mailing list