Opened 18 years ago
Closed 18 years ago
#5295 closed enhancement (fixed)
[PATCH] Allow "live browsing" of repository contents
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.10.5 |
Component: | version control/browser | Version: | 0.10-stable |
Severity: | normal | Keywords: | export |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Trac provides a way to view the original format of a file (if render_unsafe_content is set to true). The problem is that this simply adds the ?format=raw parameter to the URL. If I view a HTML file with relative links, images, stylesheet, scripts etc. the links will remain the same and an <img src="foo.png" alt=""> will simply cause the browser to not display the image because Trac will only return the original image if <img src="foo.png?format=raw" alt=""> would be specified.
Of course, modifying all links inside HTML files when displaying them as original format is error-prone, inelegant, time-consuming and would pervert the meaning of original format.
ViewVC comes with a clever idea of how to solve this - if a the revision log of a file is accessible through viewvc/path/to/file.html - then viewvc/*checkout*/path/to/file.html will send the contents of that file to the browser - and relative links will work.
I've writen a small patch that makes Trac use /browser/!raw/* instead of /browser/*?format=raw.
Attachments (1)
Change History (9)
by , 18 years ago
Attachment: | trac-browser.patch added |
---|
comment:1 by , 18 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:2 by , 18 years ago
Ups, sorry for the duplicate, I just didn't search for similar bugs in "version control" - only in "browser".
I applied the patch to my installed 0.10 and it works fine (and is even better than my quick solution), so it's not 0.11 specific. Since 0.11 will still take some time until it's finished, would it be possible to merge the patch back to the 0.10 branch?
comment:3 by , 18 years ago
Well, if you have a patch that applies cleanly to 0.10-stable and did some extensive testing, then yes. Otherwise, we try to limit 0.10-stable to bug fixes only.
comment:4 by , 18 years ago
comment:5 by , 18 years ago
I didn't backport anything - the changeset r4242 applies to the 0.10 without any problem. (Well ok, there are a few lines offset while applying the patch, but that doesn't matter at all.)
I tested it on my local machine (x86 arch, Python 2.4, Trac 0.10.4) with a test repository with some simple test data and on test Trac 0.10.4 installation on a server (amd64 arch, Python 2.4) with a production respository containing *lots* of HTML, Stylesheets, Scripts and Images. Works perfectly, as far as I can tell. I can give no guarantee, of course. ;-)
comment:6 by , 18 years ago
Milestone: | → 0.10.5 |
---|---|
Resolution: | duplicate |
Status: | closed → reopened |
comment:8 by , 18 years ago
Keywords: | export added |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
Ok, fine, feature ported in r5370, thanks for your help!
Thanks for the patch, but I already did this a few months ago ;-)
Duplicate of #3579. See [4242] for the current implementation in 0.11.