Example #1
0
    elif options.action == 'conflicts':
        from Shelf import Conflicts
        Conflicts(options)
    elif options.action == 'push':
        from Push import Push
        Push(options)
    elif options.action == 'mergeheads':
        from MergeHeads import MergeHeads
        MergeHeads(options)
    elif options.action == 'diff':
        from Diff import Diff
        Diff(options)
    elif options.action == 'switch':
        from Switch import Switch
        pyhg_action = Switch()

    if pyhg_action:
        if not pyhg_action.execute(options):
            print(pyhg_action.message, file=sys.stderr)
            result = 1
        else:
            if not pyhg_action.cleanup(options):
                print(pyhg_action.message, file=sys.stderr)
                result = 1

    if os.name != 'nt':
        # reset the console colors to defaults
        print('\033[1;0m')

    sys.exit(result)