Mercurial > hg
comparison mercurial/util.py @ 7913:1b1b3dd630a5
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.
author | Steve Borho <steve@borho.org> |
---|---|
date | Thu, 26 Mar 2009 22:07:01 -0500 |
parents | e710f0f592b2 |
children | a454eeb1b827 |
comparison
equal
deleted
inserted
replaced
7911:0b2561b53069 | 7913:1b1b3dd630a5 |
---|---|
842 # want to add "foo/bar/baz" before checking if there's a "foo/.hg" | 842 # want to add "foo/bar/baz" before checking if there's a "foo/.hg" |
843 self.auditeddir.update(prefixes) | 843 self.auditeddir.update(prefixes) |
844 | 844 |
845 if os.name == 'nt': | 845 if os.name == 'nt': |
846 from windows import * | 846 from windows import * |
847 def expand_glob(pats): | |
848 '''On Windows, expand the implicit globs in a list of patterns''' | |
849 ret = [] | |
850 for p in pats: | |
851 kind, name = patkind(p, None) | |
852 if kind is None: | |
853 globbed = glob.glob(name) | |
854 if globbed: | |
855 ret.extend(globbed) | |
856 continue | |
857 # if we couldn't expand the glob, just keep it around | |
858 ret.append(p) | |
859 return ret | |
847 else: | 860 else: |
848 from posix import * | 861 from posix import * |
849 | 862 |
850 def makelock(info, pathname): | 863 def makelock(info, pathname): |
851 try: | 864 try: |