[Pkg-bazaar-commits] ./bzr/unstable r510: - fix add of files when standing in subdirectory

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


------------------------------------------------------------
revno: 510
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Mon 2005-05-16 15:26:51 +1000
message:
  - fix add of files when standing in subdirectory
modified:
  bzrlib/add.py
-------------- next part --------------
=== modified file 'bzrlib/add.py'
--- a/bzrlib/add.py	2005-05-15 02:36:04 +0000
+++ b/bzrlib/add.py	2005-05-16 05:26:51 +0000
@@ -36,7 +36,10 @@
     count = 0
 
     for f in file_list:
-        kind = bzrlib.osutils.file_kind(f)
+        rf = b.relpath(f)
+        af = b.abspath(rf)
+
+        kind = bzrlib.osutils.file_kind(af)
 
         if kind != 'file' and kind != 'directory':
             if f not in user_list:
@@ -44,16 +47,10 @@
                 continue
             bailout("can't add file of kind %r" % kind)
 
-        rf = b.relpath(f)
-        af = b.abspath(rf)
-
-        ## TODO: It's OK to add root but only in recursive mode
-
-        bzrlib.mutter("smart add of %r" % f)
+        bzrlib.mutter("smart add of %r, abs=%r" % (f, af))
         
         if bzrlib.branch.is_control_file(af):
             bailout("cannot add control file %r" % af)
-
             
         versioned = (inv.path2id(rf) != None)
 
@@ -77,8 +74,8 @@
                 elif tree.is_ignored(subp):
                     mutter("skip ignored sub-file %r" % subp)
                 else:
-                    mutter("queue to add sub-file %r" % (subp))
-                    file_list.append(subp)
+                    mutter("queue to add sub-file %r" % subp)
+                    file_list.append(b.abspath(subp))
 
     if count > 0:
         if verbose:



More information about the Pkg-bazaar-commits mailing list