cef/tools/revision.py
Marshall Greenblatt e24a6b02af Fix revision.py detection of git checkouts
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1329 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2013-07-22 22:23:54 +00:00

23 lines
618 B
Python

# 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
import os
import sys
# cannot be loaded as a module
if __name__ != "__main__":
sys.stderr.write('This file cannot be loaded as a module!')
sys.exit()
if os.path.exists(os.path.join('.', '.svn')):
sys.stdout.write(svn.get_revision())
elif os.path.exists(os.path.join('.', '.git')):
sys.stdout.write(git.get_svn_revision())
else:
raise Exception('Not a valid checkout')