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

Side by Side Diff: git_cl.py

Issue 284113005: Use `git rev-list A..B` to get the list of commits to be uploaded to Gerrit by git cl. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years, 7 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 datetime 10 import datetime
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 branch = options.target_branch 1503 branch = options.target_branch
1504 1504
1505 change_desc = ChangeDescription( 1505 change_desc = ChangeDescription(
1506 options.message or CreateDescriptionFromLog(args)) 1506 options.message or CreateDescriptionFromLog(args))
1507 if not change_desc.description: 1507 if not change_desc.description:
1508 print "Description is empty; aborting." 1508 print "Description is empty; aborting."
1509 return 1 1509 return 1
1510 if CHANGE_ID not in change_desc.description: 1510 if CHANGE_ID not in change_desc.description:
1511 AddChangeIdToCommitMessage(options, args) 1511 AddChangeIdToCommitMessage(options, args)
1512 1512
1513 commits = RunGit(['rev-list', '%s/%s...' % (remote, branch)]).splitlines() 1513 commits = RunGit(['rev-list', '%s/%s..' % (remote, branch)]).splitlines()
1514 if len(commits) > 1: 1514 if len(commits) > 1:
1515 print('WARNING: This will upload %d commits. Run the following command ' 1515 print('WARNING: This will upload %d commits. Run the following command '
1516 'to see which commits will be uploaded: ' % len(commits)) 1516 'to see which commits will be uploaded: ' % len(commits))
1517 print('git log %s/%s...' % (remote, branch)) 1517 print('git log %s/%s..' % (remote, branch))
1518 print('You can also use `git squash-branch` to squash these into a single' 1518 print('You can also use `git squash-branch` to squash these into a single'
1519 'commit.') 1519 'commit.')
1520 ask_for_data('About to upload; enter to confirm.') 1520 ask_for_data('About to upload; enter to confirm.')
1521 1521
1522 if options.reviewers: 1522 if options.reviewers:
1523 change_desc.update_reviewers(options.reviewers) 1523 change_desc.update_reviewers(options.reviewers)
1524 1524
1525 receive_options = [] 1525 receive_options = []
1526 cc = cl.GetCCList().split(',') 1526 cc = cl.GetCCList().split(',')
1527 if options.cc: 1527 if options.cc:
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
2612 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' 2612 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith '
2613 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) 2613 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)))
2614 2614
2615 2615
2616 if __name__ == '__main__': 2616 if __name__ == '__main__':
2617 # These affect sys.stdout so do it outside of main() to simplify mocks in 2617 # These affect sys.stdout so do it outside of main() to simplify mocks in
2618 # unit testing. 2618 # unit testing.
2619 fix_encoding.fix_encoding() 2619 fix_encoding.fix_encoding()
2620 colorama.init() 2620 colorama.init()
2621 sys.exit(main(sys.argv[1:])) 2621 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