| 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 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1293 if not options.reviewers and hook_results.reviewers: | 1293 if not options.reviewers and hook_results.reviewers: |
| 1294 options.reviewers = hook_results.reviewers | 1294 options.reviewers = hook_results.reviewers |
| 1295 | 1295 |
| 1296 if cl.GetIssue(): | 1296 if cl.GetIssue(): |
| 1297 latest_patchset = cl.GetMostRecentPatchset(cl.GetIssue()) | 1297 latest_patchset = cl.GetMostRecentPatchset(cl.GetIssue()) |
| 1298 local_patchset = cl.GetPatchset() | 1298 local_patchset = cl.GetPatchset() |
| 1299 if latest_patchset and local_patchset and local_patchset != latest_patchset: | 1299 if latest_patchset and local_patchset and local_patchset != latest_patchset: |
| 1300 print ('The last upload made from this repository was patchset #%d but ' | 1300 print ('The last upload made from this repository was patchset #%d but ' |
| 1301 'the most recent patchset on the server is #%d.' | 1301 'the most recent patchset on the server is #%d.' |
| 1302 % (local_patchset, latest_patchset)) | 1302 % (local_patchset, latest_patchset)) |
| 1303 print ('Uploading will still work, but if you\'ve uploaded to this issue ' |
| 1304 'from another machine or branch the patch you\'re uploading now ' |
| 1305 'might not include those changes.') |
| 1303 ask_for_data('About to upload; enter to confirm.') | 1306 ask_for_data('About to upload; enter to confirm.') |
| 1304 | 1307 |
| 1305 print_stats(options.similarity, options.find_copies, args) | 1308 print_stats(options.similarity, options.find_copies, args) |
| 1306 if settings.GetIsGerrit(): | 1309 if settings.GetIsGerrit(): |
| 1307 return GerritUpload(options, args, cl) | 1310 return GerritUpload(options, args, cl) |
| 1308 ret = RietveldUpload(options, args, cl) | 1311 ret = RietveldUpload(options, args, cl) |
| 1309 if not ret: | 1312 if not ret: |
| 1310 git_set_branch_value('last-upload-hash', RunGit(['rev-parse', 'HEAD'])) | 1313 git_set_branch_value('last-upload-hash', RunGit(['rev-parse', 'HEAD'])) |
| 1311 | 1314 |
| 1312 return ret | 1315 return ret |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1905 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1908 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 1906 | 1909 |
| 1907 # Not a known command. Default to help. | 1910 # Not a known command. Default to help. |
| 1908 GenUsage(parser, 'help') | 1911 GenUsage(parser, 'help') |
| 1909 return CMDhelp(parser, argv) | 1912 return CMDhelp(parser, argv) |
| 1910 | 1913 |
| 1911 | 1914 |
| 1912 if __name__ == '__main__': | 1915 if __name__ == '__main__': |
| 1913 fix_encoding.fix_encoding() | 1916 fix_encoding.fix_encoding() |
| 1914 sys.exit(main(sys.argv[1:])) | 1917 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |