##// END OF EJS Templates
keyword: obtain kwtemplater instance via repository at runtime...
FUJIWARA Katsunori -
r33069:ed92a496 default
parent child Browse files
Show More
@@ -676,25 +676,31 b' def reposetup(ui, repo):'
676 # shrink keywords read from working dir
676 # shrink keywords read from working dir
677 self.lines = kwt.shrinklines(self.fname, self.lines)
677 self.lines = kwt.shrinklines(self.fname, self.lines)
678
678
679 def kwdiff(orig, *args, **kwargs):
679 def kwdiff(orig, repo, *args, **kwargs):
680 '''Monkeypatch patch.diff to avoid expansion.'''
680 '''Monkeypatch patch.diff to avoid expansion.'''
681 restrict = kwt.restrict
681 kwt = getattr(repo, '_keywordkwt', None)
682 kwt.restrict = True
682 if kwt:
683 restrict = kwt.restrict
684 kwt.restrict = True
683 try:
685 try:
684 for chunk in orig(*args, **kwargs):
686 for chunk in orig(repo, *args, **kwargs):
685 yield chunk
687 yield chunk
686 finally:
688 finally:
687 kwt.restrict = restrict
689 if kwt:
690 kwt.restrict = restrict
688
691
689 def kwweb_skip(orig, web, req, tmpl):
692 def kwweb_skip(orig, web, req, tmpl):
690 '''Wraps webcommands.x turning off keyword expansion.'''
693 '''Wraps webcommands.x turning off keyword expansion.'''
691 origmatch = kwt.match
694 kwt = getattr(web.repo, '_keywordkwt', None)
692 kwt.match = util.never
695 if kwt:
696 origmatch = kwt.match
697 kwt.match = util.never
693 try:
698 try:
694 for chunk in orig(web, req, tmpl):
699 for chunk in orig(web, req, tmpl):
695 yield chunk
700 yield chunk
696 finally:
701 finally:
697 kwt.match = origmatch
702 if kwt:
703 kwt.match = origmatch
698
704
699 def kw_amend(orig, ui, repo, commitfunc, old, extra, pats, opts):
705 def kw_amend(orig, ui, repo, commitfunc, old, extra, pats, opts):
700 '''Wraps cmdutil.amend expanding keywords after amend.'''
706 '''Wraps cmdutil.amend expanding keywords after amend.'''
General Comments 0
You need to be logged in to leave comments. Login now