Chromium Code Reviews| 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 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1588 def FetchDescription(self): | 1588 def FetchDescription(self): |
| 1589 data = gerrit_util.GetChangeDetail(self._GetGerritHost(), self.GetIssue(), | 1589 data = gerrit_util.GetChangeDetail(self._GetGerritHost(), self.GetIssue(), |
| 1590 ['COMMIT_FOOTERS', 'CURRENT_REVISION']) | 1590 ['COMMIT_FOOTERS', 'CURRENT_REVISION']) |
| 1591 return data['revisions'][data['current_revision']]['commit_with_footers'] | 1591 return data['revisions'][data['current_revision']]['commit_with_footers'] |
| 1592 | 1592 |
| 1593 def UpdateDescriptionRemote(self, description): | 1593 def UpdateDescriptionRemote(self, description): |
| 1594 # TODO(tandrii) | 1594 # TODO(tandrii) |
| 1595 raise NotImplementedError() | 1595 raise NotImplementedError() |
| 1596 | 1596 |
| 1597 def CloseIssue(self): | 1597 def CloseIssue(self): |
| 1598 # TODO(tandrii) | 1598 gerrit_util.AbandonChange(self._GetGerritHost(), self.GetIssue(), msg='') |
|
Michael Achenbach
2016/03/24 12:38:26
I assume this has no test, otherwise I'd have expe
| |
| 1599 raise NotImplementedError() | |
| 1600 | 1599 |
| 1601 | 1600 |
| 1602 class ChangeDescription(object): | 1601 class ChangeDescription(object): |
| 1603 """Contains a parsed form of the change description.""" | 1602 """Contains a parsed form of the change description.""" |
| 1604 R_LINE = r'^[ \t]*(TBR|R)[ \t]*=[ \t]*(.*?)[ \t]*$' | 1603 R_LINE = r'^[ \t]*(TBR|R)[ \t]*=[ \t]*(.*?)[ \t]*$' |
| 1605 BUG_LINE = r'^[ \t]*(BUG)[ \t]*=[ \t]*(.*?)[ \t]*$' | 1604 BUG_LINE = r'^[ \t]*(BUG)[ \t]*=[ \t]*(.*?)[ \t]*$' |
| 1606 | 1605 |
| 1607 def __init__(self, description): | 1606 def __init__(self, description): |
| 1608 self._description_lines = (description or '').strip().splitlines() | 1607 self._description_lines = (description or '').strip().splitlines() |
| 1609 | 1608 |
| (...skipping 2659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4269 if __name__ == '__main__': | 4268 if __name__ == '__main__': |
| 4270 # These affect sys.stdout so do it outside of main() to simplify mocks in | 4269 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 4271 # unit testing. | 4270 # unit testing. |
| 4272 fix_encoding.fix_encoding() | 4271 fix_encoding.fix_encoding() |
| 4273 colorama.init() | 4272 colorama.init() |
| 4274 try: | 4273 try: |
| 4275 sys.exit(main(sys.argv[1:])) | 4274 sys.exit(main(sys.argv[1:])) |
| 4276 except KeyboardInterrupt: | 4275 except KeyboardInterrupt: |
| 4277 sys.stderr.write('interrupted\n') | 4276 sys.stderr.write('interrupted\n') |
| 4278 sys.exit(1) | 4277 sys.exit(1) |
| OLD | NEW |