changeset 6050:adf73753eb7d

keyword: fix pychecker warning about shadowed variable Also no underscore prefix for restricted switch inside reposetup.
author Christian Ebert <blacktrash@gmx.net>
date Thu, 07 Feb 2008 15:56:20 +0100
parents 348132c112cf
children 1038b1458d7a
files hgext/keyword.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Fri Feb 08 13:56:29 2008 +0100
+++ b/hgext/keyword.py	Thu Feb 07 15:56:20 2008 +0100
@@ -116,11 +116,11 @@
         'Header': '{root}/{file},v {node|short} {date|utcdate} {author|user}',
     }
 
-    def __init__(self, ui, repo, inc, exc, restricted):
+    def __init__(self, ui, repo, inc, exc, restrict):
         self.ui = ui
         self.repo = repo
         self.matcher = util.matcher(repo.root, inc=inc, exc=exc)[1]
-        self.restricted = restricted
+        self.restrict = restrict
         self.commitnode = None
         self.path = ''
 
@@ -159,7 +159,7 @@
 
     def expand(self, node, data):
         '''Returns data with keywords expanded.'''
-        if self.restricted or util.binary(data):
+        if self.restrict or util.binary(data):
             return data
         return self.substitute(node, data, self.re_kw.sub)
 
@@ -436,8 +436,8 @@
         return
 
     global _kwtemplater
-    _restricted = hgcmd in restricted.split()
-    _kwtemplater = kwtemplater(ui, repo, inc, exc, _restricted)
+    restrict = hgcmd in restricted.split()
+    _kwtemplater = kwtemplater(ui, repo, inc, exc, restrict)
 
     class kwrepo(repo.__class__):
         def file(self, f, kwmatch=False):
@@ -449,7 +449,7 @@
 
         def wread(self, filename):
             data = super(kwrepo, self).wread(filename)
-            if _restricted and _kwtemplater.matcher(filename):
+            if restrict and _kwtemplater.matcher(filename):
                 return _kwtemplater.shrink(data)
             return data