[email protected] | 97231b5 | 2014-03-26 06:54:55 | [diff] [blame] | 1 | #!/usr/bin/env python |
[email protected] | c050a5b | 2014-03-26 06:18:50 | [diff] [blame] | 2 | # Copyright 2014 The Chromium Authors. All rights reserved. |
3 | # Use of this source code is governed by a BSD-style license that can be | ||||
4 | # found in the LICENSE file. | ||||
5 | |||||
[email protected] | 97345eb | 2014-03-13 07:55:15 | [diff] [blame] | 6 | import sys |
[email protected] | 97345eb | 2014-03-13 07:55:15 | [diff] [blame] | 7 | import optparse |
8 | |||||
9 | import subcommand | ||||
[email protected] | 97345eb | 2014-03-13 07:55:15 | [diff] [blame] | 10 | |
[email protected] | c050a5b | 2014-03-26 06:18:50 | [diff] [blame] | 11 | from git_common import freeze, thaw |
[email protected] | 97345eb | 2014-03-13 07:55:15 | [diff] [blame] | 12 | |
[email protected] | c050a5b | 2014-03-26 06:18:50 | [diff] [blame] | 13 | def CMDfreeze(parser, args): |
[email protected] | 97345eb | 2014-03-13 07:55:15 | [diff] [blame] | 14 | """Freeze a branch's changes.""" |
15 | parser.parse_args(args) | ||||
16 | return freeze() | ||||
17 | |||||
18 | |||||
[email protected] | c050a5b | 2014-03-26 06:18:50 | [diff] [blame] | 19 | def CMDthaw(parser, args): |
[email protected] | 97345eb | 2014-03-13 07:55:15 | [diff] [blame] | 20 | """Returns a frozen branch to the state before it was frozen.""" |
21 | parser.parse_args(args) | ||||
22 | return thaw() | ||||
23 | |||||
24 | |||||
[email protected] | 013731e | 2015-02-26 18:28:43 | [diff] [blame] | 25 | def main(args): |
[email protected] | 97345eb | 2014-03-13 07:55:15 | [diff] [blame] | 26 | dispatcher = subcommand.CommandDispatcher(__name__) |
[email protected] | 013731e | 2015-02-26 18:28:43 | [diff] [blame] | 27 | ret = dispatcher.execute(optparse.OptionParser(), args) |
[email protected] | 97345eb | 2014-03-13 07:55:15 | [diff] [blame] | 28 | if ret: |
29 | print ret | ||||
[email protected] | 013731e | 2015-02-26 18:28:43 | [diff] [blame] | 30 | return 0 |
[email protected] | 97345eb | 2014-03-13 07:55:15 | [diff] [blame] | 31 | |
32 | |||||
[email protected] | c050a5b | 2014-03-26 06:18:50 | [diff] [blame] | 33 | if __name__ == '__main__': |
[email protected] | 013731e | 2015-02-26 18:28:43 | [diff] [blame] | 34 | try: |
35 | sys.exit(main(sys.argv[1:])) | ||||
36 | except KeyboardInterrupt: | ||||
37 | sys.stderr.write('interrupted\n') | ||||
38 | sys.exit(1) |