#2925: [PATCH] send /changeset/$ID?format=diff with correct mimetype
--------------------------------------+-------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: jonas
Type: defect | Status: new
Priority: normal | Milestone:
Component: general | Version: 0.9.4
Severity: minor | Resolution:
Keywords: patch |
--------------------------------------+-------------------------------------
Old description:
> Hi,
>
> this trivial patch allows the unified diffs to be downloaded as
> text/x-patch instead of text/plain, thus allowing people who have this
> mimetype handled by Kompare or similar to get it where they want.
>
> HTH,
> Colin
> --- trac/versioncontrol/web_ui/changeset.py.orig 2006-03-23
> 12:03:01.000000000 +0100
> +++ trac/versioncontrol/web_ui/changeset.py 2006-03-23
> 12:01:31.000000000 +0100
> @@ -260,7 +260,7 @@
> def _render_diff(self, req, repos, chgset, diff_options):
> """Raw Unified Diff version"""
> req.send_response(200)
> - req.send_header('Content-Type', 'text/plain;charset=utf-8')
> + req.send_header('Content-Type', 'text/x-patch;charset=utf-8')
> req.send_header('Content-Disposition', 'inline;'
> 'filename=Changeset%s.diff' % chgset.rev)
> req.end_headers()
New description:
Hi,
this trivial patch allows the unified diffs to be downloaded as
text/x-patch instead of text/plain, thus allowing people who have this
mimetype handled by Kompare or similar to get it where they want.
HTH,
Colin
{{{
--- trac/versioncontrol/web_ui/changeset.py.orig 2006-03-23
12:03:01.000000000 +0100
+++ trac/versioncontrol/web_ui/changeset.py 2006-03-23
12:01:31.000000000 +0100
@@ -260,7 +260,7 @@
def _render_diff(self, req, repos, chgset, diff_options):
"""Raw Unified Diff version"""
req.send_response(200)
- req.send_header('Content-Type', 'text/plain;charset=utf-8')
+ req.send_header('Content-Type', 'text/x-patch;charset=utf-8')
req.send_header('Content-Disposition', 'inline;'
'filename=Changeset%s.diff' % chgset.rev)
req.end_headers()
}}}
Comment (by cboos):
(quoting the patch in the description ''hint: use Preview :)'')
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/2925>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets