hgkw/keyword.py
branchstable
changeset 463 55f535bc13bc
parent 452 f83dd10a4d24
child 465 2f017ca736ce
equal deleted inserted replaced
454:d2147d34798e 463:55f535bc13bc
    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
   513             kwt.matcher = util.never
   513             kwt.matcher = util.never
   514         elif node1 is not None and node1 != repo.changectx().node():
   514         elif node1 is not None and node1 != repo.changectx().node():
   515             kwt.restrict = True
   515             kwt.restrict = True
   516         patch_diff(repo, node1, node2, match, fp, changes, opts)
   516         patch_diff(repo, node1, node2, match, fp, changes, opts)
   517 
   517 
       
   518     def kwweb_annotate(web, req, tmpl):
       
   519         '''Wraps webcommands.annotate turning off keyword expansion.'''
       
   520         kwt.matcher = util.never
       
   521         return webcommands_annotate(web, req, tmpl)
       
   522 
   518     def kwweb_changeset(web, req, tmpl):
   523     def kwweb_changeset(web, req, tmpl):
   519         '''Wraps webcommands.changeset turning off keyword expansion.'''
   524         '''Wraps webcommands.changeset turning off keyword expansion.'''
   520         kwt.matcher = util.never
   525         kwt.matcher = util.never
   521         return webcommands_changeset(web, req, tmpl)
   526         return webcommands_changeset(web, req, tmpl)
   522 
   527 
   527 
   532 
   528     repo.__class__ = kwrepo
   533     repo.__class__ = kwrepo
   529 
   534 
   530     patchfile_init = patch.patchfile.__init__
   535     patchfile_init = patch.patchfile.__init__
   531     patch_diff = patch.diff
   536     patch_diff = patch.diff
       
   537     webcommands_annotate = webcommands.annotate
   532     webcommands_changeset = webcommands.changeset
   538     webcommands_changeset = webcommands.changeset
   533     webcommands_filediff = webcommands.filediff
   539     webcommands_filediff = webcommands.filediff
   534 
   540 
   535     patch.patchfile.__init__ = kwpatchfile_init
   541     patch.patchfile.__init__ = kwpatchfile_init
   536     patch.diff = kw_diff
   542     patch.diff = kw_diff
       
   543     webcommands.annotate = kwweb_annotate
   537     webcommands.changeset = webcommands.rev = kwweb_changeset
   544     webcommands.changeset = webcommands.rev = kwweb_changeset
   538     webcommands.filediff = webcommands.diff = kwweb_filediff
   545     webcommands.filediff = webcommands.diff = kwweb_filediff
   539 
   546 
   540 
   547 
   541 cmdtable = {
   548 cmdtable = {