# # # add_file "branch.psp" # content [dee26545ddf622a6929cdca3d57ecc994702c283] # # add_file "template.py" # content [5fa8881d0de41240ce269ee7c872954e93781c15] # # patch "index.psp" # from [8530dda4f3e1ec795d5959af3e8ff8b927e85811] # to [cc99e564d6cd74b36e6f02933716835ef785d73f] # # patch "monotone.py" # from [bf4c3ac8e895b6e5000f3a805c0d4c17295acf31] # to [af6a530e9a3782c715975ece4705dff54efc8f23] # ============================================================ --- branch.psp dee26545ddf622a6929cdca3d57ecc994702c283 +++ branch.psp dee26545ddf622a6929cdca3d57ecc994702c283 @@ -0,0 +1,61 @@ +<% + +import config +import monotone +import common +import urllib +import template +from template import header,footer +from monotone import Monotone + +reload(template) +reload(monotone) + +psp.set_error_page("error.psp") + +if not form.has_key('branch'): + raise Exception("No branch specified.") +branch = form['branch'] + +mt = Monotone(config.monotone, config.dbfile) + +# +# ok, what are we going to show to the user. +# we need a revision. if none has been provided, then we +# look if there is a single HEAD. If so, display that. +# Otherwise, display list of heads and offer the choice +# to choose them or another revision. +# +revision = None +if not form.has_key('revision'): + heads = mt.heads(branch) + if len(heads) == 0: + raise Exception("No head revision can be determined for this branch.") + elif len(heads) == 1: + revision = heads[0] + else: +%> +
+The following head revisions are available. Please select one to view. +
+<% + for revision in heads: + req.write('%s+Viewing revision: <%=hq(revision)%> +
+ + +<% +req.write(footer(info)) +%> + ============================================================ --- template.py 5fa8881d0de41240ce269ee7c872954e93781c15 +++ template.py 5fa8881d0de41240ce269ee7c872954e93781c15 @@ -0,0 +1,24 @@ + +def header(info): + if not info.has_key("title"): info['title'] = "untitled" + return """\ + + + + +