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

Side by Side Diff: git_cl.py

Issue 12388027: git cl upload now diffs HEAD rather than working tree (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # Copyright (C) 2008 Evan Martin <martine@danga.com> 6 # Copyright (C) 2008 Evan Martin <martine@danga.com>
7 7
8 """A git-command for integrating reviews on Rietveld.""" 8 """A git-command for integrating reviews on Rietveld."""
9 9
10 import json 10 import json
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 if is_dirty_git_tree('upload'): 1265 if is_dirty_git_tree('upload'):
1266 return 1 1266 return 1
1267 1267
1268 cl = Changelist() 1268 cl = Changelist()
1269 if args: 1269 if args:
1270 # TODO(ukai): is it ok for gerrit case? 1270 # TODO(ukai): is it ok for gerrit case?
1271 base_branch = args[0] 1271 base_branch = args[0]
1272 else: 1272 else:
1273 # Default to diffing against common ancestor of upstream branch 1273 # Default to diffing against common ancestor of upstream branch
1274 base_branch = RunGit(['merge-base', cl.GetUpstreamBranch(), 'HEAD']).strip() 1274 base_branch = RunGit(['merge-base', cl.GetUpstreamBranch(), 'HEAD']).strip()
1275 args = [base_branch] 1275 args = [base_branch, 'HEAD']
1276 1276
1277 if not options.bypass_hooks: 1277 if not options.bypass_hooks:
1278 hook_results = cl.RunHook(committing=False, upstream_branch=base_branch, 1278 hook_results = cl.RunHook(committing=False, upstream_branch=base_branch,
1279 may_prompt=not options.force, 1279 may_prompt=not options.force,
1280 verbose=options.verbose, 1280 verbose=options.verbose,
1281 author=None) 1281 author=None)
1282 if not hook_results.should_continue(): 1282 if not hook_results.should_continue():
1283 return 1 1283 return 1
1284 if not options.reviewers and hook_results.reviewers: 1284 if not options.reviewers and hook_results.reviewers:
1285 options.reviewers = hook_results.reviewers 1285 options.reviewers = hook_results.reviewers
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
1883 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) 1883 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)))
1884 1884
1885 # Not a known command. Default to help. 1885 # Not a known command. Default to help.
1886 GenUsage(parser, 'help') 1886 GenUsage(parser, 'help')
1887 return CMDhelp(parser, argv) 1887 return CMDhelp(parser, argv)
1888 1888
1889 1889
1890 if __name__ == '__main__': 1890 if __name__ == '__main__':
1891 fix_encoding.fix_encoding() 1891 fix_encoding.fix_encoding()
1892 sys.exit(main(sys.argv[1:])) 1892 sys.exit(main(sys.argv[1:]))
OLDNEW
« 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