aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/git
diff options
context:
space:
mode:
authorGravatar Frank Chen <frankchn@google.com>2018-01-10 11:36:52 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-10 11:49:30 -0800
commitc4ef927b5eaf144dbf1e0419c0d1d3fd968177bd (patch)
treed2c38105bb6b2ac411130396d2633d2f1bc7fa1d /tensorflow/tools/git
parent531b125012320c444d369b9fa7471a697adbe923 (diff)
Merge changes from github.
PiperOrigin-RevId: 181494416
Diffstat (limited to 'tensorflow/tools/git')
-rwxr-xr-xtensorflow/tools/git/gen_git_source.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/tensorflow/tools/git/gen_git_source.py b/tensorflow/tools/git/gen_git_source.py
index f2845c877f..3630dbd740 100755
--- a/tensorflow/tools/git/gen_git_source.py
+++ b/tensorflow/tools/git/gen_git_source.py
@@ -16,7 +16,10 @@
"""Help include git hash in tensorflow bazel build.
This creates symlinks from the internal git repository directory so
-that the build system can see changes in the version state.
+that the build system can see changes in the version state. We also
+remember what branch git was on so when the branch changes we can
+detect that the ref file is no longer correct (so we can suggest users
+run ./configure again).
NOTE: this script is only used in opensource.
@@ -218,14 +221,13 @@ def generate(arglist):
if not data["git"]:
git_version = b"unknown"
else:
- old_branch = data["branch"]
+ old_branch = data["branch"]
new_branch = parse_branch_ref(head_symlink)
if new_branch != old_branch:
- print("Warning, run ./configure again, to get __git_version__ to record "
- "correct version")
- git_version = get_git_version(data["path"])+'-inconsistent-git-version'
- else:
- git_version = get_git_version(data["path"])
+ raise RuntimeError(
+ "Run ./configure again, branch was '%s' but is now '%s'" %
+ (old_branch, new_branch))
+ git_version = get_git_version(data["path"])
write_version_info(dest_file, git_version)