[Pkg-bazaar-commits] ./bzr/unstable r69: handle add, remove, file-id being given filenames that are

Martin Pool mbp at sourcefrog.net
Fri Apr 10 07:27:29 UTC 2009


------------------------------------------------------------
revno: 69
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Tue 2005-03-22 22:43:02 +1100
message:
  handle add, remove, file-id being given filenames that are
  not relative to branch root
modified:
  bzrlib/commands.py
-------------- next part --------------
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2005-03-22 08:00:50 +0000
+++ b/bzrlib/commands.py	2005-03-22 11:43:02 +0000
@@ -172,7 +172,7 @@
     """
     assert file_list
     b = Branch(file_list[0], find_root=True)
-    b.add(file_list, verbose=verbose)
+    b.add([b.relpath(f) for f in file_list], verbose=verbose)
 
 
 def cmd_relpath(filename):
@@ -249,12 +249,14 @@
 
 
 def cmd_remove(file_list, verbose=False):
-    Branch('.').remove(file_list, verbose=verbose)
+    b = Branch(file_list[0])
+    b.remove([b.relpath(f) for f in file_list], verbose=verbose)
 
 
 
 def cmd_file_id(filename):
-    i = Branch('.').read_working_inventory().path2id(filename)
+    b = Branch(filename)
+    i = b.inventory.path2id(b.relpath(filename))
     if i is None:
         bailout("%s is not a versioned file" % filename)
     else:



More information about the Pkg-bazaar-commits mailing list