comparison hgext/keyword.py @ 6069:212bfb5c50e1

keyword: avoid os import by using util.splitpath
author Christian Ebert <blacktrash@gmx.net>
date Sat, 09 Feb 2008 22:37:51 +0100
parents e4d74100d41b
children 5fd126d1adf8
comparison
equal deleted inserted replaced
6068:ea33f695304a 6069:212bfb5c50e1
80 80
81 from mercurial import commands, cmdutil, context, dispatch, filelog, revlog 81 from mercurial import commands, cmdutil, context, dispatch, filelog, revlog
82 from mercurial import patch, localrepo, templater, templatefilters, util 82 from mercurial import patch, localrepo, templater, templatefilters, util
83 from mercurial.node import * 83 from mercurial.node import *
84 from mercurial.i18n import _ 84 from mercurial.i18n import _
85 import re, shutil, tempfile, time, os 85 import re, shutil, tempfile, time
86 86
87 commands.optionalrepo += ' kwdemo' 87 commands.optionalrepo += ' kwdemo'
88 88
89 # hg commands that do not act on keywords 89 # hg commands that do not act on keywords
90 nokwcommands = ('add addremove bundle copy export grep identify incoming init' 90 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(os.sep) 428 or '.hg' in util.splitpath(repo.root)
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