Commits

Steve Losh committed de73193

web: it's 2010 -- time to use git diffs

Comments (0)

Files changed (1)

 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
 
 
     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)
 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: