~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: Aaron Bentley
  • Date: 2005-10-20 02:57:55 UTC
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1474.
  • Revision ID: aaron.bentley@utoronto.ca-20051020025755-e03df41c52aa3156
tweaked spacing

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
from os.path import dirname
 
18
 
 
19
import bzrlib.errors as errors
 
20
from bzrlib.inventory import InventoryEntry
17
21
from bzrlib.trace import mutter, note, warning
18
22
from bzrlib.errors import NotBranchError
19
23
from bzrlib.branch import Branch
20
24
from bzrlib.osutils import quotefn
21
 
from os.path import dirname
22
25
 
23
26
def glob_expand_for_win32(file_list):
24
27
    import glob
25
 
    
26
28
    expanded_file_list = []
27
29
    for possible_glob in file_list:
28
30
        glob_files = glob.glob(possible_glob)
64
66
    Returns the number of files added.
65
67
    """
66
68
    file_list = _prepare_file_list(file_list)
67
 
    b = Branch.open_containing(file_list[0])
 
69
    b = Branch.open_containing(file_list[0])[0]
68
70
    return smart_add_branch(b, file_list, recurse, reporter)
69
71
 
70
72
        
91
93
    count = 0
92
94
 
93
95
    for f in file_list:
94
 
        rf = branch.relpath(f)
 
96
        rf = tree.relpath(f)
95
97
        af = branch.abspath(rf)
96
98
 
97
99
        kind = bzrlib.osutils.file_kind(af)
98
100
 
99
 
        if kind != 'file' and kind != 'directory':
 
101
        if not InventoryEntry.versionable_kind(kind):
100
102
            if f in user_list:
101
103
                raise BadFileKindError("cannot add %s of type %s" % (f, kind))
102
104
            else:
116
118
                sub_tree = True
117
119
            except NotBranchError:
118
120
                sub_tree = False
 
121
            except errors.UnsupportedFormatError:
 
122
                sub_tree = True
119
123
        else:
120
124
            sub_tree = False
121
125