def apply_patches(patch_repo_path, start_patch_num=1): for patch_path in get_all_patch_paths(patch_repo_path): filename = os.path.basename(patch_path) patch_num = get_patch_num_from_patch_name(filename) if patch_num < start_patch_num: continue git.am(patch_path, three_way_merge=True) write_and_commit_patch_head(patch_num)
def resolve(path, patch_repo_path): git.am(resolved=True) last_patch_num = get_patch_head(path) this_patch_num = last_patch_num + 1 generate_and_commit_to_patch_repo( patch_repo_path, start_number=this_patch_num) next_patch_num = this_patch_num + 1 apply_patches(patch_repo_path, start_patch_num=next_patch_num)