# HG changeset patch # User Steve Borho # Date 2009-03-27 03:07:01 # Node ID 1b1b3dd630a5a6facb5e1f8553349484f53620db # Parent 0b2561b5306967e8ec749e6480c7bdbc2717ae8d windows: hoist expand_glob() back into util.py The windows version of expand_glob() requires patkind(). To avoid a circular dependency, move function back into util.py. diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -844,6 +844,19 @@ class path_auditor(object): if os.name == 'nt': from windows import * + def expand_glob(pats): + '''On Windows, expand the implicit globs in a list of patterns''' + ret = [] + for p in pats: + kind, name = patkind(p, None) + if kind is None: + globbed = glob.glob(name) + if globbed: + ret.extend(globbed) + continue + # if we couldn't expand the glob, just keep it around + ret.append(p) + return ret else: from posix import * diff --git a/mercurial/windows.py b/mercurial/windows.py --- a/mercurial/windows.py +++ b/mercurial/windows.py @@ -229,20 +229,6 @@ def getuser(): raise Abort(_('user name not available - set USERNAME ' 'environment variable')) -def expand_glob(pats): - '''On Windows, expand the implicit globs in a list of patterns''' - ret = [] - for p in pats: - kind, name = patkind(p, None) - if kind is None: - globbed = glob.glob(name) - if globbed: - ret.extend(globbed) - continue - # if we couldn't expand the glob, just keep it around - ret.append(p) - return ret - def username(uid=None): """Return the name of the user with the given uid.