String format keyword pattern before compilation
authorChristian Ebert <blacktrash@gmx.net>
Thu, 04 Oct 2007 14:55:38 +0200
changeset 252 001902b60bdd
parent 251 b37f2f065a9c
child 253 22e08d0f25dc
String format keyword pattern before compilation
hgkw/keyword.py
--- a/hgkw/keyword.py	Wed Oct 03 08:22:27 2007 +0200
+++ b/hgkw/keyword.py	Thu Oct 04 14:55:38 2007 +0200
@@ -173,8 +173,8 @@
             for k, v in kwmaps:
                 self.templates[k] = templater.parsestring(v, quoted=False)
         escaped = [re.escape(k) for k in self.templates.keys()]
-        rawkeyword = r'\$(%s)(: [^$\n\r]*? )??\$'
-        self.re_kw = re.compile(rawkeyword % '|'.join(escaped))
+        kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped)
+        self.re_kw = re.compile(kwpat)
         if self.t:
             templater.common_filters['utcdate'] = utcdate
             self.t = self._changeset_templater()