--- a/review/web.py Tue Jul 20 19:04:57 2010 -0400
+++ b/review/web.py Tue Jul 20 19:05:06 2010 -0400
@@ -6,6 +6,7 @@
from hashlib import md5
from mercurial import cmdutil, commands, error, hg, templatefilters
+from mercurial import patch as _patch
from mercurial.node import short
from mercurial.util import email
@@ -167,7 +168,7 @@
return redirect("%s/changeset/%s/" % (app.site_root, revhash))
-@app.route('/changeset/<revhash>/', methods=['GET', 'POST'])
+@app.route('/changeset/ <revhash>/', methods=['GET', 'POST'])
def changeset(revhash):
if request.method == 'POST':
signoff = request.form.get('signoff', None)
@@ -193,7 +194,8 @@
def patch(revhash):
result = StringIO.StringIO()
try:
- cmdutil.export(g.datastore.target, [revhash], fp=result)
+ diff_opts = _patch.diffopts(app.ui, {'git': True})
+ cmdutil.export(g.datastore.target, [revhash], fp=result, opts=diff_opts)
except error.RepoLookupError:
abort(404)
except UnicodeEncodeError: