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

Side by Side Diff: tests/git_cl_test.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 | « 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 ((['git', 'log', '--pretty=format:%s\n\n%b', 582 ((['git', 'log', '--pretty=format:%s\n\n%b',
583 'fake_ancestor_sha..HEAD'],), 583 'fake_ancestor_sha..HEAD'],),
584 description), 584 description),
585 ((['git', 'commit', '--amend', '-m', description],), 585 ((['git', 'commit', '--amend', '-m', description],),
586 ''), 586 ''),
587 ((['git', 'log', '--pretty=format:%s\n\n%b', 587 ((['git', 'log', '--pretty=format:%s\n\n%b',
588 'fake_ancestor_sha..HEAD'],), 588 'fake_ancestor_sha..HEAD'],),
589 description) 589 description)
590 ] 590 ]
591 calls += [ 591 calls += [
592 ((['git', 'rev-list', 'origin/master...'],), ''), 592 ((['git', 'rev-list', 'origin/master..'],), ''),
593 ((['git', 'config', 'rietveld.cc'],), '') 593 ((['git', 'config', 'rietveld.cc'],), '')
594 ] 594 ]
595 receive_pack = '--receive-pack=git receive-pack ' 595 receive_pack = '--receive-pack=git receive-pack '
596 receive_pack += '--cc=joe@example.com' # from watch list 596 receive_pack += '--cc=joe@example.com' # from watch list
597 if reviewers: 597 if reviewers:
598 receive_pack += ' ' 598 receive_pack += ' '
599 receive_pack += ' '.join( 599 receive_pack += ' '.join(
600 '--reviewer=' + email for email in sorted(reviewers)) 600 '--reviewer=' + email for email in sorted(reviewers))
601 receive_pack += '' 601 receive_pack += ''
602 calls += [ 602 calls += [
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 obj = git_cl.ChangeDescription(orig) 746 obj = git_cl.ChangeDescription(orig)
747 obj.update_reviewers(reviewers) 747 obj.update_reviewers(reviewers)
748 actual.append(obj.description) 748 actual.append(obj.description)
749 self.assertEqual(expected, actual) 749 self.assertEqual(expected, actual)
750 750
751 751
752 if __name__ == '__main__': 752 if __name__ == '__main__':
753 git_cl.logging.basicConfig( 753 git_cl.logging.basicConfig(
754 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) 754 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR)
755 unittest.main() 755 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