mq: simpler check of first character of guard name
authorSimon Heimberg <simohe@besonet.ch>
Mon, 04 May 2009 03:49:57 +0200
changeset 8288 9de088320e9a
parent 8287 824ed0e35480
child 8289 fe8a3e56039f
mq: simpler check of first character of guard name
hgext/mq.py
--- a/hgext/mq.py	Sun May 03 20:34:12 2009 +0200
+++ b/hgext/mq.py	Mon May 04 03:49:57 2009 +0200
@@ -191,10 +191,9 @@
             return _('guard cannot be an empty string')
         bad_chars = '# \t\r\n\f'
         first = guard[0]
-        for c in '-+':
-            if first == c:
-                return (_('guard %r starts with invalid character: %r') %
-                        (guard, c))
+        if first in '-+':
+            return (_('guard %r starts with invalid character: %r') %
+                      (guard, first))
         for c in bad_chars:
             if c in guard:
                 return _('invalid character in guard %r: %r') % (guard, c)