[feature] Readme anchor on repository main page redirects to a non-existant changeset

Issue #267 new
Arthur Tacca created an issue

It's great that the main page for each repository includes a nicely-formatted copy of the README.rst file. I wanted to include a link to this for one of our repositories in our Wiki (rather than copying the README there, because they'll soon get out of sync). Looking at the source HTML, I noticed a line like this:

<div id="readme" class="anchor">

That's great! So I put a link in our Wiki like this:

http://our_server:5050/my_repo_group/my_repo#readme

But this just redirects to

http://our_server:5050/my_repo_group/my_repo/changelog

with an error that the revision doesn't exist. If I open the repo page and then manually type in the anchor and press enter, it briefly flicks down to the correct location before the broken redirection. I realise it's not the end of the world, but it would be nice if this worked.

Anyone that actually does want to reference a particular revision can use a URL ending /changelog/my_revision/ instead of the anchor-based one. (The trailing slash seems to be essential, otherwise you get a 404 error.)

Comments (4)

  1. Mads Kiilerich

    Also, as described on https://www.mercurial-scm.org/repo/hg/help/urls , #revision is a standard notation that it is very nice to support.

    We could perhaps make an exception for #readme ... but that would be an ugly hack.

    It would perhaps be a better solution to have a separate readme URL. The repo front page and the readme will probably have different audience so putting them on the same page might be a bit odd.

  2. Arthur Tacca reporter

    Ah, I didn't realise it's like that in Mercurial, I agree it's nice to be consistent with that (and an exception would be ugly).

    Another idea would be to change the usual preview for all .rst files to use the formatter rather than syntax highlighting (with the raw text still available by clicking "show as raw"); then the formatted readme would be available at e.g.:

    http://our_server:5050/my_repo_group/my_repo/files/tip/README.rst

    Either way, this is just a nice to have, and it's firmly out of the trivial fix territory that I thought it was in.

  3. Log in to comment