--- a/hgkw/keyword.py Mon Apr 12 17:21:30 2010 -0700
+++ b/hgkw/keyword.py Tue Apr 13 10:13:41 2010 +0200
@@ -140,11 +140,11 @@
'''Replaces keywords in data with expanded template.'''
def kwsub(mobj):
kw = mobj.group(1)
- self.ct = cmdutil.changeset_templater(self.ui, self.repo,
- False, None, '', False)
- self.ct.use_template(self.templates[kw])
+ ct = cmdutil.changeset_templater(self.ui, self.repo,
+ False, None, '', False)
+ ct.use_template(self.templates[kw])
self.ui.pushbuffer()
- self.ct.show(ctx, root=self.repo.root, file=path)
+ ct.show(ctx, root=self.repo.root, file=path)
ekw = templatefilters.firstline(self.ui.popbuffer())
return '$%s: %s $' % (kw, ekw)
return subfunc(kwsub, data)
@@ -322,11 +322,7 @@
uisetup(ui)
reposetup(ui, repo)
- for k, v in ui.configitems('extensions'):
- if k.endswith('keyword'):
- extension = '%s = %s' % (k, v)
- break
- ui.write('[extensions]\n%s\n' % extension)
+ ui.write('[extensions]\nkeyword =\n')
demoitems('keyword', ui.configitems('keyword'))
demoitems('keywordmaps', kwmaps.iteritems())
keywords = '$' + '$\n$'.join(sorted(kwmaps.keys())) + '$\n'
@@ -469,6 +465,7 @@
def kwcommitctx(self, ctx, error=False):
n = super(kwrepo, self).commitctx(ctx, error)
+ # no lock needed, only called from repo.commit() which already locks
kwt.overwrite(n, True, None)
return n
--- a/tests/test-keyword.out Mon Apr 12 17:21:30 2010 -0700
+++ b/tests/test-keyword.out Tue Apr 13 10:13:41 2010 +0200
@@ -1,6 +1,6 @@
% hg kwdemo
[extensions]
-keyword =
+keyword =
[keyword]
demo.txt =
[keywordmaps]
@@ -21,7 +21,7 @@
$Revision: xxxxxxxxxxxx $
$Source: /TMP/demo.txt,v $
[extensions]
-keyword =
+keyword =
[keyword]
demo.txt =
[keywordmaps]
@@ -206,7 +206,7 @@
% custom keyword expansion
% try with kwdemo
[extensions]
-keyword =
+keyword =
[keyword]
* =
b = ignore