[Pkg-bazaar-commits] ./bzr/unstable r439: - new command 'bzr added'

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


------------------------------------------------------------
revno: 439
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Tue 2005-05-10 17:06:05 +1000
message:
  - new command 'bzr added'
modified:
  bzrlib/commands.py
-------------- next part --------------
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2005-05-10 06:54:12 +0000
+++ b/bzrlib/commands.py	2005-05-10 07:06:05 +0000
@@ -503,6 +503,24 @@
             if cacheentry[statcache.SC_SHA1] != ie.text_sha1:
                 path = inv.id2path(file_id)
                 print path
+
+
+
+class cmd_added(Command):
+    """List files added in working tree."""
+    hidden = True
+    def run(self):
+        b = Branch('.')
+        wt = b.working_tree()
+        basis_inv = b.basis_tree().inventory
+        inv = wt.inventory
+        for file_id in inv:
+            if file_id in basis_inv:
+                continue
+            path = inv.id2path(file_id)
+            if not os.access(b.abspath(path), os.F_OK):
+                continue
+            print path
                 
         
 



More information about the Pkg-bazaar-commits mailing list