blob: ec277f55777fc95777cea5a6dc85be8f803e9980 [file] [log] [blame]
Edward Lesmes98eda3f2019-08-12 21:09:53 +00001#!/usr/bin/env python
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +00002# 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
Raul Tambre80ee78e2019-05-06 22:41:05 +00006from __future__ import print_function
7
iannucci@chromium.org97345eb2014-03-13 07:55:15 +00008import sys
iannucci@chromium.org97345eb2014-03-13 07:55:15 +00009import optparse
10
11import subcommand
iannucci@chromium.org97345eb2014-03-13 07:55:15 +000012
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000013from git_common import freeze, thaw
iannucci@chromium.org97345eb2014-03-13 07:55:15 +000014
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000015def CMDfreeze(parser, args):
iannucci@chromium.org97345eb2014-03-13 07:55:15 +000016 """Freeze a branch's changes."""
17 parser.parse_args(args)
18 return freeze()
19
20
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000021def CMDthaw(parser, args):
iannucci@chromium.org97345eb2014-03-13 07:55:15 +000022 """Returns a frozen branch to the state before it was frozen."""
23 parser.parse_args(args)
24 return thaw()
25
26
sbc@chromium.org013731e2015-02-26 18:28:43 +000027def main(args):
iannucci@chromium.org97345eb2014-03-13 07:55:15 +000028 dispatcher = subcommand.CommandDispatcher(__name__)
sbc@chromium.org013731e2015-02-26 18:28:43 +000029 ret = dispatcher.execute(optparse.OptionParser(), args)
iannucci@chromium.org97345eb2014-03-13 07:55:15 +000030 if ret:
Raul Tambre80ee78e2019-05-06 22:41:05 +000031 print(ret)
sbc@chromium.org013731e2015-02-26 18:28:43 +000032 return 0
iannucci@chromium.org97345eb2014-03-13 07:55:15 +000033
34
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000035if __name__ == '__main__':
sbc@chromium.org013731e2015-02-26 18:28:43 +000036 try:
37 sys.exit(main(sys.argv[1:]))
38 except KeyboardInterrupt:
39 sys.stderr.write('interrupted\n')
40 sys.exit(1)