88 import re, shutil, tempfile, time |
88 import re, shutil, tempfile, time |
89 |
89 |
90 commands.optionalrepo += ' kwdemo' |
90 commands.optionalrepo += ' kwdemo' |
91 |
91 |
92 # hg commands that do not act on keywords |
92 # hg commands that do not act on keywords |
93 nokwcommands = ('add addremove bundle copy export grep incoming init' |
93 nokwcommands = ('add addremove annotate bundle copy export grep incoming init' |
94 ' log outgoing push rename rollback tip' |
94 ' log outgoing push rename rollback tip' |
95 ' convert email glog') |
95 ' convert email glog') |
96 |
96 |
97 # hg commands that trigger expansion only when writing to working dir, |
97 # hg commands that trigger expansion only when writing to working dir, |
98 # not when reading filelog, and unexpand when reading from working dir |
98 # not when reading filelog, and unexpand when reading from working dir |
515 kwt.matcher = util.never |
515 kwt.matcher = util.never |
516 elif node1 is not None and node1 != repo.dirstate.parents()[0]: |
516 elif node1 is not None and node1 != repo.dirstate.parents()[0]: |
517 kwt.restrict = True |
517 kwt.restrict = True |
518 patch_diff(repo, node1, node2, match, fp, changes, opts) |
518 patch_diff(repo, node1, node2, match, fp, changes, opts) |
519 |
519 |
|
520 def kwweb_annotate(web, req, tmpl): |
|
521 '''Wraps webcommands.annotate turning off keyword expansion.''' |
|
522 kwt.matcher = util.never |
|
523 return webcommands_annotate(web, req, tmpl) |
|
524 |
520 def kwweb_changeset(web, req, tmpl): |
525 def kwweb_changeset(web, req, tmpl): |
521 '''Wraps webcommands.changeset turning off keyword expansion.''' |
526 '''Wraps webcommands.changeset turning off keyword expansion.''' |
522 kwt.matcher = util.never |
527 kwt.matcher = util.never |
523 return webcommands_changeset(web, req, tmpl) |
528 return webcommands_changeset(web, req, tmpl) |
524 |
529 |
529 |
534 |
530 repo.__class__ = kwrepo |
535 repo.__class__ = kwrepo |
531 |
536 |
532 patchfile_init = patch.patchfile.__init__ |
537 patchfile_init = patch.patchfile.__init__ |
533 patch_diff = patch.diff |
538 patch_diff = patch.diff |
|
539 webcommands_annotate = webcommands.annotate |
534 webcommands_changeset = webcommands.changeset |
540 webcommands_changeset = webcommands.changeset |
535 webcommands_filediff = webcommands.filediff |
541 webcommands_filediff = webcommands.filediff |
536 |
542 |
537 patch.patchfile.__init__ = kwpatchfile_init |
543 patch.patchfile.__init__ = kwpatchfile_init |
538 patch.diff = kw_diff |
544 patch.diff = kw_diff |
|
545 webcommands.annotate = kwweb_annotate |
539 webcommands.changeset = webcommands.rev = kwweb_changeset |
546 webcommands.changeset = webcommands.rev = kwweb_changeset |
540 webcommands.filediff = webcommands.diff = kwweb_filediff |
547 webcommands.filediff = webcommands.diff = kwweb_filediff |
541 |
548 |
542 |
549 |
543 cmdtable = { |
550 cmdtable = { |