~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: Aaron Bentley
  • Date: 2005-10-04 04:32:32 UTC
  • mfrom: (1185.12.6)
  • mto: (1185.12.13)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: aaron.bentley@utoronto.ca-20051004043231-40302a149769263b
merged my own changes

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
21
17
from bzrlib.trace import mutter, note, warning
22
18
from bzrlib.errors import NotBranchError
23
19
from bzrlib.branch import Branch
24
20
from bzrlib.osutils import quotefn
 
21
from os.path import dirname
25
22
 
26
23
def glob_expand_for_win32(file_list):
27
 
    if not file_list:
28
 
        return
29
24
    import glob
30
25
    expanded_file_list = []
31
26
    for possible_glob in file_list:
68
63
    Returns the number of files added.
69
64
    """
70
65
    file_list = _prepare_file_list(file_list)
71
 
    b = Branch.open_containing(file_list[0])[0]
 
66
    b = Branch.open_containing(file_list[0])
72
67
    return smart_add_branch(b, file_list, recurse, reporter)
73
68
 
74
69
        
95
90
    count = 0
96
91
 
97
92
    for f in file_list:
98
 
        rf = tree.relpath(f)
 
93
        rf = branch.relpath(f)
99
94
        af = branch.abspath(rf)
100
95
 
101
96
        kind = bzrlib.osutils.file_kind(af)
102
97
 
103
 
        if not InventoryEntry.versionable_kind(kind):
 
98
        if kind != 'file' and kind != 'directory' and kind != 'symlink':
104
99
            if f in user_list:
105
100
                raise BadFileKindError("cannot add %s of type %s" % (f, kind))
106
101
            else:
120
115
                sub_tree = True
121
116
            except NotBranchError:
122
117
                sub_tree = False
123
 
            except errors.UnsupportedFormatError:
124
 
                sub_tree = True
125
118
        else:
126
119
            sub_tree = False
127
120