Note:
This page is primarily intended for developers of Mercurial.
Note:
This page is no longer relevant but is kept for historical purposes.
New Web Interface
Rewrite of hgweb
This is just something I'm playing around with, and it may not become 'official'.
There are two basic goals I'm going for in this re-write:
I would like to eliminate GET form variable syntax from most of the URLs. I find URLs that say things like http://selenic.com/repo/hg?ca=68ec7b9e09a4;type=bz2 to be rather ugly and painful to create links to from other places. Additionally, I do not think they convey to a user who sees it exactly what is being linked to.
- I would like to clean up the code and make it obvious which code path is executed for any given URL. I would also like to abstract things sufficiently so that setting up different front ends is easy. For example, currently only CGI, and the simple Python http server are supported. It would be nice to add FastCGI, mod_python, and the Twisted http server, but right now the code makes it hard.
The URLs being used are a human factors issue, and I know that I don't know the best ideas for how they should work. So I'm really interested in what you all have to say about it. The code currently has a fairly generic engine for mapping URLs to functions using regular expressions. It can also pull out named sub-expressions to use as parameters. So, when making suggestions about URLs, keep in mind those limitations, or suggest a better engine.
Things to think about
- Metasyntactic variables:
- deadbeef - hash prefix, possibly the entire hash
- f011beef - the full hash
- revnum - a revision number
- tag - A tag name
- {x,y,z} - One of x, y, or z.
- Reference to changelogs or revisions must allow
- hash (the hash may be short)
- tags (tags with special characters may not be able to be directly referenced)
- Not allow reference to revision #s as we would like to discourage links that may arbitrarily change.
(I don't think this should be restricted -- ThomasArendsenHein 2005-12-05 11:22:45)
- changelog - list of changes with summary
- children in summary
- Any attempt to display DAG?
- changelog - data about single change
- include diffs?
- include children?
- Special display for merges?
- changelog - data about single file
- Do this at all?
- Links to change history for file?
- What to do for files that haven't changed?
- Special raw mode for diff data?
- If raw mode, then what to do about merges?
- revision - the state of the repository at a particular revision
- What about diffs?
- Special raw mode?
- Any kind of color syntax highlighting support?
- Some sort of list of changelog entries that include changes to this file?
- How do changelog entries and revisions relate?
- Allow explicit reference to a manifest rev?
- Allow explicit reference to a file rev?
- Must have some listing of tags
- Do tags link to the changelog or revision?
- Do they link by explicit hash or by tag name?
- If by tag name, do weird tags still link to explicit hash, or some strangely escaped tag name?
- Link to archive link for tag?
- Archives
- Some way of specifying tags?
Commentary
tonfa thinks I should use url.split('/') for speed reasons.
Perhaps this is true, but I feel that choosing that path right now is premature optimization. It's quite possible an optimized URL parser could be written after a good syntax is decided upon. -- EricHopper 2005-11-29 16:55:37
- sky: besides URLs below, I suggest:
Specific suggestions
Here is a suggestion for the format of URLs:
- changelog:
- filelog:
- changeset:
- manifest:
- file:
- raw file:
- annotate:
- filediff:
- raw filediff:
- archive:
- tags: