hgweb: allow urls to be shorter by using shortcuts
for example cs=xxx will be expanded to cmd=changeset;node=xxx
--- a/mercurial/hgweb.py Tue Oct 18 20:06:13 2005 -0700
+++ b/mercurial/hgweb.py Tue Oct 18 20:06:34 2005 -0700
@@ -704,9 +704,23 @@
def footer(**map):
yield self.t("footer", **map)
+
+ def expand_form(form):
+ shortcuts = {
+ 'cs': [('cmd', ['changeset']), ('node', None)],
+ }
+ for k in shortcuts.iterkeys():
+ if form.has_key(k):
+ for name, value in shortcuts[k]:
+ if value is None:
+ value = form[k]
+ form[name] = value
+ del form[k]
self.refresh()
+ expand_form(req.form)
+
t = self.repo.ui.config("web", "templates", templatepath())
m = os.path.join(t, "map")
style = self.repo.ui.config("web", "style", "")