Mercurial > hg-stable
changeset 1409:964baa35faf8
hgweb: add shortcuts for all the web commands / fix empty arg bug
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 18 Oct 2005 23:05:30 -0700 |
parents | 5010207c3527 |
children | 17703aa4491e |
files | mercurial/hgweb.py |
diffstat | 1 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hgweb.py Tue Oct 18 21:32:51 2005 -0700 +++ b/mercurial/hgweb.py Tue Oct 18 23:05:30 2005 -0700 @@ -291,7 +291,7 @@ for label, rev in l: yield {"label": label, "rev": rev} - yield {"label": "tip", "rev": ""} + yield {"label": "tip", "rev": "tip"} def changelist(**map): parity = (start - end) & 1 @@ -704,11 +704,21 @@ def footer(**map): yield self.t("footer", **map) - + def expand_form(form): shortcuts = { + 'cl': [('cmd', ['changelog']), ('rev', None)], 'cs': [('cmd', ['changeset']), ('node', None)], + 'f': [('cmd', ['file']), ('filenode', None)], + 'fl': [('cmd', ['filelog']), ('filenode', None)], + 'fd': [('cmd', ['filediff']), ('node', None)], + 'fa': [('cmd', ['annotate']), ('filenode', None)], + 'mf': [('cmd', ['manifest']), ('manifest', None)], + 'ca': [('cmd', ['archive']), ('node', None)], + 'tags': [('cmd', ['tags'])], + 'tip': [('cmd', ['changeset']), ('node', ['tip'])], } + for k in shortcuts.iterkeys(): if form.has_key(k): for name, value in shortcuts[k]: