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 # Copyright (C) 2008 Evan Martin <martine@danga.com> | 6 # Copyright (C) 2008 Evan Martin <martine@danga.com> |
7 | 7 |
8 """A git-command for integrating reviews on Rietveld and Gerrit.""" | 8 """A git-command for integrating reviews on Rietveld and Gerrit.""" |
9 | 9 |
10 from __future__ import print_function | 10 from __future__ import print_function |
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 return self._load_codereview_impl( | 1018 return self._load_codereview_impl( |
1019 codereview='gerrit' if settings.GetIsGerrit() else 'rietveld', | 1019 codereview='gerrit' if settings.GetIsGerrit() else 'rietveld', |
1020 **kwargs) | 1020 **kwargs) |
1021 | 1021 |
1022 def IsGerrit(self): | 1022 def IsGerrit(self): |
1023 return self._codereview == 'gerrit' | 1023 return self._codereview == 'gerrit' |
1024 | 1024 |
1025 def GetCCList(self): | 1025 def GetCCList(self): |
1026 """Return the users cc'd on this CL. | 1026 """Return the users cc'd on this CL. |
1027 | 1027 |
1028 Return is a string suitable for passing to gcl with the --cc flag. | 1028 Return is a string suitable for passing to git cl with the --cc flag. |
1029 """ | 1029 """ |
1030 if self.cc is None: | 1030 if self.cc is None: |
1031 base_cc = settings.GetDefaultCCList() | 1031 base_cc = settings.GetDefaultCCList() |
1032 more_cc = ','.join(self.watchers) | 1032 more_cc = ','.join(self.watchers) |
1033 self.cc = ','.join(filter(None, (base_cc, more_cc))) or '' | 1033 self.cc = ','.join(filter(None, (base_cc, more_cc))) or '' |
1034 return self.cc | 1034 return self.cc |
1035 | 1035 |
1036 def GetCCListWithoutDefault(self): | 1036 def GetCCListWithoutDefault(self): |
1037 """Return the users cc'd on this CL excluding default ones.""" | 1037 """Return the users cc'd on this CL excluding default ones.""" |
1038 if self.cc is None: | 1038 if self.cc is None: |
(...skipping 4179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5218 if __name__ == '__main__': | 5218 if __name__ == '__main__': |
5219 # These affect sys.stdout so do it outside of main() to simplify mocks in | 5219 # These affect sys.stdout so do it outside of main() to simplify mocks in |
5220 # unit testing. | 5220 # unit testing. |
5221 fix_encoding.fix_encoding() | 5221 fix_encoding.fix_encoding() |
5222 setup_color.init() | 5222 setup_color.init() |
5223 try: | 5223 try: |
5224 sys.exit(main(sys.argv[1:])) | 5224 sys.exit(main(sys.argv[1:])) |
5225 except KeyboardInterrupt: | 5225 except KeyboardInterrupt: |
5226 sys.stderr.write('interrupted\n') | 5226 sys.stderr.write('interrupted\n') |
5227 sys.exit(1) | 5227 sys.exit(1) |
OLD | NEW |