changeset 9118:78e54b9f3a62

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.
author Steve Borho <steve@borho.org>
date Sun, 12 Jul 2009 00:46:43 -0500
parents f439d82f018c
children 294c5e460b36 d3b995dd4eab 50cf61eb33e0
files mercurial/cmdutil.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sun Jul 12 21:37:24 2009 +0200
+++ b/mercurial/cmdutil.py	Sun Jul 12 00:46:43 2009 -0500
@@ -242,7 +242,10 @@
     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