~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-04 08:08:08 UTC
  • mfrom: (2568.2.10 add)
  • Revision ID: pqm@pqm.ubuntu.com-20070704080808-0ptk5p5yiwxjgnt7
(robertc) Overhaul smart_add to be an api on MutableTree allowing specialisation and reducing some cruft. (Robert Collins, Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
238
238
 
239
239
def get_host_name_unicode():
240
240
    return _ensure_unicode(get_host_name())
 
241
 
 
242
 
 
243
def glob_expand_for_win32(file_list):
 
244
    """Replacement for glob expansion by the shell.
 
245
 
 
246
    Win32's cmd.exe does not do glob expansion (eg ``*.py``), so we do our own
 
247
    here.
 
248
 
 
249
    :param file_list: A list of filenames which may include shell globs.
 
250
    :return: An expanded list of filenames.
 
251
 
 
252
    Introduced in bzrlib 0.18.
 
253
    """
 
254
    if not file_list:
 
255
        return []
 
256
    import glob
 
257
    expanded_file_list = []
 
258
    for possible_glob in file_list:
 
259
        glob_files = glob.glob(possible_glob)
 
260
 
 
261
        if glob_files == []:
 
262
            # special case to let the normal code path handle
 
263
            # files that do not exists
 
264
            expanded_file_list.append(possible_glob)
 
265
        else:
 
266
            expanded_file_list += glob_files
 
267
    return expanded_file_list
 
268
 
 
269