1
0
Fork 0

allow to specify any commit to merge.py (#33)

For debugging purpose.

Co-authored-by: Christophe Nanteuil <christophe.nanteuil@gmail.com>
Reviewed-on: AFPy/python-docs-fr#33
Reviewed-by: Julien Palard <julien@palard.fr>
Co-authored-by: Christophe Nanteuil <christophenan@noreply.localhost>
Co-committed-by: Christophe Nanteuil <christophenan@noreply.localhost>
This commit is contained in:
Christophe Nanteuil 2023-02-12 10:36:18 +00:00 committed by Julien Palard
parent 9e57ea00c8
commit 343aa3118d
1 changed files with 9 additions and 3 deletions

View File

@ -29,14 +29,20 @@ def parse_args():
type=Path,
help="Use this given cpython clone.",
)
parser.add_argument("branch", help="Merge from this branch")
parser.add_argument(
"branch",
help="Merge from this branch or from this commit",
)
return parser.parse_args()
def setup_repo(repo_path: Path, branch: str):
"""Ensure we're up-to-date."""
run("git", "-C", repo_path, "checkout", branch)
run("git", "-C", repo_path, "pull", "--ff-only")
if branch.find('.') == 2:
run("git", "-C", repo_path, "checkout", branch)
run("git", "-C", repo_path, "pull", "--ff-only")
else: # it's a commit
run("git", "-C", repo_path, "checkout", branch)
def copy_new_files(new_files: set[Path], pot_path: Path) -> None: