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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
758 @classmethod | 758 @classmethod |
759 def _gerrit_upload_calls(cls, description, reviewers, squash, | 759 def _gerrit_upload_calls(cls, description, reviewers, squash, |
760 expected_upstream_ref='origin/refs/heads/master', | 760 expected_upstream_ref='origin/refs/heads/master', |
761 ref_suffix='', notify=False, | 761 ref_suffix='', notify=False, |
762 post_amend_description=None, issue=None): | 762 post_amend_description=None, issue=None): |
763 if post_amend_description is None: | 763 if post_amend_description is None: |
764 post_amend_description = description | 764 post_amend_description = description |
765 | 765 |
766 calls = [ | 766 calls = [ |
767 ((['git', 'config', '--bool', 'gerrit.squash-uploads'],), 'false'), | 767 ((['git', 'config', '--bool', 'gerrit.squash-uploads'],), 'false'), |
768 ((['git', 'config', '--bool', 'gerrit.squash-uploads'],), 'false'), | |
Bons
2016/06/10 15:02:07
Why the duplicate here? I must be missing somethin
tandrii(chromium)
2016/06/10 15:33:03
well, it's an extra call I've added. Actually, the
| |
768 ] | 769 ] |
769 # If issue is given, then description is fetched from Gerrit instead. | 770 # If issue is given, then description is fetched from Gerrit instead. |
770 if issue is None: | 771 if issue is None: |
771 if squash: | 772 if squash: |
772 calls += [ | 773 calls += [ |
773 ((['git', 'show', '--format=%B', '-s', | 774 ((['git', 'show', '--format=%B', '-s', |
774 'refs/heads/git_cl_uploads/master'],), '')] | 775 'refs/heads/git_cl_uploads/master'],), '')] |
775 calls += [ | 776 calls += [ |
776 ((['git', 'log', '--pretty=format:%s\n\n%b', | 777 ((['git', 'log', '--pretty=format:%s\n\n%b', |
777 'fake_ancestor_sha..HEAD'],), | 778 'fake_ancestor_sha..HEAD'],), |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1625 ((['rm_file_or_tree', '/abs/git_repo_root/.git/hooks/commit-msg'],), | 1626 ((['rm_file_or_tree', '/abs/git_repo_root/.git/hooks/commit-msg'],), |
1626 ''), | 1627 ''), |
1627 ] | 1628 ] |
1628 cl._codereview_impl._GerritCommitMsgHookCheck(offer_removal=True) | 1629 cl._codereview_impl._GerritCommitMsgHookCheck(offer_removal=True) |
1629 | 1630 |
1630 | 1631 |
1631 if __name__ == '__main__': | 1632 if __name__ == '__main__': |
1632 git_cl.logging.basicConfig( | 1633 git_cl.logging.basicConfig( |
1633 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) | 1634 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) |
1634 unittest.main() | 1635 unittest.main() |
OLD | NEW |