[Pkg-bazaar-commits] ./bzr/unstable r426: - Skip symlinks during recursive add (path from aaron)

Martin Pool mbp at sourcefrog.net
Fri Apr 10 07:52:15 UTC 2009


------------------------------------------------------------
revno: 426
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Tue 2005-05-10 14:32:39 +1000
message:
  - Skip symlinks during recursive add (path from aaron)
modified:
  bzrlib/add.py
  bzrlib/textui.py
-------------- next part --------------
=== modified file 'bzrlib/add.py'
--- a/bzrlib/add.py	2005-05-09 04:38:31 +0000
+++ b/bzrlib/add.py	2005-05-10 04:32:39 +0000
@@ -28,6 +28,7 @@
     For the specific behaviour see the help for cmd_add().
     """
     assert file_list
+    user_list = file_list[:]
     assert not isinstance(file_list, basestring)
     b = bzrlib.branch.Branch(file_list[0], find_root=True)
     inv = b.read_working_inventory()
@@ -35,6 +36,14 @@
     count = 0
 
     for f in file_list:
+        kind = bzrlib.osutils.file_kind(f)
+
+        if kind != 'file' and kind != 'directory':
+            if f not in user_list:
+                print "Skipping %s (can't add file of kind '%s')" % (f, kind)
+                continue
+            bailout("can't add file of kind %r" % kind)
+
         rf = b.relpath(f)
         af = b.abspath(rf)
 

=== modified file 'bzrlib/textui.py'
--- a/bzrlib/textui.py	2005-05-03 07:48:16 +0000
+++ b/bzrlib/textui.py	2005-05-10 04:32:39 +0000
@@ -21,6 +21,8 @@
     if kind == 'directory':
         # use this even on windows?
         kind_ch = '/'
+    elif kind == 'symlink':
+        kind_ch = '->'
     else:
         assert kind == 'file', ("can't handle file of type %r" % kind)
         kind_ch = ''



More information about the Pkg-bazaar-commits mailing list