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.""" | 8 """A git-command for integrating reviews on Rietveld.""" |
| 9 | 9 |
| 10 import json | 10 import json |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1239 help='reviewer email addresses') | 1239 help='reviewer email addresses') |
| 1240 parser.add_option('--cc', | 1240 parser.add_option('--cc', |
| 1241 help='cc email addresses') | 1241 help='cc email addresses') |
| 1242 parser.add_option('--send-mail', action='store_true', | 1242 parser.add_option('--send-mail', action='store_true', |
| 1243 help='send email to reviewer immediately') | 1243 help='send email to reviewer immediately') |
| 1244 parser.add_option("--emulate_svn_auto_props", action="store_true", | 1244 parser.add_option("--emulate_svn_auto_props", action="store_true", |
| 1245 dest="emulate_svn_auto_props", | 1245 dest="emulate_svn_auto_props", |
| 1246 help="Emulate Subversion's auto properties feature.") | 1246 help="Emulate Subversion's auto properties feature.") |
| 1247 parser.add_option('-c', '--use-commit-queue', action='store_true', | 1247 parser.add_option('-c', '--use-commit-queue', action='store_true', |
| 1248 help='tell the commit queue to commit this patchset') | 1248 help='tell the commit queue to commit this patchset') |
| 1249 if settings.GetIsGerrit(): | 1249 parser.add_option('--target_branch', |
| 1250 parser.add_option('--target_branch', dest='target_branch', default='master', | 1250 help='When uploading to gerrit, remote branch to ' + |
|
M-A Ruel
2012/11/27 14:20:52
Also no need for + and align the second line at th
ukai
2012/11/28 02:25:19
Done.
| |
| 1251 help='target branch to upload') | 1251 'use for CL. Default: master') |
| 1252 add_git_similarity(parser) | 1252 add_git_similarity(parser) |
| 1253 (options, args) = parser.parse_args(args) | 1253 (options, args) = parser.parse_args(args) |
| 1254 | 1254 |
| 1255 if options.target_branch and not settings.GetIsGerrit(): | |
| 1256 print >> sys.stderr, ( | |
|
M-A Ruel
2012/11/27 14:20:52
Use parser.error() instead
ukai
2012/11/28 02:25:19
Done.
| |
| 1257 '\nWARNING: Use --target_branch for non gerrit repository.\n') | |
| 1258 | |
| 1255 # Print warning if the user used the -m/--message argument. This will soon | 1259 # Print warning if the user used the -m/--message argument. This will soon |
| 1256 # change to -t/--title. | 1260 # change to -t/--title. |
| 1257 if options.message: | 1261 if options.message: |
| 1258 print >> sys.stderr, ( | 1262 print >> sys.stderr, ( |
| 1259 '\nWARNING: Use -t or --title to set the title of the patchset.\n' | 1263 '\nWARNING: Use -t or --title to set the title of the patchset.\n' |
| 1260 'In the near future, -m or --message will send a message instead.\n' | 1264 'In the near future, -m or --message will send a message instead.\n' |
| 1261 'See http://goo.gl/JGg0Z for details.\n') | 1265 'See http://goo.gl/JGg0Z for details.\n') |
| 1262 | 1266 |
| 1263 if is_dirty_git_tree('upload'): | 1267 if is_dirty_git_tree('upload'): |
| 1264 return 1 | 1268 return 1 |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1864 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1868 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 1865 | 1869 |
| 1866 # Not a known command. Default to help. | 1870 # Not a known command. Default to help. |
| 1867 GenUsage(parser, 'help') | 1871 GenUsage(parser, 'help') |
| 1868 return CMDhelp(parser, argv) | 1872 return CMDhelp(parser, argv) |
| 1869 | 1873 |
| 1870 | 1874 |
| 1871 if __name__ == '__main__': | 1875 if __name__ == '__main__': |
| 1872 fix_encoding.fix_encoding() | 1876 fix_encoding.fix_encoding() |
| 1873 sys.exit(main(sys.argv[1:])) | 1877 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |