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

login
register
mail settings
Submitter Mads Kiilerich
Date April 15, 2014, 12:40 a.m.
Message ID <dd04203235c80e9b57ef.1397522438@mk-desktop>
Download mbox | patch
Permalink /patch/4356/
State Accepted
Headers show

Comments

Mads Kiilerich - April 15, 2014, 12:40 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@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

Patch

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):