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 ' |
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 parser.error('Use --target_branch for non gerrit repository.') |
| 1257 |
1255 # Print warning if the user used the -m/--message argument. This will soon | 1258 # Print warning if the user used the -m/--message argument. This will soon |
1256 # change to -t/--title. | 1259 # change to -t/--title. |
1257 if options.message: | 1260 if options.message: |
1258 print >> sys.stderr, ( | 1261 print >> sys.stderr, ( |
1259 '\nWARNING: Use -t or --title to set the title of the patchset.\n' | 1262 '\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' | 1263 'In the near future, -m or --message will send a message instead.\n' |
1261 'See http://goo.gl/JGg0Z for details.\n') | 1264 'See http://goo.gl/JGg0Z for details.\n') |
1262 | 1265 |
1263 if is_dirty_git_tree('upload'): | 1266 if is_dirty_git_tree('upload'): |
1264 return 1 | 1267 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))) | 1867 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
1865 | 1868 |
1866 # Not a known command. Default to help. | 1869 # Not a known command. Default to help. |
1867 GenUsage(parser, 'help') | 1870 GenUsage(parser, 'help') |
1868 return CMDhelp(parser, argv) | 1871 return CMDhelp(parser, argv) |
1869 | 1872 |
1870 | 1873 |
1871 if __name__ == '__main__': | 1874 if __name__ == '__main__': |
1872 fix_encoding.fix_encoding() | 1875 fix_encoding.fix_encoding() |
1873 sys.exit(main(sys.argv[1:])) | 1876 sys.exit(main(sys.argv[1:])) |
OLD | NEW |