# # # patch "branch.psp" # from [3894425fc394f9bda8755e867ce83e7802834122] # to [a60a0626a606a9640349ead7ec354063a8656533] # # patch "common.py" # from [3e098cfe3f45351c5862f0175255e9d73e0f870d] # to [0cbdb7bb1e1d01d969e90c7ab26c44f5c040ae0e] # # patch "file.psp" # from [4577435a443e0b52f428b215c5856853f631b76d] # to [28f5d897cbd289acf8d43be870f4b3438fb02105] # # patch "index.psp" # from [9671dd9415d1dd7ed98368488aee060bde77cbe1] # to [0b257820d558b3a44081ccba10279e76d9e82555] # # patch "manifest.psp" # from [a1ff2a8d4f3166b174a649341772d60d440ab7b0] # to [fcdfd69429d01f891243d298d3a4eddc268ad7ec] # # patch "monotone.py" # from [09c662fae30bad495524b25d088727ca98633092] # to [b4f6cf2091756a3992836759df138b9a183fdbba] # # patch "revision.psp" # from [0e977e36ee68e44e2afaed2409c966b40dafd854] # to [4af0bccc119512f074c3c639e02ed7acd6e02994] # ============================================================ --- branch.psp 3894425fc394f9bda8755e867ce83e7802834122 +++ branch.psp a60a0626a606a9640349ead7ec354063a8656533 @@ -104,7 +104,12 @@ certdate = parse_timecert(value) if output == 'rss': req.write("\t%s\n" % hq(certdate.strftime("%a, %d %b %Y %H:%M:%S +0000"))) elif name == "branch": - value = link("branch", value) + # hackish, but oh well + if value == branch: + value = None + else: + name = "other_branches" + value = link("branch", value) else: if name == "changelog": quicklog = common.quicklog(value) @@ -112,7 +117,8 @@ elif name == "author": if output == 'rss': req.write("\t%s\n" % (hq(value))) value = '
'.join(map(hq, value.split('\n'))) - certinfo += '%s:%s\n' % (prettify(name), value) + if name != None and value != None: + certinfo += '%s:%s\n' % (prettify(name), value) now = datetime.datetime.utcnow() ago = ago_string(certdate, now) ============================================================ --- common.py 3e098cfe3f45351c5862f0175255e9d73e0f870d +++ common.py 0cbdb7bb1e1d01d969e90c7ab26c44f5c040ae0e @@ -102,6 +102,12 @@ urllib.quote(path)) if description != None: rv += description + "" else: rv = "[" + rv + hq(path + '@' + revision_id[:8]) + ".." + "]" + elif link_type == "fileinbranch": + branch, path = link_to + rv = '' % (urllib.quote(branch), + urllib.quote(path)) + if description != None: rv += description + "" + else: rv = "[" + rv + hq(path + '@' + branch) + "]" elif link_type == "branch": rv = '' % (urllib.quote(link_to)) if description != None: rv += description ============================================================ --- file.psp 4577435a443e0b52f428b215c5856853f631b76d +++ file.psp 28f5d897cbd289acf8d43be870f4b3438fb02105 @@ -31,6 +31,9 @@ raise Exception("No path specified.") path = form['path'] +certs = mt.certs(id) +branch = common.extract_cert_from_certs(certs, "branch") + revision = mt.revision(id) if not revision.has_key('new_manifest'): raise Exception("There is no manifest in this revision ID.") @@ -50,9 +53,13 @@ } req.write(template.header(info)) -req.write('

For more information about the revision containing this file, see its %s page. For other files contained in this revision, see the %s.

' % (link("revision", id, "revision"), link("manifest", id, "manifest"))) +req.write('

For more information about the revision containing this file, see its %s page. For other files contained in this revision, see the %s.

' % \ + (link("revision", id, "revision"), + link("manifest", id, "manifest"))) -req.write('

You can also %s the file verbatim.

' % link("download", [matching_file_id, path], "download")) +req.write('

You can also %s the file verbatim. In addition, this %s will always download the latest revision of the file.

' \ + % (link("download", [matching_file_id, path], "download"), + link("fileinbranch", [branch, path], "link"))) ### FIXME FIXME ### this means having _the entire file_ in memory ============================================================ --- index.psp 9671dd9415d1dd7ed98368488aee060bde77cbe1 +++ index.psp 0b257820d558b3a44081ccba10279e76d9e82555 @@ -23,7 +23,8 @@ # okay, so display the branches %>

-There are <%=len(branches)%> branches in this Monotone database. Each branch +There are <%=len(branches)%> branches in this +Monotone database. Each branch might represent an individual project. If you are new to Monotone, the Monotone tutorial may help you understand these pages better. ============================================================ --- manifest.psp a1ff2a8d4f3166b174a649341772d60d440ab7b0 +++ manifest.psp fcdfd69429d01f891243d298d3a4eddc268ad7ec @@ -97,6 +97,9 @@ found = 0 for ancestor in ancestors: rev = mt.revision(ancestor) + if rev.has_key('old_revision') and len(rev['old_revision']) > 1: + # this is a merge, exclude from our search + continue for type in rev.keys(): for stanza in rev[type]: affected = None @@ -168,7 +171,7 @@ age, author, quicklog = revinfo[rev] author = hq(author or "").replace(' ', ' ') quicklog = hq(quicklog or "") - tr.write('%s %s %s %s%s' % (icon_code, \ + tr.write('%s %s %s%s%s' % (icon_code, \ link("file", [id, file], name), \ link("revision", rev, (age or "").replace(' ', ' '), no_quote=True), author, \ ============================================================ --- monotone.py 09c662fae30bad495524b25d088727ca98633092 +++ monotone.py b4f6cf2091756a3992836759df138b9a183fdbba @@ -222,8 +222,13 @@ error, result = self.automate.run('get_revision', [id]) if error != 0: raise Exception("Unable to get revision %s: %s" % (id, result)) - return self.basic_io_parser(result) + def parents(self, id): + error, result = self.automate.run('parents', [id]) + if error != 0: + raise Exception("Unable to get parents of %s: %s" % (id, result)) + else: + return filter(None, result.split('\n')) def manifest(self, id): error, result = self.automate.run('get_manifest', [id]) if error != 0: ============================================================ --- revision.psp 0e977e36ee68e44e2afaed2409c966b40dafd854 +++ revision.psp 4af0bccc119512f074c3c639e02ed7acd6e02994 @@ -78,8 +78,7 @@

Note: no manifest is associated with this revision and hence it contains no files.

<% else: - # ugh, need to wrap things nicer - req.write('''

Files contained in this revision are listed in its %s.''' % (link("manifest", id, "manifest"))) + req.write('''

You might wish to %s.

''' % (link("manifest", id, "browse this revision's contents"))) %>