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 distutils.version import LooseVersion | 10 from distutils.version import LooseVersion |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 """Return true if this repo is assosiated with gerrit code review system.""" | 763 """Return true if this repo is assosiated with gerrit code review system.""" |
764 if self.is_gerrit is None: | 764 if self.is_gerrit is None: |
765 self.is_gerrit = self._GetConfig('gerrit.host', error_ok=True) | 765 self.is_gerrit = self._GetConfig('gerrit.host', error_ok=True) |
766 return self.is_gerrit | 766 return self.is_gerrit |
767 | 767 |
768 def GetSquashGerritUploads(self): | 768 def GetSquashGerritUploads(self): |
769 """Return true if uploads to Gerrit should be squashed by default.""" | 769 """Return true if uploads to Gerrit should be squashed by default.""" |
770 if self.squash_gerrit_uploads is None: | 770 if self.squash_gerrit_uploads is None: |
771 self.squash_gerrit_uploads = ( | 771 self.squash_gerrit_uploads = ( |
772 RunGit(['config', '--bool', 'gerrit.squash-uploads'], | 772 RunGit(['config', '--bool', 'gerrit.squash-uploads'], |
773 error_ok=True).strip() == 'true') | 773 error_ok=True).strip() != 'false') |
774 return self.squash_gerrit_uploads | 774 return self.squash_gerrit_uploads |
775 | 775 |
776 def GetGerritSkipEnsureAuthenticated(self): | 776 def GetGerritSkipEnsureAuthenticated(self): |
777 """Return True if EnsureAuthenticated should not be done for Gerrit | 777 """Return True if EnsureAuthenticated should not be done for Gerrit |
778 uploads.""" | 778 uploads.""" |
779 if self.gerrit_skip_ensure_authenticated is None: | 779 if self.gerrit_skip_ensure_authenticated is None: |
780 self.gerrit_skip_ensure_authenticated = ( | 780 self.gerrit_skip_ensure_authenticated = ( |
781 RunGit(['config', '--bool', 'gerrit.skip-ensure-authenticated'], | 781 RunGit(['config', '--bool', 'gerrit.skip-ensure-authenticated'], |
782 error_ok=True).strip() == 'true') | 782 error_ok=True).strip() == 'true') |
783 return self.gerrit_skip_ensure_authenticated | 783 return self.gerrit_skip_ensure_authenticated |
(...skipping 4249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5033 if __name__ == '__main__': | 5033 if __name__ == '__main__': |
5034 # These affect sys.stdout so do it outside of main() to simplify mocks in | 5034 # These affect sys.stdout so do it outside of main() to simplify mocks in |
5035 # unit testing. | 5035 # unit testing. |
5036 fix_encoding.fix_encoding() | 5036 fix_encoding.fix_encoding() |
5037 setup_color.init() | 5037 setup_color.init() |
5038 try: | 5038 try: |
5039 sys.exit(main(sys.argv[1:])) | 5039 sys.exit(main(sys.argv[1:])) |
5040 except KeyboardInterrupt: | 5040 except KeyboardInterrupt: |
5041 sys.stderr.write('interrupted\n') | 5041 sys.stderr.write('interrupted\n') |
5042 sys.exit(1) | 5042 sys.exit(1) |
OLD | NEW |