changeset 8288:9de088320e9a

mq: simpler check of first character of guard name
author Simon Heimberg <simohe@besonet.ch>
date Mon, 04 May 2009 03:49:57 +0200
parents 824ed0e35480
children fe8a3e56039f
files hgext/mq.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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)