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 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1354 print ('Uploading will still work, but if you\'ve uploaded to this issue ' | 1354 print ('Uploading will still work, but if you\'ve uploaded to this issue ' |
1355 'from another machine or branch the patch you\'re uploading now ' | 1355 'from another machine or branch the patch you\'re uploading now ' |
1356 'might not include those changes.') | 1356 'might not include those changes.') |
1357 ask_for_data('About to upload; enter to confirm.') | 1357 ask_for_data('About to upload; enter to confirm.') |
1358 | 1358 |
1359 print_stats(options.similarity, options.find_copies, args) | 1359 print_stats(options.similarity, options.find_copies, args) |
1360 if settings.GetIsGerrit(): | 1360 if settings.GetIsGerrit(): |
1361 return GerritUpload(options, args, cl) | 1361 return GerritUpload(options, args, cl) |
1362 ret = RietveldUpload(options, args, cl) | 1362 ret = RietveldUpload(options, args, cl) |
1363 if not ret: | 1363 if not ret: |
1364 git_set_branch_value('last-upload-hash', RunGit(['rev-parse', 'HEAD'])) | 1364 git_set_branch_value('last-upload-hash', |
| 1365 RunGit(['rev-parse', 'HEAD']).strip()) |
1365 | 1366 |
1366 return ret | 1367 return ret |
1367 | 1368 |
1368 | 1369 |
1369 def IsSubmoduleMergeCommit(ref): | 1370 def IsSubmoduleMergeCommit(ref): |
1370 # When submodules are added to the repo, we expect there to be a single | 1371 # When submodules are added to the repo, we expect there to be a single |
1371 # non-git-svn merge commit at remote HEAD with a signature comment. | 1372 # non-git-svn merge commit at remote HEAD with a signature comment. |
1372 pattern = '^SVN changes up to revision [0-9]*$' | 1373 pattern = '^SVN changes up to revision [0-9]*$' |
1373 cmd = ['rev-list', '--merges', '--grep=%s' % pattern, '%s^!' % ref] | 1374 cmd = ['rev-list', '--merges', '--grep=%s' % pattern, '%s^!' % ref] |
1374 return RunGit(cmd) != '' | 1375 return RunGit(cmd) != '' |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1968 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
1968 | 1969 |
1969 # Not a known command. Default to help. | 1970 # Not a known command. Default to help. |
1970 GenUsage(parser, 'help') | 1971 GenUsage(parser, 'help') |
1971 return CMDhelp(parser, argv) | 1972 return CMDhelp(parser, argv) |
1972 | 1973 |
1973 | 1974 |
1974 if __name__ == '__main__': | 1975 if __name__ == '__main__': |
1975 fix_encoding.fix_encoding() | 1976 fix_encoding.fix_encoding() |
1976 sys.exit(main(sys.argv[1:])) | 1977 sys.exit(main(sys.argv[1:])) |
OLD | NEW |