Show More
@@ -115,6 +115,16 b' def _kwpatchfile_init(self, ui, fname, m' | |||||
115 | kwshrunk = _kwtemplater.shrink(''.join(self.lines)) |
|
115 | kwshrunk = _kwtemplater.shrink(''.join(self.lines)) | |
116 | self.lines = kwshrunk.splitlines(True) |
|
116 | self.lines = kwshrunk.splitlines(True) | |
117 |
|
117 | |||
|
118 | def _kwweb_changeset(web, req, tmpl): | |||
|
119 | '''Wraps webcommands.changeset turning off keyword expansion.''' | |||
|
120 | _kwtemplater.matcher = util.never | |||
|
121 | return web.changeset(tmpl, web.changectx(req)) | |||
|
122 | ||||
|
123 | def _kwweb_filediff(web, req, tmpl): | |||
|
124 | '''Wraps webcommands.filediff turning off keyword expansion.''' | |||
|
125 | _kwtemplater.matcher = util.never | |||
|
126 | return web.filediff(tmpl, web.filectx(req)) | |||
|
127 | ||||
118 | def _kwdispatch_parse(ui, args): |
|
128 | def _kwdispatch_parse(ui, args): | |
119 | '''Monkeypatch dispatch._parse to obtain |
|
129 | '''Monkeypatch dispatch._parse to obtain | |
120 | current command and command options (global _cmd, _cmdoptions).''' |
|
130 | current command and command options (global _cmd, _cmdoptions).''' | |
@@ -122,23 +132,8 b' def _kwdispatch_parse(ui, args):' | |||||
122 | _cmd, func, args, options, _cmdoptions = _dispatch_parse(ui, args) |
|
132 | _cmd, func, args, options, _cmdoptions = _dispatch_parse(ui, args) | |
123 | return _cmd, func, args, options, _cmdoptions |
|
133 | return _cmd, func, args, options, _cmdoptions | |
124 |
|
134 | |||
125 | def kwweb_changeset(web, req, tmpl): |
|
135 | # dispatch._parse is run before reposetup, so wrap it here | |
126 | try: |
|
|||
127 | _kwtemplater.matcher = util.never |
|
|||
128 | except AttributeError: |
|
|||
129 | pass |
|
|||
130 | return web.changeset(tmpl, web.changectx(req)) |
|
|||
131 |
|
||||
132 | def kwweb_filediff(web, req, tmpl): |
|
|||
133 | try: |
|
|||
134 | _kwtemplater.matcher = util.never |
|
|||
135 | except AttributeError: |
|
|||
136 | pass |
|
|||
137 | return web.filediff(tmpl, web.filectx(req)) |
|
|||
138 |
|
||||
139 | dispatch._parse = _kwdispatch_parse |
|
136 | dispatch._parse = _kwdispatch_parse | |
140 | webcommands.changeset = webcommands.rev = kwweb_changeset |
|
|||
141 | webcommands.filediff = webcommands.diff = kwweb_filediff |
|
|||
142 |
|
137 | |||
143 |
|
138 | |||
144 | class kwtemplater(object): |
|
139 | class kwtemplater(object): | |
@@ -527,6 +522,8 b' def reposetup(ui, repo):' | |||||
527 |
|
522 | |||
528 | repo.__class__ = kwrepo |
|
523 | repo.__class__ = kwrepo | |
529 | patch.patchfile.__init__ = _kwpatchfile_init |
|
524 | patch.patchfile.__init__ = _kwpatchfile_init | |
|
525 | webcommands.changeset = webcommands.rev = _kwweb_changeset | |||
|
526 | webcommands.filediff = webcommands.diff = _kwweb_filediff | |||
530 |
|
527 | |||
531 |
|
528 | |||
532 | cmdtable = { |
|
529 | cmdtable = { |
General Comments 0
You need to be logged in to leave comments.
Login now