diff --git a/indra/lib/python/indra/util/llversion.py b/indra/lib/python/indra/util/llversion.py index c48ab679f4c62015305588175d2b059c4a61ab9f..2718a85f414cb958db30e8035bf21742583a084b 100644 --- a/indra/lib/python/indra/util/llversion.py +++ b/indra/lib/python/indra/util/llversion.py @@ -103,11 +103,21 @@ def get_hg_repo(): return output def get_hg_changeset(): - status, output = commands.getstatusoutput('hg id -i') + # The right thing to do: + # status, output = commands.getstatusoutput('hg id -i') + # if status: + # print >> sys.stderr, output + # sys.exit(1) + + # The temporary hack: + status, output = commands.getstatusoutput('hg parents --template "{rev}"') if status: print >> sys.stderr, output sys.exit(1) - return output + lines = output.splitlines() + if len(lines) > 1: + print >> sys.stderr, 'ERROR: working directory has %d parents' % len(lines) + return lines[0] def using_svn(): return os.path.isdir(os.path.join(get_src_root(), '.svn'))