changeset 33082:735218be6122

keyword: use _keywordkwt of repository instead of kwtools['templater'] Now, kwtemplater instance can be obtained via _keywordkwt property of repository.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Mon, 26 Jun 2017 03:46:17 +0900
parents ed92a4960874
children 279c072a5c49
files hgext/keyword.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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):