Artifact 26c184471fd6da76056bf26773213d611d875deb4665d2ef7a34b2537d0e9f65:
- File
conformance/repostate_gaps_test.go
— part of check-in
[58aabe243a]
at
2026-10-12 00:24:04
on branch main
— fix(tag): keep a propagated-tag cancel from deleting newer inherited rows (#288) (#328)
* fix(tag): keep a propagated-tag cancel from deleting newer inherited rows (#288)
The cancel branch of the propagation walk used COALESCE(srcid=0, 0), deleting any inherited row whatever its mtime. fossil's tag_propagate guards both the propagate and cancel cases with srcid=0 AND tagxref.mtime < :mtime: an inherited row newer than the tag is left in place and the walk stops there. Unify the two queries on that guard, parameterizing only the default for a child with no row.
* test(tag): cancel keeps newer inherited rows; bind the propagate default (#288)
Bind the per-type doit default as a query parameter instead of Sprintf-ing it into the SQL, and drop the redundant var rows/var err. Add unit coverage: a cancel skips an inherited row newer than itself and halts the walk there, and re-propagation at equal mtime keeps the first value. (user: [email protected], size: 2299) [annotate] [blame] [check-ins using]
package conformance import "testing" // repostateGaps marks the repository-state cases go-libfossil is known to // fail, by case ID, grouped by the code at fault, each with the issue // tracking its fix. var repostateGaps = map[string]string{ // verify.Rebuild derives only check-ins and control artifacts: no // cluster tag, no technote tags (verify/rebuild_tags.go:47, :65); it // applies a control artifact the crosslink would refuse, having no // isArtifact gate (:56-70); it skips an absent tag target and an absent // parent rather than making a phantom (:124, rebuild_manifest.go:114); it // writes no plink baseline (rebuild_manifest.go:131); and its leaf rule // is "no child at all", whatever the branch (rebuild_leaves.go:16-21). "repostate.4.2.cluster.rebuild": "#285", "repostate.4.2.technote-tags.rebuild": "#285", "repostate.4.4.opaque-control.rebuild": "#285", "repostate.4.2.phantom-target.rebuild": "#285", "repostate.4.2.phantom-parent.rebuild": "#285", "repostate.3.1.link-metadata.rebuild": "#285", "repostate.7.2.branch-leaves.rebuild": "#285", "repostate.7.6.retag-branch.rebuild": "#285", "repostate.7.6.propagated-branch.rebuild": "#285", // Repo.Tag stores the name as given: no sym- prefix, no refusal of the // reserved wiki-, tkt- and event- prefixes (repo_extras.go:39-46, // internal/tag/tag.go:45). "repostate.2.sym-prefix": "#293", "repostate.2.reserved-prefix": "#293", } // repostateDeviations marks the cases where go-libfossil follows fossil(1) // rather than the draft text, by case ID. var repostateDeviations = map[string]string{ "repostate.7.3.parentless-untagged": "follows fossil(1): an untagged parentless " + "check-in is never a leaf, where Section 7.3 makes every check-in without a " + "same-branch child one (erratum candidate)", } // TestRepoStateGapKeys checks that every marked case exists. func TestRepoStateGapKeys(t *testing.T) { ids := map[string]bool{} for _, c := range repostateSuiteCases() { ids[c.ID] = true } for id := range repostateGaps { if !ids[id] { t.Errorf("repostateGaps names %s, which is not a case", id) } } for id := range repostateDeviations { if !ids[id] { t.Errorf("repostateDeviations names %s, which is not a case", id) } } }