~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: Martin Pool
  • Date: 2005-06-22 09:35:24 UTC
  • Revision ID: mbp@sourcefrog.net-20050622093524-b15e2d374c2ae6ea
- move standard plugins from contrib/plugins to just ./plugins

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
 
22
37
def smart_add(file_list, verbose=True, recurse=True):
23
38
    """Add files to version, optionally recursing into directories.
24
39
 
29
44
    from bzrlib.errors import BadFileKindError, ForbiddenFileError
30
45
 
31
46
    assert file_list
 
47
    
 
48
    if sys.platform == 'win32':
 
49
        file_list = glob_expand_for_win32(file_list)
 
50
    
32
51
    user_list = file_list[:]
33
52
    assert not isinstance(file_list, basestring)
34
53
    b = bzrlib.branch.Branch(file_list[0], find_root=True)