============================================================
|
|
class Changes(object):
|
215 | 215 | return rv |
216 | 216 | |
217 | 217 | def determine_bounds(self, from_change, to_change): |
218 | | per_page = 10 |
| 218 | per_page = 50 |
219 | 219 | max_per_page = 100 |
220 | 220 | if from_change: from_change = int(from_change) |
221 | 221 | else: from_change = 0 |
… |
… |
class HTMLBranchChanges(Changes):
|
313 | 313 | def GET(self, ctxt, branch, from_change, to_change): |
314 | 314 | Changes.Branch_GET(self, ctxt, branch, from_change, to_change, "branchchanges.html") |
315 | 315 | |
| 316 | class HTMLBranchShortChanges(Changes): |
| 317 | def GET(self, ctxt, branch, from_change, to_change): |
| 318 | Changes.Branch_GET(self, ctxt, branch, from_change, to_change, "branchshortchanges.html") |
| 319 | |
316 | 320 | class RSSBranchChanges(Changes): |
317 | 321 | def GET(self, ctxt, branch, from_change, to_change): |
318 | 322 | Changes.Branch_GET(self, ctxt, branch, from_change, to_change, "branchchangesrss.html") |
… |
… |
class RobotsTxt(object):
|
797 | 804 | # the goal is just to let a robot trawl through the most recent changes, and deny access |
798 | 805 | # to expensive pointless things. We don't want a robot indexing every file in every revision, |
799 | 806 | # as this is an enormous amount of information. |
800 | | for access_method in ['/revision/', '/branch/head/', '/branch/anyhead/', '/branch/changes/from/', '/json/', '/mimeicon/']: |
| 807 | for access_method in ['/revision/', '/branch/head/', '/branch/anyhead/', '/branch/changes/from/', '/branch/shortchanges/from/', '/json/', '/mimeicon/']: |
801 | 808 | disallow = access_method + revision_page |
802 | 809 | if not dbname is None: |
803 | 810 | disallow = '/' + dbname + disallow |
============================================================
|
|
class BranchLink(Link):
|
88 | 88 | def __init__(self, branch, **kwargs): |
89 | 89 | Link.__init__(*(self, ), **kwargs) |
90 | 90 | self.json_args = [branch.name] |
| 91 | if kwargs.get('short_changes'): |
| 92 | prefix = 'branch/shortchanges' |
| 93 | else: |
| 94 | prefix = 'branch/changes' |
91 | 95 | from_change, to_change = kwargs.get('from_change'), kwargs.get('to_change') |
92 | 96 | if from_change and to_change: |
93 | | self.relative_uri = 'branch/changes/%s/from/%d/to/%d' % (urllib.quote(branch.name, safe = ''), from_change, to_change) |
| 97 | self.relative_uri = '%s/%s/from/%d/to/%d' % (prefix, urllib.quote(branch.name, safe = ''), from_change, to_change) |
94 | 98 | else: |
95 | | self.relative_uri = 'branch/changes/' + urllib.quote(branch.name, safe = '') |
| 99 | self.relative_uri = '%s/%s' % (prefix, urllib.quote(branch.name, safe = '')) |
96 | 100 | self.description = hq(branch.name) |
97 | 101 | |
98 | 102 | class DiffLink(Link): |
============================================================
|
|
|
2 | 2 | |
3 | 3 | #def extramenu |
4 | 4 | <strong>Branch $branch.name</strong>: |
| 5 | <a href="$perdb_join('branch/shortchanges/%s' % $urllib_quote($branch.name, safe=''))">Concise Changes</a> | |
5 | 6 | <a href="$perdb_join('branch/changes/%s' % $urllib_quote($branch.name, safe=''))">Changes</a> | |
6 | 7 | <a href="$perdb_join('branch/head/info/%s' % $urllib_quote($branch.name, safe=''))">Head revision</a> | |
7 | 8 | <a href="$perdb_join('branch/tags/%s' % $urllib_quote($branch.name, safe=''))">Tags</a> | |
============================================================
|
|
perdb_urls = (
|
53 | 53 | |
54 | 54 | r'branch/changes/(.*)/from/(\d+)/to/(\d+)', 'HTMLBranchChanges', |
55 | 55 | r'branch/changes/([^/]+)()()', 'HTMLBranchChanges', |
| 56 | r'branch/shortchanges/(.*)/from/(\d+)/to/(\d+)', 'HTMLBranchShortChanges', |
| 57 | r'branch/shortchanges/([^/]+)()()', 'HTMLBranchShortChanges', |
56 | 58 | r'branch/changes/(.*)/from/(\d+)/to/(\d+)/rss', 'RSSBranchChanges', |
57 | 59 | r'branch/changes/([^/]+)()()/rss', 'RSSBranchChanges', |
58 | 60 | r'branch/tags/([^/]+)', 'Tags', |