# HG changeset patch # User Steve Borho # Date 2009-07-12 05:46:43 # Node ID 78e54b9f3a629ba3f5200f8e0bcd165b5398b094 # Parent f439d82f018cc91aab822045c747871d3f13c0f1 cmdutil: fall back to filename if glob expand has errors On Windows, Mercurial tries to glob expand provided filenames as a convenience to the user. Unfortunately, there are valid filenames which are not valid glob patterns. In those cases, we should fallback to the original provided filename. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -242,7 +242,10 @@ def expandpats(pats): for p in pats: kind, name = _match._patsplit(p, None) if kind is None: - globbed = glob.glob(name) + try: + globbed = glob.glob(name) + except re.error: + globbed = [name] if globbed: ret.extend(globbed) continue