[PATCH] hgweb: accept /path/to/file as a shortcut to /file/somehead/path/to/file

Alexander Solovyov alexander at solovyov.net
Sat Apr 30 07:08:14 CDT 2011


On Sat, Apr 30, 2011 at 13:57, Matt Mackall <mpm at selenic.com> wrote:
>> hgweb: accept /path/to/file as a shortcut to /file/somehead/path/to/file
>>
>> If you open http://host/filename (which is not a valid command from
>> hgweb.webcommands), now hgweb will go through heads and seek for a 'filename' in
>> them.
>
> This strikes me as too magical.

Eh, it is a bit, but it's so much nicer to be able to write some url
to file by hand - I'm always stuck for a few seconds remembering the
exact syntax (/file/cset/path), and it's quite common operation I
think to give a link to a file to someone.

I did it a bit wrong in this patch, it should be a redirect to an url
instead of just returning file view - I can rework it and resend if
this can be accepted. Also, it's a fallback, so it doesn't make
anything harmful...

-- 
Alexander


More information about the Mercurial-devel mailing list