From 3ad6a782816480486d2124088e628418e8901367 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Sat, 14 Jun 2008 04:37:33 +0000 Subject: [PATCH] Show current revision on the 'version' command. Once we go to releases, this will be different, but for now it's informative for developers and early adopters. Assumes they have Subversion installed, otherwise the version is Unknown. --- defines_global.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/defines_global.py b/defines_global.py index 46ea0f61c3..82556493fb 100755 --- a/defines_global.py +++ b/defines_global.py @@ -1,3 +1,5 @@ +import os + # Do not mess with the default types (0-5). This is passed to the Object # model's 'choices' argument. OBJECT_TYPES = ( @@ -37,10 +39,12 @@ NOSET_ATTRIBS = ["MONEY", "ALIAS", "LASTPAGED", "__CHANLIST", "LAST", HIDDEN_ATTRIBS = ["__CHANLIST", "__PARENT"] # Server version number. -REVISION = '$Rev$' +REVISION = os.popen('svnversion .', 'r').readline().strip() +if not REVISION: + REVISION = "UNKNOWN" # Clip out the SVN keyword information -EVENNIA_VERSION = 'Alpha ' + REVISION[6:-2] +EVENNIA_VERSION = 'Alpha ' + REVISION # The message to show when the user lacks permissions for something. NOPERMS_MSG = "You do not have the necessary permissions to do that."