aboutsummaryrefslogtreecommitdiff
path: root/pre-upload.py
diff options
context:
space:
mode:
authorLuis Hector Chavez <lhchavez@google.com>2016-11-30 17:01:36 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-11-30 17:01:36 +0000
commit1265b558b74f18572411d3233578701b336ed1d3 (patch)
treef30e423be69544b353f9c115da8b862bb9551600 /pre-upload.py
parentbee1fea3b2d821c01d81f576dd0e54b7d77a8d51 (diff)
parentf6ce62d673ebcca99719422380e94f68ce085a6b (diff)
downloadrepohooks-1265b558b74f18572411d3233578701b336ed1d3.tar.gz
Add more environment variables am: e9db4ebaf5
am: f6ce62d673 Change-Id: I48baaccd5d7178624561f6c54461ee8c95c11de2
Diffstat (limited to 'pre-upload.py')
-rwxr-xr-xpre-upload.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pre-upload.py b/pre-upload.py
index f15a9b7..447b8bf 100755
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -205,14 +205,17 @@ def _run_project_hooks(project_name, proj_dir=None,
# Set up the environment like repo would with the forall command.
try:
remote = rh.git.get_upstream_remote()
+ upstream_branch = rh.git.get_upstream_branch()
except rh.utils.RunCommandError as e:
print('upstream remote cannot be found: %s' % (e,), file=sys.stderr)
print('Did you run repo start?', file=sys.stderr)
sys.exit(1)
os.environ.update({
- 'REPO_PROJECT': project_name,
+ 'REPO_LREV': rh.git.get_commit_for_ref(upstream_branch),
'REPO_PATH': proj_dir,
+ 'REPO_PROJECT': project_name,
'REPO_REMOTE': remote,
+ 'REPO_RREV': rh.git.get_remote_revision(upstream_branch, remote),
})
output = Output(project_name, len(hooks))