Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: git_cl.py

Issue 12811006: Save the GIT hash of HEAD when uploading to rietveld. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Address review comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
===================================================================
--- git_cl.py (revision 188803)
+++ git_cl.py (working copy)
@@ -95,11 +95,16 @@
def git_set_branch_value(key, value):
branch = Changelist().GetBranch()
- if branch:
- git_key = 'branch.%s.%s' % (branch, key)
- RunGit(['config', '--int', git_key, "%d" % value])
+ if not branch:
+ return
+ cmd = ['config']
+ if isinstance(value, int):
+ cmd.append('--int')
+ git_key = 'branch.%s.%s' % (branch, key)
+ RunGit(cmd + [git_key, str(value)])
+
def git_get_branch_default(key, default):
branch = Changelist().GetBranch()
if branch:
@@ -1288,9 +1293,13 @@
print_stats(options.similarity, options.find_copies, args)
if settings.GetIsGerrit():
return GerritUpload(options, args, cl)
- return RietveldUpload(options, args, cl)
+ ret = RietveldUpload(options, args, cl)
+ if not ret:
+ git_set_branch_value('last-upload-hash', RunGit(['rev-parse', 'HEAD']))
+ return ret
+
def IsSubmoduleMergeCommit(ref):
# When submodules are added to the repo, we expect there to be a single
# non-git-svn merge commit at remote HEAD with a signature comment.
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698