aboutsummaryrefslogtreecommitdiffstats
path: root/prosodyctl
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-01-21 02:55:23 +0100
committerKim Alvefur <zash@zash.se>2015-01-21 02:55:23 +0100
commit48869f981a9465b0988f9a07c6bb67d75a614837 (patch)
treeefb125548723f85830cea640fb2e87b34c87a4a7 /prosodyctl
parent0c27e85183dd0b6772df383c4816f39e27b6fdba (diff)
downloadprosody-48869f981a9465b0988f9a07c6bb67d75a614837.tar.gz
prosody-48869f981a9465b0988f9a07c6bb67d75a614837.zip
prosodyctl: Use util.mercurial to identify hg repository and revision
Diffstat (limited to 'prosodyctl')
-rwxr-xr-xprosodyctl5
1 files changed, 4 insertions, 1 deletions
diff --git a/prosodyctl b/prosodyctl
index 60bc0c08..c7daceac 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -251,6 +251,7 @@ require "socket"
function read_version()
-- Try to determine version
local version_file = io.open((CFG_SOURCEDIR or ".").."/prosody.version");
+ prosody.version = "unknown";
if version_file then
prosody.version = version_file:read("*a"):gsub("%s*$", "");
version_file:close();
@@ -258,7 +259,9 @@ function read_version()
prosody.version = "hg:"..prosody.version;
end
else
- prosody.version = "unknown";
+ local hg = require"util.mercurial";
+ local hgid = hg.check_id(CFG_SOURCEDIR or ".");
+ if hgid then prosody.version = "hg:" .. hgid; end
end
end