diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-30 17:05:12 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-07-30 17:56:23 -0300 |
| commit | 8ec4e135e318c7799b2576a8729493c063da4a97 (patch) | |
| tree | ab37cdbb7f478eb996264cf941891f127f303c85 /vrsite/jj.go | |
| parent | cb05c363045bf0e7af5858f6d7bc26f026fa9d70 (diff) | |
| download | notevi-8ec4e135e318c7799b2576a8729493c063da4a97.tar.gz notevi-8ec4e135e318c7799b2576a8729493c063da4a97.zip | |
Diffstat (limited to 'vrsite/jj.go')
| -rw-r--r-- | vrsite/jj.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vrsite/jj.go b/vrsite/jj.go index 55f4795..bb95d83 100644 --- a/vrsite/jj.go +++ b/vrsite/jj.go @@ -89,6 +89,24 @@ func resolveChange(repo, rev string) (string, error) { return id, nil } +// changeBrief resolves a revset to the one change it names, with everything a +// page says about it. One call answers both "which change" and "which commit +// is under it right now" — the second is what content is cached against, since +// a change id is a pointer and the commit beneath it is rewritten on every +// edit. +func changeBrief(repo, rev string) (Row, error) { + rows, err := LogRows(repo, rev, "", 1) + if err != nil { + return Row{}, err + } + for _, r := range rows { + if !r.Blank() { + return r, nil + } + } + return Row{}, fmt.Errorf("revset %q matches no change", rev) +} + func fileList(repo, rev string) ([]string, error) { out, err := jjRun(repo, "file", "list", "-r", rev) if err != nil { |
