Skip to content

Port to rust#11

Merged
jelmer merged 20 commits into
masterfrom
rust
Apr 21, 2026
Merged

Port to rust#11
jelmer merged 20 commits into
masterfrom
rust

Conversation

@jelmer

@jelmer jelmer commented Apr 21, 2026

Copy link
Copy Markdown
Member

No description provided.

jelmer added 20 commits April 21, 2026 23:18
breezy.tsort was relocated to vcsgraph.tsort in the breezy dromedary
rewrite. Try the old import first and fall back, so loggerhead keeps
running against both 3.3 and 3.4+ without changes elsewhere.
Port the loggerhead web viewer from Python to Rust, running alongside
the Python package in the same repository until we're ready to cut
over. Built on axum + askama + breezyshim.

Endpoints implemented (all verified against a live Bazaar branch and
compared structurally against Python loggerhead's output):

  /                           — 308 redirect to /changes
  /changes                    — mainline log, 20 per page
  /revision/<revno>           — metadata, parents, grouped file changes
  /diff/<new>[/<old>]         — downloadable unified-diff attachment
  /+filediff/<new>/<old>/path — per-file diff rendered with similar
  /files[/<revno>[/<path>]]   — directory listing with per-file
                                "Latest Rev" column
  /view/<revno>/<path>        — syntect-highlighted file contents
  /annotate/<revno>/<path>    — blame view
  /download/<revid>/<path>    — raw file download
  /tarball/<revid>            — streamed tgz via breezy.Tree.archive
  /atom                       — Atom feed of mainline
  /+revlog/<revid>            — JSON revision dump
  /search                     — stubbed (bzr-search plugin integration
                                is left for later)
  /static/*                   — CSS/JS/images served from the Python
                                loggerhead/static directory so the
                                Python .pt stylesheets style the
                                Rust output identically

Shared templates/base.html mirrors templates/macros.pt (menu tabs,
branch name, footer) so per-page askama templates match Python's
DOM (class names, IDs, link targets) byte-for-byte where reasonable.
- wire `--prefix` through: nest the router under the prefix and thread
  it into `AppState.url_prefix` so template links include it
- scope the on-disk whole-history cache by branch root, so a single
  cache directory can back multiple branches in directory / user-dirs
  mode without colliding
- /health and /favicon.ico routes, matching Python loggerhead
- /view/<revno>/<dir> now redirects to /files/... instead of 500-ing
- bare /download redirects to /changes
- validate --trunk-dir / --user-dirs mutual requirement
- move static assets from loggerhead/static/ to the repo-root static/
  and update the default search path accordingly
- trim .gitignore to the Rust layout
The apt python3-breezy on ubuntu-latest is 3.3.5, but breezyshim 0.7.16
requires brz >= 3.3.6, causing tests to abort at initialization.
@jelmer
jelmer merged commit 3da53e3 into master Apr 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant