diff mercurial/match.py @ 25636:bfe9ed85f27c stable

match: let 'path:.' and 'path:' match everything (issue4687) Previously, both queries exited with code 1, printing nothing. The pattern in the latter query is normalized to '.', so it is really the same case.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 20 Jun 2015 19:59:26 -0400
parents ef4538ba67ef
children ff5172c83002
line wrap: on
line diff
--- a/mercurial/match.py	Sat Jun 13 20:14:22 2015 +0900
+++ b/mercurial/match.py	Sat Jun 20 19:59:26 2015 -0400
@@ -407,6 +407,8 @@
     if kind == 're':
         return pat
     if kind == 'path':
+        if pat == '.':
+            return ''
         return '^' + util.re.escape(pat) + '(?:/|$)'
     if kind == 'relglob':
         return '(?:|.*/)' + _globre(pat) + globsuffix