Chromium Code Reviews| Index: git_cl.py |
| =================================================================== |
| --- git_cl.py (revision 188159) |
| +++ git_cl.py (working copy) |
| @@ -96,8 +96,11 @@ |
| def git_set_branch_value(key, value): |
| branch = Changelist().GetBranch() |
| if branch: |
|
M-A Ruel
2013/03/17 19:40:31
I think I'd prefer this form instead;
if not bran
Roger Tawa OOO till Jul 10th
2013/03/18 20:40:28
Done.
|
| + cmd = ['config'] |
| + if isinstance(value, int): |
| + cmd.append('--int') |
| git_key = 'branch.%s.%s' % (branch, key) |
| - RunGit(['config', '--int', git_key, "%d" % value]) |
| + RunGit(cmd + [git_key, str(value)]) |
| def git_get_branch_default(key, default): |
| @@ -1288,9 +1291,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. |