diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-02-20 19:43:30 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-02-20 19:43:30 +0400 |
commit | 28f3cc3eb7026ef931732c332879bbbe81d9bc3b (patch) | |
tree | 703fbe04cad9a1f263ea91d61cb730c80c935ebf /build_files/scons/tools/Blender.py | |
parent | 4789793f0903fe0ce9daa30c013a4fccf4971e89 (diff) |
Fixes for buildinfo hash/branch detection
Branch name and hash didn't work properly when having disconnected
HEAD or when having current HEAD below upstream.
Diffstat (limited to 'build_files/scons/tools/Blender.py')
-rw-r--r-- | build_files/scons/tools/Blender.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index 2c2940a51fb..9fa76c0bf1a 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -426,9 +426,18 @@ def buildinfo(lenv, build_type): build_hash = build_hash.strip() build_branch = os.popen('git rev-parse --abbrev-ref HEAD').read().strip() + if build_branch == 'HEAD': + master_check = os.popen('git branch --list master --contains ' + build_hash).read().strip() + if master_check == 'master': + build_branch = 'master' + if build_hash == '': build_hash = os.popen('git rev-parse --short HEAD').read().strip() no_upstream = True + else: + older_commits = os.popen('git log --oneline HEAD..@{u}').read().strip() + if older_commits: + build_hash = os.popen('git rev-parse --short HEAD').read().strip() # ## Check for local modifications has_local_changes = False @@ -440,7 +449,7 @@ def buildinfo(lenv, build_type): if changed_files: has_local_changes = True elif no_upstream == False: - unpushed_log = os.popen('git log @{u}..').read().strip() + unpushed_log = os.popen('git log --oneline @{u}..').read().strip() has_local_changes = unpushed_log != '' if has_local_changes: |