~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: Martin Pool
  • Date: 2005-06-06 04:47:33 UTC
  • Revision ID: mbp@sourcefrog.net-20050606044733-e902b05ac1747cd2
- fix invocation of testbzr when giving explicit bzr location

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
from trace import mutter, note
21
21
 
22
 
def glob_expand_for_win32(file_list):
23
 
    import glob
24
 
    
25
 
    expanded_file_list = []
26
 
    for possible_glob in file_list:
27
 
        glob_files = glob.glob(possible_glob)
28
 
       
29
 
        if glob_files == []:
30
 
            # special case to let the normal code path handle
31
 
            # files that do not exists
32
 
            expanded_file_list.append(possible_glob)
33
 
        else:
34
 
            expanded_file_list += glob_files
35
 
    return expanded_file_list
36
 
 
37
22
def smart_add(file_list, verbose=True, recurse=True):
38
23
    """Add files to version, optionally recursing into directories.
39
24
 
44
29
    from bzrlib.errors import BadFileKindError, ForbiddenFileError
45
30
 
46
31
    assert file_list
47
 
    
48
 
    if sys.platform == 'win32':
49
 
        file_list = glob_expand_for_win32(file_list)
50
 
    
51
32
    user_list = file_list[:]
52
33
    assert not isinstance(file_list, basestring)
53
34
    b = bzrlib.branch.Branch(file_list[0], find_root=True)