diff --git a/sample-plugins/commit_ticket_update.py b/sample-plugins/commit_ticket_update.py
|
a
|
b
|
|
| 275 | 275 | "ticket)", class_='hint') |
| 276 | 276 | if ChangesetModule(self.env).wiki_format_messages: |
| 277 | 277 | return tag.div(format_to_html(self.env, |
| 278 | | formatter.context('changeset', (reponame, changeset.rev)), |
| | 278 | formatter.context('changeset', changeset.rev, |
| | 279 | parent=Resource('repository', reponame)), |
| 279 | 280 | changeset.message, escape_newlines=True), class_='message') |
| 280 | 281 | else: |
| 281 | 282 | return tag.pre(changeset.message, class_='message') |
diff --git a/trac/mimeview/api.py b/trac/mimeview/api.py
|
a
|
b
|
|
| 128 | 128 | |
| 129 | 129 | @classmethod |
| 130 | 130 | def from_request(cls, req, resource=None, id=False, version=False, |
| 131 | | absurls=False): |
| | 131 | parent=False, absurls=False): |
| 132 | 132 | """Create a rendering context from a request. |
| 133 | 133 | |
| 134 | 134 | The `perm` and `href` properties of the context will be initialized |
| … |
… |
|
| 158 | 158 | else: |
| 159 | 159 | href = None |
| 160 | 160 | perm = None |
| 161 | | self = cls(Resource(resource, id=id, version=version), href=href, |
| 162 | | perm=perm) |
| | 161 | self = cls(Resource(resource, id=id, version=version, parent=parent), |
| | 162 | href=href, perm=perm) |
| 163 | 163 | self.req = req |
| 164 | 164 | return self |
| 165 | 165 | |
| … |
… |
|
| 172 | 172 | context = context.parent |
| 173 | 173 | return '<%s %s>' % (type(self).__name__, ' - '.join(reversed(path))) |
| 174 | 174 | |
| 175 | | def __call__(self, resource=None, id=False, version=False): |
| | 175 | def __call__(self, resource=None, id=False, version=False, parent=False): |
| 176 | 176 | """Create a nested rendering context. |
| 177 | 177 | |
| 178 | 178 | `self` will be the parent for the new nested context. |
| … |
… |
|
| 196 | 196 | True |
| 197 | 197 | """ |
| 198 | 198 | if resource: |
| 199 | | resource = Resource(resource, id=id, version=version) |
| | 199 | resource = Resource(resource, id=id, version=version, |
| | 200 | parent=parent) |
| 200 | 201 | else: |
| 201 | 202 | resource = self.resource |
| 202 | 203 | context = Context(resource, href=self.href, perm=self.perm) |
diff --git a/trac/resource.py b/trac/resource.py
|
a
|
b
|
|
| 187 | 187 | resource.parent = parent |
| 188 | 188 | return resource |
| 189 | 189 | |
| 190 | | |
| 191 | 190 | def __call__(self, realm=False, id=False, version=False, parent=False): |
| 192 | 191 | """Create a new Resource using the current resource as a template. |
| 193 | 192 | |
| … |
… |
|
| 206 | 205 | >>> repr(Resource(None).child('attachment', 'file.txt')) |
| 207 | 206 | "<Resource u', attachment:file.txt'>" |
| 208 | 207 | """ |
| 209 | | return self.__call__(realm, id, version, self) |
| 210 | | |
| | 208 | return Resource(realm, id, version, self) |
| 211 | 209 | |
| 212 | 210 | |
| 213 | 211 | class ResourceSystem(Component): |
diff --git a/trac/versioncontrol/api.py b/trac/versioncontrol/api.py
|
a
|
b
|
|
| 33 | 33 | from trac.web.api import IRequestFilter |
| 34 | 34 | |
| 35 | 35 | |
| | 36 | def split_vc_resource(resource): |
| | 37 | """Split a versioncontrol resource into reponame and path.""" |
| | 38 | assert resource.parent.realm == 'repository' |
| | 39 | return (resource.parent.id, resource.id) |
| | 40 | |
| | 41 | |
| 36 | 42 | class IRepositoryConnector(Interface): |
| 37 | 43 | """Provide support for a specific version control system.""" |
| 38 | 44 | |
| … |
… |
|
| 343 | 349 | |
| 344 | 350 | # IResourceManager methods |
| 345 | 351 | |
| 346 | | # Note: with multiple repository support, the repository name becomes |
| 347 | | # part of the 'id', which becomes a `(reponame, rev or path)` pair. |
| 348 | | |
| 349 | 352 | def get_resource_realms(self): |
| 350 | 353 | yield 'changeset' |
| 351 | 354 | yield 'source' |
| | 355 | yield 'repository' |
| 352 | 356 | |
| 353 | 357 | def get_resource_description(self, resource, format=None, **kwargs): |
| 354 | | reponame, id = resource.id |
| 355 | 358 | if resource.realm == 'changeset': |
| | 359 | (reponame, id) = split_vc_resource(resource) |
| 356 | 360 | if reponame: |
| 357 | 361 | return _("Changeset %(rev)s in %(repo)s", rev=id, repo=reponame) |
| 358 | 362 | else: |
| 359 | 363 | return _("Changeset %(rev)s", rev=id) |
| 360 | 364 | elif resource.realm == 'source': |
| | 365 | (reponame, id) = split_vc_resource(resource) |
| 361 | 366 | version = in_repo = '' |
| 362 | 367 | if format == 'summary': |
| 363 | 368 | repos = resource.env.get_repository(reponame) |
| … |
… |
|
| 375 | 380 | if reponame: |
| 376 | 381 | in_repo = _(" in %(repo)s", repo=reponame) |
| 377 | 382 | return ''.join([kind, ' ', id, version, in_repo]) |
| | 383 | elif resource.realm == 'repository': |
| | 384 | return _("Repository %(repo)s", repo=resource.id) |
| 378 | 385 | |
| 379 | 386 | def get_resource_url(self, resource, href, **kwargs): |
| 380 | | if resource and resource.realm in ('source', 'changeset'): |
| 381 | | repos, id = resource.id |
| 382 | | if resource.realm == 'source': |
| 383 | | return href.source(repos, id) |
| 384 | | else: |
| 385 | | return href.changeset(id, repos) |
| | 387 | if resource.realm == 'changeset': |
| | 388 | (reponame, id) = split_vc_resource(resource) |
| | 389 | return href.changeset(id, reponame) |
| | 390 | elif resource.realm == 'source': |
| | 391 | (reponame, id) = split_vc_resource(resource) |
| | 392 | return href.source(reponame, id) |
| | 393 | elif resource.realm == 'repository': |
| | 394 | return href.source(resource.id) |
| 386 | 395 | |
| 387 | 396 | # IRepositoryProvider methods |
| 388 | 397 | |
| … |
… |
|
| 524 | 533 | """ |
| 525 | 534 | while context: |
| 526 | 535 | if context.resource.realm in ('source', 'changeset'): |
| 527 | | return context.resource.id[0] |
| | 536 | return context.resource.parent.id |
| 528 | 537 | context = context.parent |
| 529 | 538 | |
| 530 | 539 | def get_all_repositories(self): |
diff --git a/trac/versioncontrol/svn_prop.py b/trac/versioncontrol/svn_prop.py
|
a
|
b
|
|
| 21 | 21 | from genshi.builder import tag |
| 22 | 22 | |
| 23 | 23 | from trac.core import * |
| 24 | | from trac.versioncontrol import NoSuchNode |
| | 24 | from trac.versioncontrol import NoSuchNode, split_vc_resource |
| 25 | 25 | from trac.versioncontrol.svn_fs import _path_within_scope |
| 26 | 26 | from trac.versioncontrol.web_ui.browser import IPropertyRenderer |
| 27 | 27 | from trac.versioncontrol.web_ui.changeset import IPropertyDiffRenderer |
| … |
… |
|
| 147 | 147 | has_eligible = name in ('svnmerge-integrated', 'svn:mergeinfo') |
| 148 | 148 | revs_label = (_('merged'), _('blocked'))[name.endswith('blocked')] |
| 149 | 149 | revs_cols = has_eligible and 2 or None |
| 150 | | (reponame, target_path) = context.resource.id |
| | 150 | (reponame, target_path) = split_vc_resource(context.resource) |
| 151 | 151 | repos = self.env.get_repository(reponame) |
| 152 | 152 | target_rev = context.resource.version |
| 153 | 153 | if has_eligible: |
| … |
… |
|
| 170 | 170 | deleted = False |
| 171 | 171 | try: |
| 172 | 172 | node = repos.get_node(spath, target_rev) |
| 173 | | if 'LOG_VIEW' in context.perm('source', spath): |
| | 173 | resource = context.resource.parent.child('source', spath) |
| | 174 | if 'LOG_VIEW' in context.perm(resource): |
| 174 | 175 | row = [_get_source_link(spath, context), |
| 175 | 176 | _get_revs_link(revs_label, context, spath, revs)] |
| 176 | 177 | if has_eligible: |
| … |
… |
|
| 228 | 229 | |
| 229 | 230 | def _get_source_link(spath, context): |
| 230 | 231 | """Return a link to a merge source.""" |
| 231 | | reponame = context.resource.id[0] |
| | 232 | reponame = context.resource.parent.id |
| 232 | 233 | return tag.a('/' + spath, title=_('View merge source'), |
| 233 | 234 | href=context.href.browser(reponame, spath, |
| 234 | 235 | rev=context.resource.version)) |
| … |
… |
|
| 238 | 239 | given, to the revision itself for a single revision, or a `<span>` |
| 239 | 240 | with "no revision" for none. |
| 240 | 241 | """ |
| 241 | | reponame = context.resource.id[0] |
| | 242 | reponame = context.resource.parent.id |
| 242 | 243 | if not revs: |
| 243 | 244 | return tag.span(label, title=_('No revisions')) |
| 244 | 245 | elif ',' in revs or '-' in revs: |
| … |
… |
|
| 262 | 263 | # Build 3 columns table showing modifications on merge sources |
| 263 | 264 | # || source || added revs || removed revs || |
| 264 | 265 | # || source || removed || |
| 265 | | repos = self.env.get_repository(old_context.resource.id[0]) |
| | 266 | repos = self.env.get_repository(old_context.resource.parent.id) |
| 266 | 267 | def parse_sources(props): |
| 267 | 268 | sources = {} |
| 268 | 269 | for line in props[name].splitlines(): |
diff --git a/trac/versioncontrol/templates/browser.html b/trac/versioncontrol/templates/browser.html
|
a
|
b
|
|
| 111 | 111 | <tr py:if="file"> |
| 112 | 112 | <td class="message searchable" py:choose=""> |
| 113 | 113 | <py:when test="wiki_format_messages" xml:space="preserve"> |
| 114 | | ${wiki_to_html(context('changeset', (reponame, file.changeset.rev)), file.changeset.message, escape_newlines=True)} |
| | 114 | ${wiki_to_html(context('changeset', file.changeset.rev, parent=repos_resource), |
| | 115 | file.changeset.message, escape_newlines=True)} |
| 115 | 116 | </py:when> |
| 116 | 117 | <py:otherwise>${file.changeset.message}</py:otherwise> |
| 117 | 118 | </td> |
diff --git a/trac/versioncontrol/templates/changeset.html b/trac/versioncontrol/templates/changeset.html
|
a
|
b
|
|
| 122 | 122 | |
| 123 | 123 | </py:when> |
| 124 | 124 | <py:when test="wiki_format_messages"> |
| 125 | | ${wiki_to_html(context('changeset', (reponame, changeset.rev)), changeset.message, |
| 126 | | escape_newlines=True)} |
| | 125 | ${wiki_to_html(context('changeset', changeset.rev, parent=repos_resource), |
| | 126 | changeset.message, escape_newlines=True)} |
| 127 | 127 | </py:when> |
| 128 | 128 | <py:otherwise><pre>${changeset.message}</pre></py:otherwise> |
| 129 | 129 | </dd> |
diff --git a/trac/versioncontrol/templates/dir_entries.html b/trac/versioncontrol/templates/dir_entries.html
|
a
|
b
|
|
| 24 | 24 | </td> |
| 25 | 25 | <td class="change"> |
| 26 | 26 | <span class="author" py:if="change">${authorinfo(change.author)}:</span> |
| 27 | | <span class="change" py:choose="" py:with="chgset_context = context('changeset', (reponame, change.rev))"> |
| | 27 | <span class="change" py:choose="" |
| | 28 | py:with="chgset_context = context('changeset', change.rev, parent=repos_resource)"> |
| 28 | 29 | <py:when test="not change or 'CHANGESET_VIEW' not in perm(chgset_context.resource)">-</py:when> |
| 29 | 30 | <py:when test="wiki_format_messages"> |
| 30 | 31 | ${change and wiki_to_oneliner(chgset_context, change.message, shorten=True)} |
diff --git a/trac/versioncontrol/templates/repository_index.html b/trac/versioncontrol/templates/repository_index.html
|
a
|
b
|
|
| 28 | 28 | </td> |
| 29 | 29 | <td class="change"> |
| 30 | 30 | <span class="author" py:if="change">${authorinfo(change.author)}:</span> |
| 31 | | <span class="change" py:choose="" py:with="chgset_context = context('changeset', (reponame, change.rev))"> |
| | 31 | <span class="change" py:choose="" |
| | 32 | py:with="chgset_context = context('changeset', change.rev, parent=Resource('repository', reponame))"> |
| 32 | 33 | <em py:when="err" py:content="err" /> |
| 33 | 34 | <py:when test="not change or 'CHANGESET_VIEW' not in perm(chgset_context.resource)">-</py:when> |
| 34 | 35 | <py:when test="wiki_format_messages"> |
diff --git a/trac/versioncontrol/templates/revisionlog.html b/trac/versioncontrol/templates/revisionlog.html
|
a
|
b
|
|
| 110 | 110 | <py:for each="idx, item in enumerate(items)"> |
| 111 | 111 | <py:with vars="change = changes[item.rev]; |
| 112 | 112 | is_separator = item.change is None; |
| 113 | | chgset_context = context('changeset', (reponame, change.rev)); |
| | 113 | chgset_context = context('changeset', change.rev, parent=repos_resource); |
| 114 | 114 | chgset_view = 'CHANGESET_VIEW' in perm(chgset_context.resource); |
| 115 | 115 | odd_even = idx % 2 and 'odd' or 'even'"> |
| 116 | 116 | <!--! highlight copy or rename operations --> |
diff --git a/trac/versioncontrol/templates/revisionlog.rss b/trac/versioncontrol/templates/revisionlog.rss
|
a
|
b
|
|
| 17 | 17 | |
| 18 | 18 | <item py:for="item in items" |
| 19 | 19 | py:with="change = changes[item.rev]; |
| 20 | | item_context = context('changeset', (reponame, change.rev))"> |
| | 20 | item_context = context('changeset', change.rev, parent=repos_resource))"> |
| 21 | 21 | ${author_or_creator(change.author, email_map)} |
| 22 | 22 | <pubDate>${http_date(change.date)}</pubDate> |
| 23 | 23 | <title>Revision $item.rev: ${shorten_line(change.message)}</title> |
diff --git a/trac/versioncontrol/web_ui/browser.py b/trac/versioncontrol/web_ui/browser.py
|
a
|
b
|
|
| 28 | 28 | from trac.mimeview.api import Mimeview, is_binary, get_mimetype, \ |
| 29 | 29 | IHTMLPreviewAnnotator, Context |
| 30 | 30 | from trac.perm import IPermissionRequestor |
| 31 | | from trac.resource import ResourceNotFound, Resource |
| | 31 | from trac.resource import Resource, ResourceNotFound |
| 32 | 32 | from trac.util import embedded_numbers |
| 33 | 33 | from trac.util.compat import all |
| 34 | 34 | from trac.util.datefmt import http_date, utc |
| … |
… |
|
| 41 | 41 | from trac.wiki.api import IWikiSyntaxProvider, IWikiMacroProvider, parse_args |
| 42 | 42 | from trac.wiki.formatter import format_to_html, format_to_oneliner |
| 43 | 43 | from trac.versioncontrol.api import RepositoryManager, NoSuchChangeset, \ |
| 44 | | NoSuchNode |
| | 44 | NoSuchNode, split_vc_resource |
| 45 | 45 | from trac.versioncontrol.web_ui.util import * |
| 46 | 46 | |
| 47 | 47 | |
| … |
… |
|
| 361 | 361 | rev_or_latest = rev or repos.youngest_rev |
| 362 | 362 | node = get_existing_node(req, repos, path, rev_or_latest) |
| 363 | 363 | except NoSuchChangeset, e: |
| 364 | | raise ResourceNotFound(e.message, _('Invalid Changeset Number')) |
| | 364 | raise ResourceNotFound(e.message, |
| | 365 | _('Invalid changeset number')) |
| 365 | 366 | |
| 366 | | context = context('source', (reponame, path), node.created_rev) |
| | 367 | repos_resource = Resource('repository', reponame) |
| | 368 | context = context(repos_resource.child('source', path, |
| | 369 | version=node.created_rev)) |
| 367 | 370 | |
| 368 | 371 | # Prepare template data |
| 369 | 372 | path_links = get_path_links(req.href, reponame, path, rev, order, desc) |
| … |
… |
|
| 390 | 393 | |
| 391 | 394 | data = { |
| 392 | 395 | 'context': context, 'reponame': reponame or None, |
| | 396 | 'repos_resource': repos and repos_resource, |
| 393 | 397 | 'path': path, 'rev': node and node.rev, 'stickyrev': rev, |
| 394 | 398 | 'created_path': node and node.created_path, |
| 395 | 399 | 'created_rev': node and node.created_rev, |
| … |
… |
|
| 789 | 793 | def __init__(self, env, context): |
| 790 | 794 | self.env = env |
| 791 | 795 | self.context = context |
| 792 | | # `context`'s resource is ('source', (reponame, path), version=rev) |
| 793 | | r = context.resource |
| 794 | | self.reponame, self.path = r.id |
| | 796 | (self.reponame, self.path) = split_vc_resource(context.resource) |
| 795 | 797 | self.repos = env.get_repository(self.reponame) |
| 796 | | self.rev = r.version |
| | 798 | self.rev = context.resource.version |
| 797 | 799 | # maintain state |
| 798 | 800 | self.prev_chgset = None |
| 799 | 801 | self.chgset_data = {} |
diff --git a/trac/versioncontrol/web_ui/changeset.py b/trac/versioncontrol/web_ui/changeset.py
|
a
|
b
|
|
| 307 | 307 | data['wiki_format_messages'] = self.wiki_format_messages |
| 308 | 308 | |
| 309 | 309 | if chgset: |
| 310 | | req.perm('changeset', new).require('CHANGESET_VIEW') |
| | 310 | resource = Resource('repository', reponame).child('changeset', new) |
| | 311 | req.perm(resource).require('CHANGESET_VIEW') |
| 311 | 312 | chgset = repos.get_changeset(new) |
| 312 | 313 | |
| 313 | 314 | # TODO: find a cheaper way to reimplement r2636 |
| … |
… |
|
| 408 | 409 | title = _changeset_title(rev) |
| 409 | 410 | |
| 410 | 411 | # Support for revision properties (#2545) |
| 411 | | context = Context.from_request(req, 'changeset', |
| 412 | | (reponame, chgset.rev)) |
| | 412 | repos_resource = Resource('repository', reponame) |
| | 413 | data['repos_resource'] = repos_resource |
| | 414 | context = Context.from_request(req, 'changeset', chgset.rev, |
| | 415 | parent=repos_resource) |
| 413 | 416 | revprops = chgset.get_properties() |
| 414 | 417 | data['properties'] = browser.render_properties('revprop', context, |
| 415 | 418 | revprops) |
| … |
… |
|
| 485 | 488 | # with _that_ node specific history... |
| 486 | 489 | |
| 487 | 490 | options = data['diff']['options'] |
| | 491 | repos_resource = Resource('repository', reponame) |
| 488 | 492 | |
| 489 | 493 | def _prop_changes(old_node, new_node): |
| 490 | | old_source = Resource('source', (reponame, old_node.created_path), |
| 491 | | version=old_node.created_rev) |
| 492 | | new_source = Resource('source', (reponame, new_node.created_path), |
| 493 | | version=new_node.created_rev) |
| | 494 | old_source = Resource('source', old_node.created_path, |
| | 495 | version=old_node.created_rev, |
| | 496 | parent=repos_resource) |
| | 497 | new_source = Resource('source', new_node.created_path, |
| | 498 | version=new_node.created_rev, |
| | 499 | parent=repos_resource) |
| 494 | 500 | old_props = new_props = [] |
| 495 | 501 | if 'FILE_VIEW' in req.perm(old_source): |
| 496 | 502 | old_props = old_node.get_properties() |
| … |
… |
|
| 854 | 860 | |
| 855 | 861 | uids_seen = {} |
| 856 | 862 | def generate_changesets(reponame, repos): |
| | 863 | repos_resource = Resource('repository', reponame) |
| 857 | 864 | for _, changesets in groupby(repos.get_changesets(start, stop), |
| 858 | 865 | key=collapse_changesets): |
| 859 | 866 | viewable_changesets = [] |
| 860 | 867 | for cset in changesets: |
| 861 | | cset_resource = Resource('changeset', |
| 862 | | (reponame, cset.rev)) |
| | 868 | cset_resource = Resource('changeset', cset.rev, |
| | 869 | parent=repos_resource) |
| 863 | 870 | if 'CHANGESET_VIEW' in req.perm(cset_resource): |
| 864 | 871 | repos_for_uid = [reponame] |
| 865 | 872 | uid = repos.get_changeset_uid(cset.rev) |
| … |
… |
|
| 885 | 892 | changesets, show_location, show_files = event[3] |
| 886 | 893 | cset, cset_resource, repos_for_uid = changesets[0] |
| 887 | 894 | message = cset.message or '' |
| 888 | | reponame = cset_resource.id[0] # first repo |
| | 895 | reponame = cset_resource.parent.id |
| 889 | 896 | rev_b, rev_a = cset.rev, cset.rev |
| 890 | 897 | |
| 891 | 898 | if field == 'url': |
| … |
… |
|
| 1001 | 1008 | path = None |
| 1002 | 1009 | |
| 1003 | 1010 | # rendering changeset link |
| 1004 | | if repos and 'CHANGESET_VIEW' in formatter.perm('changeset', |
| 1005 | | (reponame, rev)): |
| | 1011 | resource = Resource('repository', reponame).child('changeset', rev) |
| | 1012 | if repos and 'CHANGESET_VIEW' in formatter.perm(resource): |
| 1006 | 1013 | try: |
| 1007 | 1014 | changeset = repos.get_changeset(rev) |
| 1008 | 1015 | href = formatter.href.changeset(rev, reponame or None, path) |
| … |
… |
|
| 1073 | 1080 | #cset = Resource('repository', reponame).child('changeset' , rev) |
| 1074 | 1081 | #cset = repos.resource.child('changeset' , rev) |
| 1075 | 1082 | #cset = repos.changeset_resource(rev) |
| 1076 | | cset = Resource('changeset', (reponame, rev)) |
| | 1083 | cset = Resource('repository', reponame).child('changeset', rev) |
| 1077 | 1084 | if 'CHANGESET_VIEW' in req.perm(cset): |
| 1078 | 1085 | yield (req.href.changeset(rev, reponame), |
| 1079 | 1086 | '[%s]: %s' % (rev, shorten_line(log)), |
diff --git a/trac/versioncontrol/web_ui/log.py b/trac/versioncontrol/web_ui/log.py
|
a
|
b
|
|
| 26 | 26 | from trac.core import * |
| 27 | 27 | from trac.mimeview import Context |
| 28 | 28 | from trac.perm import IPermissionRequestor |
| | 29 | from trac.resource import Resource |
| 29 | 30 | from trac.util import Ranges |
| 30 | 31 | from trac.util.compat import any |
| 31 | 32 | from trac.util.datefmt import http_date |
| … |
… |
|
| 85 | 86 | |
| 86 | 87 | reponame, repos, path = RepositoryManager(self.env).\ |
| 87 | 88 | get_repository_by_path(path, req.authname) |
| | 89 | repos_resource = Resource('repository', reponame) |
| 88 | 90 | |
| 89 | 91 | normpath = repos.normalize_path(path) |
| 90 | 92 | # if `revs` parameter is given, then we're restricted to the |
| … |
… |
|
| 253 | 255 | if range: |
| 254 | 256 | item_ranges.append(range) |
| 255 | 257 | data = { |
| 256 | | 'context': Context.from_request(req, 'source', (reponame, path)), |
| 257 | | 'reponame': reponame, |
| | 258 | 'context': Context.from_request(req, 'source', path, |
| | 259 | parent=repos_resource), |
| | 260 | 'reponame': reponame, 'repos_resource': repos_resource, |
| 258 | 261 | 'path': path, 'rev': rev, 'stop_rev': stop_rev, |
| 259 | 262 | 'path': path, 'rev': rev, 'stop_rev': stop_rev, |
| 260 | 263 | 'revranges': revranges, |
| … |
… |
|
| 269 | 272 | return 'revisionlog.txt', data, 'text/plain' |
| 270 | 273 | elif req.args.get('format') == 'rss': |
| 271 | 274 | data['context'] = Context.from_request(req, 'source', |
| 272 | | (reponame, path), |
| | 275 | path, parent=repos_resource, |
| 273 | 276 | absurls=True) |
| 274 | 277 | return 'revisionlog.rss', data, 'application/rss+xml' |
| 275 | 278 | |
diff --git a/trac/web/chrome.py b/trac/web/chrome.py
|
a
|
b
|
|
| 666 | 666 | |
| 667 | 667 | d.update({ |
| 668 | 668 | 'context': req and Context.from_request(req) or None, |
| | 669 | 'Resource': Resource, |
| 669 | 670 | 'url_of': get_rel_url, |
| 670 | 671 | 'abs_url_of': get_abs_url, |
| 671 | 672 | 'name_of': partial(get_resource_name, self.env), |