OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 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 import optparse | 6 import optparse |
7 import sys | 7 import sys |
8 | 8 |
9 import bot_update # pylint: disable=relative-import | 9 import bot_update # pylint: disable=relative-import |
10 | 10 |
11 | 11 |
12 if __name__ == '__main__': | 12 if __name__ == '__main__': |
13 parse = optparse.OptionParser() | 13 parse = optparse.OptionParser() |
14 | 14 |
15 parse.add_option('--gerrit_repo', | 15 parse.add_option('--gerrit_repo', |
16 help='Gerrit repository to pull the ref from.') | 16 help='Gerrit repository to pull the ref from.') |
17 parse.add_option('--gerrit_ref', help='Gerrit ref to apply.') | 17 parse.add_option('--gerrit_ref', help='Gerrit ref to apply.') |
18 parse.add_option('--root', help='The location of the checkout.') | 18 parse.add_option('--root', help='The location of the checkout.') |
19 parse.add_option('--gerrit_no_reset', action='store_true', | 19 parse.add_option('--gerrit_no_reset', action='store_true', |
20 help='Bypass calling reset after applying a gerrit ref.') | 20 help='Bypass calling reset after applying a gerrit ref.') |
21 parse.add_option('--gerrit_rebase_patch_ref', action='store_true', | 21 parse.add_option('--gerrit_no_rebase_patch_ref', action='store_true', |
22 help='Rebase Gerrit patch ref after of checking it out.') | 22 help='Bypass rebase of Gerrit patch ref after checkout.') |
23 | 23 |
24 options, _ = parse.parse_args() | 24 options, _ = parse.parse_args() |
25 | 25 |
26 sys.exit( | 26 sys.exit( |
27 bot_update.apply_gerrit_ref( | 27 bot_update.apply_gerrit_ref( |
28 options.gerrit_repo, | 28 options.gerrit_repo, |
29 options.gerrit_ref, | 29 options.gerrit_ref, |
30 options.root, | 30 options.root, |
31 not options.gerrit_no_reset, | 31 not options.gerrit_no_reset, |
32 options.gerrit_rebase_patch_ref) | 32 not options.gerrit_no_rebase_patch_ref) |
33 ) | 33 ) |
OLD | NEW |