Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/luajit-rocks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/fetch/hg.lua')
-rw-r--r--src/luarocks/fetch/hg.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/luarocks/fetch/hg.lua b/src/luarocks/fetch/hg.lua
index b2ba56e..518130b 100644
--- a/src/luarocks/fetch/hg.lua
+++ b/src/luarocks/fetch/hg.lua
@@ -21,16 +21,21 @@ function hg.get_sources(rockspec, extract, dest_dir)
assert(type(dest_dir) == "string" or not dest_dir)
local hg_cmd = rockspec.variables.HG
+ local ok, err_msg = fs.is_tool_available(hg_cmd, "Mercurial")
+ if not ok then
+ return nil, err_msg
+ end
+
local name_version = rockspec.name .. "-" .. rockspec.version
-- Strip off special hg:// protocol type
- local url = rockspec.source.url:gsub("^hg://", "")
+ local url = rockspec.source.url:gsub("^hg://", "")
local module = dir.base_name(url)
local command = {hg_cmd, "clone", url, module}
local tag_or_branch = rockspec.source.tag or rockspec.source.branch
if tag_or_branch then
- command = {hg_cmd, "clone", "--rev", url, module}
+ command = {hg_cmd, "clone", "--rev", tag_or_branch, url, module}
end
local store_dir
if not dest_dir then