Move context.filectx into if-clause where it's actually needed solo-extension
authorChristian Ebert <blacktrash@gmx.net>
Fri, 29 Dec 2006 14:14:23 +0100
branchsolo-extension
changeset 56 e8834575128b
parent 55 34fb92c050bc
child 57 f95c21f87e9c
Move context.filectx into if-clause where it's actually needed
hgkw/keyword.py
--- a/hgkw/keyword.py	Fri Dec 29 14:06:10 2006 +0100
+++ b/hgkw/keyword.py	Fri Dec 29 14:14:23 2006 +0100
@@ -83,13 +83,13 @@
         def read(self, node):
             data = super(kwfilelog, self).read(node)
             if not self._path.startswith('.hg') and not util.binary(data):
-                c = context.filectx(self._repo, self._path, fileid=node,
-                                     filelog=self)
                 for pat, opt in self._repo.ui.configitems('keyword'):
                     if opt == 'expand':
                         mf = util.matcher(self._repo.root,
                                 '', [pat], [], [])[1]
                         if mf(self._path):
+                            c = context.filectx(self._repo, self._path,
+                                    fileid=node, filelog=self)
 
                             def kwexpander(matchobj):
                                 return kwexpand(matchobj,