| 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.""" | 8 """A git-command for integrating reviews on Rietveld.""" |
| 9 | 9 |
| 10 from distutils.version import LooseVersion | 10 from distutils.version import LooseVersion |
| (...skipping 2759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2770 if opts.diff: | 2770 if opts.diff: |
| 2771 sys.stdout.write(stdout) | 2771 sys.stdout.write(stdout) |
| 2772 if opts.dry_run and len(stdout) > 0: | 2772 if opts.dry_run and len(stdout) > 0: |
| 2773 return 2 | 2773 return 2 |
| 2774 | 2774 |
| 2775 return 0 | 2775 return 0 |
| 2776 | 2776 |
| 2777 | 2777 |
| 2778 def CMDlol(parser, args): | 2778 def CMDlol(parser, args): |
| 2779 # This command is intentionally undocumented. | 2779 # This command is intentionally undocumented. |
| 2780 print(""" / / | 2780 print('\n'.join(( |
| 2781 (\/_//`) | 2781 ' / /', |
| 2782 / '/ | 2782 ' (\\/_//`)', |
| 2783 0 0 \ | 2783 ' / \'/', |
| 2784 / \ | 2784 ' 0 0 \\', |
| 2785 / __/ \ | 2785 ' / \\', |
| 2786 /, _/ \ \_ | 2786 ' / __/ \\', |
| 2787 `-./ ) | ~^~^~^~^~^~^~^~\~. | 2787 ' /, _/ \\ \\_', |
| 2788 ( / \_} | 2788 ' `-./ ) | ~^~^~^~^~^~^~^~\\~.', |
| 2789 | / | | 2789 ' ( / \\_}', |
| 2790 ; | \ / | 2790 ' | / |', |
| 2791 \/ ,/ \ | | 2791 ' ; | \\ /', |
| 2792 / /~~|~|~~~~~~|~|\ | | 2792 ' \\/ ,/ \\ |', |
| 2793 / / | | | | `\ \ | 2793 ' / /~~|~|~~~~~~|~|\\ |', |
| 2794 / / | | | | \ \ | 2794 ' / / | | | | `\\ \\', |
| 2795 / ( | | | | \ \ | 2795 ' / / | | | | \\ \\', |
| 2796 jgs /,_) /__) /__) /,_/ | 2796 ' / ( | | | | \\ \\', |
| 2797 '''''"""""'''""""""'''""""""''"""""''''' """) | 2797 ' jgs /,_) /__) /__) /,_/', |
| 2798 ' \'\'\'\'\'"""""\'\'\'""""""\'\'\'""""""\'\'"""""\'\'\'\'\''))) |
| 2798 return 0 | 2799 return 0 |
| 2799 | 2800 |
| 2800 | 2801 |
| 2801 class OptionParser(optparse.OptionParser): | 2802 class OptionParser(optparse.OptionParser): |
| 2802 """Creates the option parse and add --verbose support.""" | 2803 """Creates the option parse and add --verbose support.""" |
| 2803 def __init__(self, *args, **kwargs): | 2804 def __init__(self, *args, **kwargs): |
| 2804 optparse.OptionParser.__init__( | 2805 optparse.OptionParser.__init__( |
| 2805 self, *args, prog='git cl', version=__version__, **kwargs) | 2806 self, *args, prog='git cl', version=__version__, **kwargs) |
| 2806 self.add_option( | 2807 self.add_option( |
| 2807 '-v', '--verbose', action='count', default=0, | 2808 '-v', '--verbose', action='count', default=0, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2836 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 2837 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
| 2837 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 2838 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 2838 | 2839 |
| 2839 | 2840 |
| 2840 if __name__ == '__main__': | 2841 if __name__ == '__main__': |
| 2841 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2842 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 2842 # unit testing. | 2843 # unit testing. |
| 2843 fix_encoding.fix_encoding() | 2844 fix_encoding.fix_encoding() |
| 2844 colorama.init() | 2845 colorama.init() |
| 2845 sys.exit(main(sys.argv[1:])) | 2846 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |