hgkw/keyword.py
changeset 394 fe13fe09ba2e
parent 391 d3f114c111ff
child 395 9c51c755118b
equal deleted inserted replaced
393:49bc08b63eb3 394:fe13fe09ba2e
    82 
    82 
    83 from mercurial import commands, cmdutil, context, dispatch, filelog, revlog
    83 from mercurial import commands, cmdutil, context, dispatch, filelog, revlog
    84 from mercurial import patch, localrepo, templater, templatefilters, util
    84 from mercurial import patch, localrepo, templater, templatefilters, util
    85 from mercurial.node import *
    85 from mercurial.node import *
    86 from mercurial.i18n import _
    86 from mercurial.i18n import _
    87 import re, shutil, tempfile, time, os
    87 import re, shutil, tempfile, time
    88 
    88 
    89 commands.optionalrepo += ' kwdemo'
    89 commands.optionalrepo += ' kwdemo'
    90 
    90 
    91 # hg commands that do not act on keywords
    91 # hg commands that do not act on keywords
    92 nokwcommands = ('add addremove bundle copy export grep identify incoming init'
    92 nokwcommands = ('add addremove bundle copy export grep identify incoming init'
   425     global _kwtemplater
   425     global _kwtemplater
   426     hgcmd, hgcmdopts = _cmd, _cmdoptions
   426     hgcmd, hgcmdopts = _cmd, _cmdoptions
   427 
   427 
   428     try:
   428     try:
   429         if (not repo.local() or hgcmd in nokwcommands.split() 
   429         if (not repo.local() or hgcmd in nokwcommands.split() 
   430             or '.hg' in repo.root.split(os.sep)
   430             or '.hg' in util.splitpath(repo.root)
   431             or repo._url.startswith('bundle:')):
   431             or repo._url.startswith('bundle:')):
   432             return
   432             return
   433     except AttributeError:
   433     except AttributeError:
   434         pass
   434         pass
   435 
   435