##// END OF EJS Templates
keyword: make wrapped repository and kwtemplater refer to each other...
FUJIWARA Katsunori -
r33067:5a51db8b default
parent child Browse files
Show More
@@ -88,6 +88,7 b' from __future__ import absolute_import'
88 88 import os
89 89 import re
90 90 import tempfile
91 import weakref
91 92
92 93 from mercurial.i18n import _
93 94 from mercurial.hgweb import webcommands
@@ -212,7 +213,7 b' class kwtemplater(object):'
212 213
213 214 def __init__(self, ui, repo, inc, exc):
214 215 self.ui = ui
215 self.repo = repo
216 self._repo = weakref.ref(repo)
216 217 self.match = match.match(repo.root, '', [], inc, exc)
217 218 self.restrict = kwtools['hgcmd'] in restricted.split()
218 219 self.postcommit = False
@@ -223,6 +224,10 b' class kwtemplater(object):'
223 224 else:
224 225 self.templates = _defaultkwmaps(self.ui)
225 226
227 @property
228 def repo(self):
229 return self._repo()
230
226 231 @util.propertycache
227 232 def escape(self):
228 233 '''Returns bar-separated and escaped keywords.'''
@@ -658,6 +663,9 b' def reposetup(ui, repo):'
658 663 finally:
659 664 kwt.restrict = origrestrict
660 665
666 repo.__class__ = kwrepo
667 repo._keywordkwt = kwt
668
661 669 # monkeypatches
662 670 def kwpatchfile_init(orig, self, ui, gp, backend, store, eolmode=None):
663 671 '''Monkeypatch/wrap patch.patchfile.__init__ to avoid
@@ -768,4 +776,3 b' def reposetup(ui, repo):'
768 776 extensions.wrapfunction(cmdutil, 'dorecord', kw_dorecord)
769 777 for c in nokwwebcommands.split():
770 778 extensions.wrapfunction(webcommands, c, kwweb_skip)
771 repo.__class__ = kwrepo
General Comments 0
You need to be logged in to leave comments. Login now