blob: cf8ec442cd46be424fbd8425bd900604fd942efa [file] [log] [blame]
Josip Sokcevic4de5dea2022-03-23 21:15:14 +00001#!/usr/bin/env python3
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
iannucci@chromium.org97345eb2014-03-13 07:55:15 +00006import sys
iannucci@chromium.org97345eb2014-03-13 07:55:15 +00007import optparse
8
9import subcommand
iannucci@chromium.org97345eb2014-03-13 07:55:15 +000010
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000011from git_common import freeze, thaw
iannucci@chromium.org97345eb2014-03-13 07:55:15 +000012
Robert Iannucci4e87f5b2023-07-13 19:51:33 +000013
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000014def CMDfreeze(parser, args):
Mike Frysinger124bb8e2023-09-06 05:48:55 +000015 """Freeze a branch's changes, excluding unstaged gitlinks changes."""
16 parser.parse_args(args)
17 return freeze()
iannucci@chromium.org97345eb2014-03-13 07:55:15 +000018
19
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000020def CMDthaw(parser, args):
Mike Frysinger124bb8e2023-09-06 05:48:55 +000021 """Returns a frozen branch to the state before it was frozen."""
22 parser.parse_args(args)
23 return thaw()
iannucci@chromium.org97345eb2014-03-13 07:55:15 +000024
25
sbc@chromium.org013731e2015-02-26 18:28:43 +000026def main(args):
Mike Frysinger124bb8e2023-09-06 05:48:55 +000027 dispatcher = subcommand.CommandDispatcher(__name__)
28 ret = dispatcher.execute(optparse.OptionParser(), args)
29 if ret:
30 print(ret)
31 return 0
iannucci@chromium.org97345eb2014-03-13 07:55:15 +000032
33
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000034if __name__ == '__main__':
Mike Frysinger124bb8e2023-09-06 05:48:55 +000035 try:
36 sys.exit(main(sys.argv[1:]))
37 except KeyboardInterrupt:
38 sys.stderr.write('interrupted\n')
39 sys.exit(1)