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 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 return 0 | 1567 return 0 |
1568 | 1568 |
1569 | 1569 |
1570 def CMDdescription(parser, args): | 1570 def CMDdescription(parser, args): |
1571 """Brings up the editor for the current CL's description.""" | 1571 """Brings up the editor for the current CL's description.""" |
1572 cl = Changelist() | 1572 cl = Changelist() |
1573 if not cl.GetIssue(): | 1573 if not cl.GetIssue(): |
1574 DieWithError('This branch has no associated changelist.') | 1574 DieWithError('This branch has no associated changelist.') |
1575 description = ChangeDescription(cl.GetDescription()) | 1575 description = ChangeDescription(cl.GetDescription()) |
1576 description.prompt() | 1576 description.prompt() |
1577 cl.UpdateDescription(description.description) | 1577 if cl.GetDescription() != description.description: |
| 1578 cl.UpdateDescription(description.description) |
1578 return 0 | 1579 return 0 |
1579 | 1580 |
1580 | 1581 |
1581 def CreateDescriptionFromLog(args): | 1582 def CreateDescriptionFromLog(args): |
1582 """Pulls out the commit log to use as a base for the CL description.""" | 1583 """Pulls out the commit log to use as a base for the CL description.""" |
1583 log_args = [] | 1584 log_args = [] |
1584 if len(args) == 1 and not args[0].endswith('.'): | 1585 if len(args) == 1 and not args[0].endswith('.'): |
1585 log_args = [args[0] + '..'] | 1586 log_args = [args[0] + '..'] |
1586 elif len(args) == 1 and args[0].endswith('...'): | 1587 elif len(args) == 1 and args[0].endswith('...'): |
1587 log_args = [args[0][:-1]] | 1588 log_args = [args[0][:-1]] |
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3134 if __name__ == '__main__': | 3135 if __name__ == '__main__': |
3135 # These affect sys.stdout so do it outside of main() to simplify mocks in | 3136 # These affect sys.stdout so do it outside of main() to simplify mocks in |
3136 # unit testing. | 3137 # unit testing. |
3137 fix_encoding.fix_encoding() | 3138 fix_encoding.fix_encoding() |
3138 colorama.init() | 3139 colorama.init() |
3139 try: | 3140 try: |
3140 sys.exit(main(sys.argv[1:])) | 3141 sys.exit(main(sys.argv[1:])) |
3141 except KeyboardInterrupt: | 3142 except KeyboardInterrupt: |
3142 sys.stderr.write('interrupted\n') | 3143 sys.stderr.write('interrupted\n') |
3143 sys.exit(1) | 3144 sys.exit(1) |
OLD | NEW |