diff --git a/tools/revision.py b/tools/revision.py index 1096c12dd..1d946029f 100644 --- a/tools/revision.py +++ b/tools/revision.py @@ -4,6 +4,7 @@ import svn_util as svn import git_util as git +import os import sys # cannot be loaded as a module @@ -11,9 +12,11 @@ if __name__ != "__main__": sys.stderr.write('This file cannot be loaded as a module!') sys.exit() -try: +if os.path.exists(os.path.join('.', '.svn')): sys.stdout.write(svn.get_revision()) -except: +elif os.path.exists(os.path.join('.', '.git')): sys.stdout.write(git.get_svn_revision()) +else: + raise Exception('Not a valid checkout')