Example #1
0
    def run_command(self, args):
        # type: (Namespace) -> None
        extra_arc_land_options = args.arc_land_args
        if extra_arc_land_options:
            # If the first extra arg starts with "-", "--" must also have been passed, and
            # argparse doesn't remove it for us
            if extra_arc_land_options[0] == "--":
                del extra_arc_land_options[0]
            extra_args = " " + " ".join(extra_arc_land_options)
        else:
            extra_args = ""

        current_branch = get_current_branch()
        with get_branch_tracker() as tracker:
            parent = tracker.parent_for_child(current_branch)
            fail_if_not_rebased(current_branch, parent, tracker)

            if parent != "master":
                should_land = raw_input(
                    "Are you sure you want to land onto non-master branch "
                    "'{}'? [y/N] ".format(parent))
                should_land = should_land.lower()
                if should_land not in ("y", "yes"):
                    print "Aborting land"
                    exit()

            arc("land --onto {}{}".format(parent, extra_args))

            # Successfully landed, replace ourselves with our parent
            tracker.collapse_and_remove_parent(current_branch)
def main(extra_arc_diff_options):
    # type: (List[str]) -> None
    if extra_arc_diff_options:
        extra_args = " " + " ".join(extra_arc_diff_options)
    else:
        extra_args = ""

    current_branch = get_current_branch()
    with get_branch_tracker() as tracker:
        parent = tracker.parent_for_child(current_branch)
        fail_if_not_rebased(current_branch, parent, tracker)
        arc("diff %s%s" % (parent, extra_args))
Example #3
0
    def run_command(self, args):
        # type: (Namespace) -> None
        extra_arc_diff_options = args.arc_diff_args
        if extra_arc_diff_options:
            # If the first extra arg starts with "-", "--" must also have been passed, and
            # argparse doesn't remove it for us
            if extra_arc_diff_options[0] == "--":
                del extra_arc_diff_options[0]
            extra_args = " " + " ".join(extra_arc_diff_options)
        else:
            extra_args = ""

        current_branch = get_current_branch()
        with get_branch_tracker() as tracker:
            parent = tracker.parent_for_child(current_branch)
            fail_if_not_rebased(current_branch, parent, tracker)
            arc("diff {}{}".format(parent, extra_args))
def main():
    # type: () -> None
    current_branch = get_current_branch()
    with get_branch_tracker() as tracker:
        parent = tracker.parent_for_child(current_branch)
        fail_if_not_rebased(current_branch, parent, tracker)

        if parent != "master":
            should_land = raw_input("Are you sure you want to land onto non-master branch '%s'? [y/N] " % parent)
            should_land = should_land.lower()
            if should_land not in ("y", "yes"):
                print "Aborting land"
                exit()

        arc("land --onto %s" % parent)

        # Successfully landed, replace ourselves with our parent
        tracker.collapse_and_remove_parent(current_branch)