diff options
author | Kim Alvefur <zash@zash.se> | 2015-01-21 02:55:23 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-01-21 02:55:23 +0100 |
commit | 7193adf5d5cbc0a0bd0e49488b4590e3dff19ab2 (patch) | |
tree | efb125548723f85830cea640fb2e87b34c87a4a7 /prosodyctl | |
parent | c5cd1e54288930596391572b857461a0ca69dd8f (diff) | |
download | prosody-7193adf5d5cbc0a0bd0e49488b4590e3dff19ab2.tar.gz prosody-7193adf5d5cbc0a0bd0e49488b4590e3dff19ab2.zip |
prosodyctl: Use util.mercurial to identify hg repository and revision
Diffstat (limited to 'prosodyctl')
-rwxr-xr-x | prosodyctl | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |