| 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 import json | 10 import json |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 | 1138 |
| 1139 if settings.GetIsGerrit(): | 1139 if settings.GetIsGerrit(): |
| 1140 return GerritUpload(options, args, cl) | 1140 return GerritUpload(options, args, cl) |
| 1141 return RietveldUpload(options, args, cl) | 1141 return RietveldUpload(options, args, cl) |
| 1142 | 1142 |
| 1143 | 1143 |
| 1144 def IsSubmoduleMergeCommit(ref): | 1144 def IsSubmoduleMergeCommit(ref): |
| 1145 # When submodules are added to the repo, we expect there to be a single | 1145 # When submodules are added to the repo, we expect there to be a single |
| 1146 # non-git-svn merge commit at remote HEAD with a signature comment. | 1146 # non-git-svn merge commit at remote HEAD with a signature comment. |
| 1147 pattern = '^SVN changes up to revision [0-9]*$' | 1147 pattern = '^SVN changes up to revision [0-9]*$' |
| 1148 cmd = ['rev-list', '--merges', '--grep="%s"' % pattern, '%s^!' % ref] | 1148 cmd = ['rev-list', '--merges', '--grep=%s' % pattern, '%s^!' % ref] |
| 1149 return RunGit(cmd) != '' | 1149 return RunGit(cmd) != '' |
| 1150 | 1150 |
| 1151 | 1151 |
| 1152 def SendUpstream(parser, args, cmd): | 1152 def SendUpstream(parser, args, cmd): |
| 1153 """Common code for CmdPush and CmdDCommit | 1153 """Common code for CmdPush and CmdDCommit |
| 1154 | 1154 |
| 1155 Squashed commit into a single. | 1155 Squashed commit into a single. |
| 1156 Updates changelog with metadata (e.g. pointer to review). | 1156 Updates changelog with metadata (e.g. pointer to review). |
| 1157 Pushes/dcommits the code upstream. | 1157 Pushes/dcommits the code upstream. |
| 1158 Updates review and closes. | 1158 Updates review and closes. |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1600 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1600 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 1601 | 1601 |
| 1602 # Not a known command. Default to help. | 1602 # Not a known command. Default to help. |
| 1603 GenUsage(parser, 'help') | 1603 GenUsage(parser, 'help') |
| 1604 return CMDhelp(parser, argv) | 1604 return CMDhelp(parser, argv) |
| 1605 | 1605 |
| 1606 | 1606 |
| 1607 if __name__ == '__main__': | 1607 if __name__ == '__main__': |
| 1608 fix_encoding.fix_encoding() | 1608 fix_encoding.fix_encoding() |
| 1609 sys.exit(main(sys.argv[1:])) | 1609 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |