Mercurial > hg
comparison mercurial/hgweb.py @ 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 | db571bcaa35d |
children | e2ba788545bf |
comparison
equal
deleted
inserted
replaced
1408:5010207c3527 | 1409:964baa35faf8 |
---|---|
289 yield {"rev": 0, "label": "(0)"} | 289 yield {"rev": 0, "label": "(0)"} |
290 | 290 |
291 for label, rev in l: | 291 for label, rev in l: |
292 yield {"label": label, "rev": rev} | 292 yield {"label": label, "rev": rev} |
293 | 293 |
294 yield {"label": "tip", "rev": ""} | 294 yield {"label": "tip", "rev": "tip"} |
295 | 295 |
296 def changelist(**map): | 296 def changelist(**map): |
297 parity = (start - end) & 1 | 297 parity = (start - end) & 1 |
298 cl = self.repo.changelog | 298 cl = self.repo.changelog |
299 l = [] # build a list in forward order for efficiency | 299 l = [] # build a list in forward order for efficiency |
702 def header(**map): | 702 def header(**map): |
703 yield self.t("header", **map) | 703 yield self.t("header", **map) |
704 | 704 |
705 def footer(**map): | 705 def footer(**map): |
706 yield self.t("footer", **map) | 706 yield self.t("footer", **map) |
707 | 707 |
708 def expand_form(form): | 708 def expand_form(form): |
709 shortcuts = { | 709 shortcuts = { |
710 'cl': [('cmd', ['changelog']), ('rev', None)], | |
710 'cs': [('cmd', ['changeset']), ('node', None)], | 711 'cs': [('cmd', ['changeset']), ('node', None)], |
712 'f': [('cmd', ['file']), ('filenode', None)], | |
713 'fl': [('cmd', ['filelog']), ('filenode', None)], | |
714 'fd': [('cmd', ['filediff']), ('node', None)], | |
715 'fa': [('cmd', ['annotate']), ('filenode', None)], | |
716 'mf': [('cmd', ['manifest']), ('manifest', None)], | |
717 'ca': [('cmd', ['archive']), ('node', None)], | |
718 'tags': [('cmd', ['tags'])], | |
719 'tip': [('cmd', ['changeset']), ('node', ['tip'])], | |
711 } | 720 } |
721 | |
712 for k in shortcuts.iterkeys(): | 722 for k in shortcuts.iterkeys(): |
713 if form.has_key(k): | 723 if form.has_key(k): |
714 for name, value in shortcuts[k]: | 724 for name, value in shortcuts[k]: |
715 if value is None: | 725 if value is None: |
716 value = form[k] | 726 value = form[k] |