keyword: use _keywordkwt of repository instead of kwtools['templater']
Now, kwtemplater instance can be obtained via _keywordkwt property of
repository.
--- a/hgext/keyword.py Mon Jun 26 03:44:50 2017 +0900
+++ b/hgext/keyword.py Mon Jun 26 03:46:17 2017 +0900
@@ -165,7 +165,7 @@
return util.datestr((util.parsedate(text)[0], 0), '%Y-%m-%d %H:%M:%SZ')
# make keyword tools accessible
-kwtools = {'templater': None, 'hgcmd': ''}
+kwtools = {'hgcmd': ''}
def _defaultkwmaps(ui):
'''Returns default keywordmaps according to keywordset configuration.'''
@@ -385,7 +385,7 @@
wctx = repo[None]
if len(wctx.parents()) > 1:
raise error.Abort(_('outstanding uncommitted merge'))
- kwt = kwtools['templater']
+ kwt = getattr(repo, '_keywordkwt', None)
with repo.wlock():
status = _status(ui, repo, wctx, kwt, *pats, **opts)
if status.modified or status.added or status.removed or status.deleted:
@@ -529,7 +529,7 @@
I = ignored
i = ignored (not tracked)
'''
- kwt = kwtools['templater']
+ kwt = getattr(repo, '_keywordkwt', None)
wctx = repo[None]
status = _status(ui, repo, wctx, kwt, *pats, **opts)
if pats:
@@ -614,7 +614,7 @@
if not inc:
return
- kwtools['templater'] = kwt = kwtemplater(ui, repo, inc, exc)
+ kwt = kwtemplater(ui, repo, inc, exc)
class kwrepo(repo.__class__):
def file(self, f):