Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions copier_python/update.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import json
import os
import subprocess
from contextlib import contextmanager
from dataclasses import dataclass, field
Expand Down Expand Up @@ -73,16 +72,10 @@ def _run(self, repo: RepoWorktree) -> str | None:
with self._success_or_shell(repo, "Lint/test"):
repo.run_task("lt")

title = "Apply template updates"
title = f"Apply template updates from {start_ref} to {end_ref}"
body = ""
if start_ref and end_ref and start_ref != end_ref:
ref_range = f"{start_ref}...{end_ref}"
body = os.linesep.join(
(
f"Applied updates from template: {ref_range}",
f"{TEMPLATE_REPO_URL}/compare/{ref_range}",
)
)
body = f"{TEMPLATE_REPO_URL}/compare/{start_ref}...{end_ref}"
repo.run(["git", "add", "-A"])
repo.run(["git", "commit", "-m", f"{title}\n\n{body}".strip()])

Expand Down
6 changes: 2 additions & 4 deletions tests/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,8 @@ def _postcreate(project: Path) -> None:
create_project(vcs_ref=start_ref, postcreate=_postcreate)
commit_message = os.linesep.join(
(
"Apply template updates",
f"Apply template updates from {start_ref} to {end_ref}",
"",
(f"Applied updates from template: {start_ref}...{end_ref}"),
(
f"https://github.com/smkent/copier-python/compare/"
f"{start_ref}...{end_ref}"
Expand Down Expand Up @@ -385,9 +384,8 @@ def test_main_update_with_project(
create_project(vcs_ref=start_ref, project_visibility=project_visibility)
commit_message = os.linesep.join(
(
"Apply template updates",
f"Apply template updates from {start_ref} to {end_ref}",
"",
(f"Applied updates from template: {start_ref}...{end_ref}"),
(
f"https://github.com/smkent/copier-python/compare/"
f"{start_ref}...{end_ref}"
Expand Down
Loading