Cycle filename patterns only once kwmap-templates
authorChristian Ebert <blacktrash@gmx.net>
Thu, 18 Jan 2007 03:36:40 +0100
branchkwmap-templates
changeset 112 914455f5959a
parent 111 94315baadcaf
child 113 3412cbc77275
Cycle filename patterns only once
hgkw/keyword.py
--- a/hgkw/keyword.py	Thu Jan 18 02:17:10 2007 +0100
+++ b/hgkw/keyword.py	Thu Jan 18 03:36:40 2007 +0100
@@ -127,11 +127,15 @@
 
     # get glob patterns to detect filenames
     # for inclusion in or exclusion from keyword substitution
-    inc = [pat for pat, opt in ui.configitems('keyword') if opt != 'ignore']
+    inc, exc = [], []
+    for pat, opt in ui.configitems('keyword'):
+        if opt != 'ignore':
+            inc.append(pat)
+        else:
+            exc.append(pat)
     if not inc:
         ui.warn(_('keyword: no filename globs for substitution\n'))
         return
-    exc = [pat for pat, opt in ui.configitems('keyword') if opt == 'ignore']
 
 
     class kwrepo(repo.__class__):