aboutsummaryrefslogtreecommitdiff
path: root/update.py
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2015-06-11 15:03:53 -0700
committerChris Craik <ccraik@google.com>2015-06-11 15:08:56 -0700
commit51b7635d74da5aef951ff03a3469a0b7042a8651 (patch)
tree93abee534efa2678ecd69b6eb3e34476e08b1bad /update.py
parent55c80b6889bac37298d129ba81c5368e226cee51 (diff)
downloadchromium-trace-51b7635d74da5aef951ff03a3469a0b7042a8651.tar.gz
Fix generation of UPSTREAM_REVISION
Was previously recording sha of chromium-trace's HEAD, instead of upstream. Change-Id: I58189205bfcdd5fdba44b0950d5530ad88cfa700
Diffstat (limited to 'update.py')
-rwxr-xr-xupdate.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/update.py b/update.py
index abcad9ed..8a660666 100755
--- a/update.py
+++ b/update.py
@@ -28,17 +28,21 @@ if options.local_dir is None:
if p.wait() != 0:
print 'Failed to checkout source from upstream git.'
sys.exit(1)
-
- shutil.rmtree(os.path.join(trace_viewer_dir, '.git'), True)
+ trace_viewer_git_dir = os.path.join(trace_viewer_dir, '.git')
# Update the UPSTREAM_REVISION file
git_args = ['git', 'rev-parse', 'HEAD']
- p = subprocess.Popen(git_args, stdout=subprocess.PIPE, cwd=trace_viewer_dir)
+ p = subprocess.Popen(git_args,
+ stdout=subprocess.PIPE,
+ cwd=trace_viewer_dir,
+ env={"GIT_DIR":trace_viewer_git_dir})
out, err = p.communicate()
if p.wait() != 0:
print 'Failed to get revision.'
sys.exit(1)
+ shutil.rmtree(trace_viewer_git_dir, True)
+
rev = out.strip()
with open('UPSTREAM_REVISION', 'wt') as f:
f.write(rev + '\n')