2012-09-26 02:09:05 +02:00
|
|
|
# Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
|
|
|
|
# reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
# can be found in the LICENSE file.
|
|
|
|
|
|
|
|
import svn_util as svn
|
|
|
|
import git_util as git
|
2013-07-23 00:23:54 +02:00
|
|
|
import os
|
2012-09-26 02:09:05 +02:00
|
|
|
import sys
|
|
|
|
|
|
|
|
# cannot be loaded as a module
|
|
|
|
if __name__ != "__main__":
|
|
|
|
sys.stderr.write('This file cannot be loaded as a module!')
|
|
|
|
sys.exit()
|
|
|
|
|
2013-07-23 00:23:54 +02:00
|
|
|
if os.path.exists(os.path.join('.', '.svn')):
|
2012-09-26 02:09:05 +02:00
|
|
|
sys.stdout.write(svn.get_revision())
|
2013-07-23 00:23:54 +02:00
|
|
|
elif os.path.exists(os.path.join('.', '.git')):
|
2012-09-26 02:09:05 +02:00
|
|
|
sys.stdout.write(git.get_svn_revision())
|
2013-07-23 00:23:54 +02:00
|
|
|
else:
|
|
|
|
raise Exception('Not a valid checkout')
|
2012-09-26 02:09:05 +02:00
|
|
|
|
|
|
|
|