Answer product-owner round 1: 0 🔴, 1 🟡 (0 misread); name the clone in self-update's lines, and say in the README which copy to run and how a clone on 0.17.0 moves
This commit is contained in:
@@ -31,7 +31,7 @@ def moved_to_newest(clone: str) -> str | Failure:
|
||||
old_tag = None if isinstance(old, Failure) else old.strip()
|
||||
at_tag = git("describe", "--tags", "--exact-match", "--match", "v*", "HEAD", cwd=clone)
|
||||
if not isinstance(at_tag, Failure) and at_tag.strip() == tag:
|
||||
return f"Already on {tag}, the newest release."
|
||||
return f"{clone} is already on {tag}, the newest release."
|
||||
if isinstance(git("merge-base", "--is-ancestor", "HEAD", tag, cwd=clone), Failure):
|
||||
return Failure(f"{tag} doesn't hold the clone's commit, so the move would drop work no release holds: cut a release that holds it first")
|
||||
settings_changed = isinstance(git("diff", "--quiet", "HEAD", tag, "--", "settings.json", cwd=clone), Failure)
|
||||
@@ -49,7 +49,7 @@ def moved_to_newest(clone: str) -> str | Failure:
|
||||
if isinstance(moved, Failure):
|
||||
return moved
|
||||
changelog = git("show", f"{tag}:CHANGELOG.md", cwd=clone)
|
||||
lines = [f"Moved from {old_tag or 'an untagged commit'} to {tag}."]
|
||||
lines = [f"Moved {clone} from {old_tag or 'an untagged commit'} to {tag}."]
|
||||
if settings_changed:
|
||||
lines.append("settings.json changed: pick the model again with /model.")
|
||||
if not isinstance(changelog, Failure):
|
||||
|
||||
@@ -55,7 +55,7 @@ class SelfUpdate(unittest.TestCase):
|
||||
ran = subprocess.run([sys.executable, str(self.target / "bin" / "self-update")], capture_output=True, cwd=self.temp, env=isolated_env(), text=True)
|
||||
|
||||
self.assertEqual((ran.returncode, self.head()), (0, "v0.2.0"), ran.stderr)
|
||||
self.assertIn("Moved from v0.1.0 to v0.2.0.", ran.stdout)
|
||||
self.assertIn(f"Moved {self.target} from v0.1.0 to v0.2.0.", ran.stdout)
|
||||
|
||||
def test_refuses_an_argument_and_leaves_the_clone_as_it_was(self):
|
||||
self.release("0.2.0", "- Second.\n", '{"theme": "dark"}\n')
|
||||
@@ -72,7 +72,7 @@ class SelfUpdate(unittest.TestCase):
|
||||
ran = self.update()
|
||||
self.assertEqual(ran.returncode, 0, ran.stderr)
|
||||
self.assertEqual(self.head(), "v0.3.0")
|
||||
self.assertIn("Moved from v0.1.0 to v0.3.0.", ran.stdout)
|
||||
self.assertIn(f"Moved {self.target} from v0.1.0 to v0.3.0.", ran.stdout)
|
||||
self.assertIn("## 0.3.0\n\n- Third: run `make thing` once.", ran.stdout)
|
||||
self.assertIn("## 0.2.0\n\n- Second.", ran.stdout)
|
||||
self.assertNotIn("First.", ran.stdout)
|
||||
@@ -90,7 +90,7 @@ class SelfUpdate(unittest.TestCase):
|
||||
|
||||
def test_says_so_where_the_clone_is_on_the_newest_tag_already(self):
|
||||
ran = self.update()
|
||||
self.assertEqual((ran.returncode, ran.stdout), (0, "Already on v0.1.0, the newest release.\n"))
|
||||
self.assertEqual((ran.returncode, ran.stdout), (0, f"{self.target} is already on v0.1.0, the newest release.\n"))
|
||||
|
||||
def test_refuses_an_uncommitted_change_to_a_tracked_file_and_leaves_the_clone_as_it_was(self):
|
||||
self.release("0.2.0", "- Second.\n", '{"theme": "dark"}\n')
|
||||
|
||||
Reference in New Issue
Block a user