[issue2296] Symbolic revisions dereferenced in hgweb links

Jesse Glick bugs at mercurial.selenic.com
Wed Jul 21 14:36:16 UTC 2010


New submission from Jesse Glick <jesse.glick at oracle.com>:

Reproducible as of 9e874ee0fe97 (latest stable rev), but long observed. Run
'hg serve' from Hg's own repo and then open e.g.

http://localhost:8000/file/1.6

Now click the 'contrib' link. You might expect to be taken to

http://localhost:8000/file/1.6/contrib

Instead you are taken to

http://localhost:8000/file/f786fc4b8764/contrib

This is just one example, but in general whenever an alternate revision
identifier (tag, branch name, 'tip', 'null', revision number, very
abbreviated or unabbreviated changeset ID) is used in a path component in a
URL where a 12-digit changeset ID is accepted, all outgoing hyperlinks which
refer to the same changeset use the resolved 12-digit ID instead of the
identifier you passed in.

This violates the general expectation that most hyperlinks are relative to a
base URL, e.g. href="util.py". Instead hgweb produces server-absolute URLs
such as href="/file/d320e70442a5/mercurial/util.py".

It is also irritating because you probably had a good reason to construct
the base URL in a certain way. For example, if I want to create a permalink
to the latest stable version of util.py, it would be easiest to start at

http://localhost:8000/branches

then click 'stable', then 'browse', 'mercurial', then 'util.py', ultimately
getting to

http://localhost:8000/file/stable/mercurial/util.py

Instead I am taken to

http://localhost:8000/file/9e874ee0fe97/mercurial/util.py

and need to manually replace the 12-digit ID in the URL with the branch name
I had typed in before.

----------
messages: 13159
nosy: jglick
priority: bug
status: unread
title: Symbolic revisions dereferenced in hgweb links
topic: hgweb

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2296>
____________________________________________________


More information about the Mercurial-devel mailing list