| OLD | NEW |
| 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 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 ] | 802 ] |
| 803 else: | 803 else: |
| 804 ref_to_push = 'HEAD' | 804 ref_to_push = 'HEAD' |
| 805 | 805 |
| 806 calls += [ | 806 calls += [ |
| 807 ((['git', 'rev-list', | 807 ((['git', 'rev-list', |
| 808 expected_upstream_ref + '..' + ref_to_push],), ''), | 808 expected_upstream_ref + '..' + ref_to_push],), ''), |
| 809 ((['git', 'config', 'rietveld.cc'],), '') | 809 ((['git', 'config', 'rietveld.cc'],), '') |
| 810 ] | 810 ] |
| 811 # Add cc from watch list. | 811 # Add cc from watch list. |
| 812 if ref_suffix == '': | 812 # TODO(tandrii): bring this back after http://crbug.com/604377. |
| 813 ref_suffix = '%cc=joe@example.com' | 813 # if ref_suffix == '': |
| 814 else: | 814 # ref_suffix = '%cc=joe@example.com' |
| 815 ref_suffix += ',cc=joe@example.com' | 815 # else: |
| 816 # ref_suffix += ',cc=joe@example.com' |
| 816 if reviewers: | 817 if reviewers: |
| 817 ref_suffix += ',' + ','.join('r=%s' % email | 818 if ref_suffix: |
| 818 for email in sorted(reviewers)) | 819 ref_suffix += ',' |
| 820 else: |
| 821 ref_suffix = '%' |
| 822 ref_suffix += ','.join('r=%s' % email for email in sorted(reviewers)) |
| 819 calls += [ | 823 calls += [ |
| 820 ((['git', 'push', 'origin', | 824 ((['git', 'push', 'origin', |
| 821 ref_to_push + ':refs/for/refs/heads/master' + ref_suffix],), | 825 ref_to_push + ':refs/for/refs/heads/master' + ref_suffix],), |
| 822 ('remote:\n' | 826 ('remote:\n' |
| 823 'remote: Processing changes: (\)\n' | 827 'remote: Processing changes: (\)\n' |
| 824 'remote: Processing changes: (|)\n' | 828 'remote: Processing changes: (|)\n' |
| 825 'remote: Processing changes: (/)\n' | 829 'remote: Processing changes: (/)\n' |
| 826 'remote: Processing changes: (-)\n' | 830 'remote: Processing changes: (-)\n' |
| 827 'remote: Processing changes: new: 1 (/)\n' | 831 'remote: Processing changes: new: 1 (/)\n' |
| 828 'remote: Processing changes: new: 1, done\n' | 832 'remote: Processing changes: new: 1, done\n' |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1375 # TODO(tandrii): consider testing just set-commit and set-commit --clear, | 1379 # TODO(tandrii): consider testing just set-commit and set-commit --clear, |
| 1376 # but without copy-pasting tons of expectations, as modifying them later is | 1380 # but without copy-pasting tons of expectations, as modifying them later is |
| 1377 # super tedious. | 1381 # super tedious. |
| 1378 self.assertEqual(0, git_cl.main(['set-commit', '-d'])) | 1382 self.assertEqual(0, git_cl.main(['set-commit', '-d'])) |
| 1379 | 1383 |
| 1380 | 1384 |
| 1381 if __name__ == '__main__': | 1385 if __name__ == '__main__': |
| 1382 git_cl.logging.basicConfig( | 1386 git_cl.logging.basicConfig( |
| 1383 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) | 1387 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) |
| 1384 unittest.main() | 1388 unittest.main() |
| OLD | NEW |