hgkw/keyword.py
branchstable
changeset 390 ee07603fab12
parent 386 c27209bf8385
child 391 d3f114c111ff
equal deleted inserted replaced
389:d18a329bf222 390:ee07603fab12
    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
    87 import re, shutil, tempfile, time, os
    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'
   423     global _kwtemplater
   423     global _kwtemplater
   424     hgcmd, hgcmdopts = _cmd, _cmdoptions
   424     hgcmd, hgcmdopts = _cmd, _cmdoptions
   425 
   425 
   426     try:
   426     try:
   427         if (not repo.local() or hgcmd in nokwcommands.split() 
   427         if (not repo.local() or hgcmd in nokwcommands.split() 
   428             or '.hg' in repo.root.split('/')
   428             or '.hg' in repo.root.split(os.sep)
   429             or repo._url.startswith('bundle:')):
   429             or repo._url.startswith('bundle:')):
   430             return
   430             return
   431     except AttributeError:
   431     except AttributeError:
   432         pass
   432         pass
   433 
   433