mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
rename util.find_exe to findexe
This commit is contained in:
parent
511ac574fb
commit
4163cf2e6f
@ -29,7 +29,7 @@ class MissingTool(Exception):
|
||||
|
||||
def checktool(exe, name=None, abort=True):
|
||||
name = name or exe
|
||||
if not util.find_exe(exe):
|
||||
if not util.findexe(exe):
|
||||
exc = abort and util.Abort or MissingTool
|
||||
raise exc(_('cannot find required "%s" tool') % name)
|
||||
|
||||
|
@ -36,10 +36,10 @@ class gnuarch_source(converter_source, commandline):
|
||||
|
||||
# Could use checktool, but we want to check for baz or tla.
|
||||
self.execmd = None
|
||||
if util.find_exe('baz'):
|
||||
if util.findexe('baz'):
|
||||
self.execmd = 'baz'
|
||||
else:
|
||||
if util.find_exe('tla'):
|
||||
if util.findexe('tla'):
|
||||
self.execmd = 'tla'
|
||||
else:
|
||||
raise util.Abort(_('cannot find a GNU Arch tool'))
|
||||
|
@ -1648,7 +1648,7 @@ def debuginstall(ui):
|
||||
# editor
|
||||
ui.status(_("Checking commit editor...\n"))
|
||||
editor = ui.geteditor()
|
||||
cmdpath = util.find_exe(editor) or util.find_exe(editor.split()[0])
|
||||
cmdpath = util.findexe(editor) or util.findexe(editor.split()[0])
|
||||
if not cmdpath:
|
||||
if editor == 'vi':
|
||||
ui.write(_(" No commit editor set and can't find vi in PATH\n"))
|
||||
|
@ -31,10 +31,10 @@ def _findtool(ui, tool):
|
||||
continue
|
||||
p = util.lookupreg(k, _toolstr(ui, tool, "regname"))
|
||||
if p:
|
||||
p = util.find_exe(p + _toolstr(ui, tool, "regappend"))
|
||||
p = util.findexe(p + _toolstr(ui, tool, "regappend"))
|
||||
if p:
|
||||
return p
|
||||
return util.find_exe(_toolstr(ui, tool, "executable", tool))
|
||||
return util.findexe(_toolstr(ui, tool, "executable", tool))
|
||||
|
||||
def _picktool(repo, ui, path, binary, symlink):
|
||||
def check(tool, pat, symlink, binary):
|
||||
|
@ -112,7 +112,7 @@ def validateconfig(ui):
|
||||
raise util.Abort(_('smtp specified as email transport, '
|
||||
'but no smtp host configured'))
|
||||
else:
|
||||
if not util.find_exe(method):
|
||||
if not util.findexe(method):
|
||||
raise util.Abort(_('%r specified as email transport, '
|
||||
'but not in PATH') % method)
|
||||
|
||||
|
@ -221,7 +221,7 @@ def isowner(st):
|
||||
"""Return True if the stat object st is from the current user."""
|
||||
return st.st_uid == os.getuid()
|
||||
|
||||
def find_exe(command):
|
||||
def findexe(command):
|
||||
'''Find executable for command searching like which does.
|
||||
If command is a basename then PATH is searched for command.
|
||||
PATH isn't searched if command is an absolute or relative path.
|
||||
|
@ -319,7 +319,7 @@ def hgexecutable():
|
||||
elif mainfrozen():
|
||||
_sethgexecutable(sys.executable)
|
||||
else:
|
||||
exe = find_exe('hg') or os.path.basename(sys.argv[0])
|
||||
exe = findexe('hg') or os.path.basename(sys.argv[0])
|
||||
_sethgexecutable(exe)
|
||||
return _hgexecutable
|
||||
|
||||
|
@ -163,7 +163,7 @@ def explainexit(code):
|
||||
def isowner(st):
|
||||
return True
|
||||
|
||||
def find_exe(command):
|
||||
def findexe(command):
|
||||
'''Find executable for command searching like cmd.exe does.
|
||||
If command is a basename then PATH is searched for command.
|
||||
PATH isn't searched if command is an absolute or relative path.
|
||||
|
Loading…
Reference in New Issue
Block a user