[PATCH 4 of 8 match] match: assert on the last case in _regex - mainly for documentation

Mads Kiilerich mads at kiilerich.com
Mon Apr 14 19:40:38 CDT 2014


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1397419277 -7200
#      Sun Apr 13 22:01:17 2014 +0200
# Node ID dd04203235c80e9b57ef651d62948ca4c893a5f8
# Parent  a1eeacd999bf8bc79b9585a010cf22e531827bbd
match: assert on the last case in _regex - mainly for documentation

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -314,6 +314,7 @@ def _regex(kind, pat, globsuffix):
         if pat.startswith('^'):
             return pat
         return '.*' + pat
+    assert kind == 'glob', kind
     return _globre(pat) + globsuffix
 
 def _buildmatch(ctx, kindpats, globsuffix):


More information about the Mercurial-devel mailing list