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

Side by Side Diff: tests/git_cl_test.py

Issue 259523006: Warn before uploading more than one commit to Gerrit. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: review 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 | « 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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 ((['git', 'log', '--pretty=format:%s\n\n%b', 581 ((['git', 'log', '--pretty=format:%s\n\n%b',
582 'fake_ancestor_sha..HEAD'],), 582 'fake_ancestor_sha..HEAD'],),
583 description), 583 description),
584 ((['git', 'commit', '--amend', '-m', description],), 584 ((['git', 'commit', '--amend', '-m', description],),
585 ''), 585 ''),
586 ((['git', 'log', '--pretty=format:%s\n\n%b', 586 ((['git', 'log', '--pretty=format:%s\n\n%b',
587 'fake_ancestor_sha..HEAD'],), 587 'fake_ancestor_sha..HEAD'],),
588 description) 588 description)
589 ] 589 ]
590 calls += [ 590 calls += [
591 ((['git', 'rev-list', 'origin/master...'],), ''),
591 ((['git', 'config', 'rietveld.cc'],), '') 592 ((['git', 'config', 'rietveld.cc'],), '')
592 ] 593 ]
593 receive_pack = '--receive-pack=git receive-pack ' 594 receive_pack = '--receive-pack=git receive-pack '
594 receive_pack += '--cc=joe@example.com' # from watch list 595 receive_pack += '--cc=joe@example.com' # from watch list
595 if reviewers: 596 if reviewers:
596 receive_pack += ' ' 597 receive_pack += ' '
597 receive_pack += ' '.join( 598 receive_pack += ' '.join(
598 '--reviewer=' + email for email in sorted(reviewers)) 599 '--reviewer=' + email for email in sorted(reviewers))
599 receive_pack += '' 600 receive_pack += ''
600 calls += [ 601 calls += [
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 obj = git_cl.ChangeDescription(orig) 745 obj = git_cl.ChangeDescription(orig)
745 obj.update_reviewers(reviewers) 746 obj.update_reviewers(reviewers)
746 actual.append(obj.description) 747 actual.append(obj.description)
747 self.assertEqual(expected, actual) 748 self.assertEqual(expected, actual)
748 749
749 750
750 if __name__ == '__main__': 751 if __name__ == '__main__':
751 git_cl.logging.basicConfig( 752 git_cl.logging.basicConfig(
752 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) 753 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR)
753 unittest.main() 754 unittest.main()
OLDNEW
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698