forked from AFPy/python-docs-fr
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:
parent
9e57ea00c8
commit
343aa3118d
12
merge.py
12
merge.py
|
@ -29,14 +29,20 @@ def parse_args():
|
||||||
type=Path,
|
type=Path,
|
||||||
help="Use this given cpython clone.",
|
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()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
def setup_repo(repo_path: Path, branch: str):
|
def setup_repo(repo_path: Path, branch: str):
|
||||||
"""Ensure we're up-to-date."""
|
"""Ensure we're up-to-date."""
|
||||||
run("git", "-C", repo_path, "checkout", branch)
|
if branch.find('.') == 2:
|
||||||
run("git", "-C", repo_path, "pull", "--ff-only")
|
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:
|
def copy_new_files(new_files: set[Path], pot_path: Path) -> None:
|
||||||
|
|
Loading…
Reference in New Issue