Artifact c7e6cf3edd806b9f8c83fd7239d3ce99d587eccfaac4578e14dbe471714f3cba:
- File
cli/repo_timeline_horizon_test.go
— part of check-in
[ee3ccc7c67]
at
2026-10-22 17:21:12
on branch feat/horizon-cones
— feat(history): render a horizon boundary as the horizon
A parent the origin labelled below a structural horizon is the horizon itself (draft-fossil-horizon-00 5.4), but the history views showed it as a bare parent hash, and the ancestry walk tried to read an event for it.
LogEntry and TimelineEntry gain HorizonParents, the subset of Parents that carries a boundary label; Ancestry ends at such a parent without an error; repo timeline prints it as "parent: <hash> (horizon)". An absent parent that is not labelled is transit and renders as before. (user: [email protected], size: 1586) [annotate] [blame] [check-ins using] [more...]
package cli import ( "path/filepath" "strings" "testing" ) // In a structural store the parent of the horizon check-in is a boundary // hash: the timeline shows it as the horizon, never as a missing parent // (draft-fossil-horizon-00 ยง5.4). func TestRepoTimelineRendersHorizon(t *testing.T) { url, c1, c2, _ := horizonSource(t) path := filepath.Join(t.TempDir(), "s.fossil") requiredHTTPStdout(t, func() error { return (&RepoCloneCmd{URL: url, Path: path, Horizon: c2, Structural: true}).Run(&Globals{}) }) var runErr error out := requiredHTTPStdout(t, func() error { runErr = (&RepoTimelineCmd{Limit: 20}).Run(&Globals{Repo: path}) return nil }) if runErr != nil { t.Fatalf("timeline: %v", runErr) } if want := " parent: " + c1 + " (horizon)\n"; !strings.Contains(out, want) { t.Fatalf("timeline lacks %q:\n%s", want, out) } if strings.Contains(out, "missing") { t.Fatalf("timeline describes the horizon as damage:\n%s", out) } if strings.Count(out, "(horizon)") != 1 { t.Fatalf("timeline names the horizon more than once:\n%s", out) } } // A repository without a horizon prints no parent lines. func TestRepoTimelineNoHorizonLines(t *testing.T) { url, _, _, _ := horizonSource(t) path := filepath.Join(t.TempDir(), "plain.fossil") requiredHTTPStdout(t, func() error { return (&RepoCloneCmd{URL: url, Path: path}).Run(&Globals{}) }) out := requiredHTTPStdout(t, func() error { return (&RepoTimelineCmd{Limit: 20}).Run(&Globals{Repo: path}) }) if strings.Contains(out, "parent:") { t.Fatalf("plain timeline prints parents:\n%s", out) } }