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

Side by Side Diff: tests/git_cl_test.py

Issue 1885883002: Gerrit git cl upload: implement setting cc and reviewers. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@R400
Patch Set: Created 4 years, 8 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
« git_cl.py ('K') | « git_cl.py ('k') | no next file » | 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 """Unit tests for git_cl.py.""" 6 """Unit tests for git_cl.py."""
7 7
8 import os 8 import os
9 import StringIO 9 import StringIO
10 import stat 10 import stat
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 ref_to_push), 794 ref_to_push),
795 ] 795 ]
796 else: 796 else:
797 ref_to_push = 'HEAD' 797 ref_to_push = 'HEAD'
798 798
799 calls += [ 799 calls += [
800 ((['git', 'rev-list', 800 ((['git', 'rev-list',
801 expected_upstream_ref + '..' + ref_to_push],), ''), 801 expected_upstream_ref + '..' + ref_to_push],), ''),
802 ((['git', 'config', 'rietveld.cc'],), '') 802 ((['git', 'config', 'rietveld.cc'],), '')
803 ] 803 ]
804 receive_pack = '--receive-pack=git receive-pack ' 804 # Add cc from watch list.
805 receive_pack += '--cc=joe@example.com' # from watch list 805 if ref_suffix == '':
806 ref_suffix = '%cc=joe@example.com'
807 else:
808 ref_suffix += ',cc=joe@example.com'
806 if reviewers: 809 if reviewers:
807 receive_pack += ' ' 810 ref_suffix += ',' + ','.join('r=%s' % email for email in sorted(reviewers) )
Bons 2016/04/13 12:44:03 >80chars
808 receive_pack += ' '.join(
809 '--reviewer=' + email for email in sorted(reviewers))
810 receive_pack += ''
811 calls += [ 811 calls += [
812 ((['git', 812 ((['git', 'push', 'origin',
813 'push', receive_pack, 'origin',
814 ref_to_push + ':refs/for/refs/heads/master' + ref_suffix],), 813 ref_to_push + ':refs/for/refs/heads/master' + ref_suffix],),
815 ('remote:\n' 814 ('remote:\n'
816 'remote: Processing changes: (\)\n' 815 'remote: Processing changes: (\)\n'
817 'remote: Processing changes: (|)\n' 816 'remote: Processing changes: (|)\n'
818 'remote: Processing changes: (/)\n' 817 'remote: Processing changes: (/)\n'
819 'remote: Processing changes: (-)\n' 818 'remote: Processing changes: (-)\n'
820 'remote: Processing changes: new: 1 (/)\n' 819 'remote: Processing changes: new: 1 (/)\n'
821 'remote: Processing changes: new: 1, done\n' 820 'remote: Processing changes: new: 1, done\n'
822 'remote:\n' 821 'remote:\n'
823 'remote: New Changes:\n' 822 'remote: New Changes:\n'
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 'chromium.googlesource.com': 'same', 1297 'chromium.googlesource.com': 'same',
1299 'chromium-review.googlesource.com': 'same', 1298 'chromium-review.googlesource.com': 'same',
1300 }) 1299 })
1301 self.assertIsNone(cl.EnsureAuthenticated(force=False)) 1300 self.assertIsNone(cl.EnsureAuthenticated(force=False))
1302 1301
1303 1302
1304 if __name__ == '__main__': 1303 if __name__ == '__main__':
1305 git_cl.logging.basicConfig( 1304 git_cl.logging.basicConfig(
1306 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) 1305 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR)
1307 unittest.main() 1306 unittest.main()
OLDNEW
« git_cl.py ('K') | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698