# HG changeset patch # User Alexander Stepanenko # Date 1418598373 -10800 # Node ID b443b42afe6f3351a86ab6f16dfaca2a4e7a9bbf # Parent 73d048325dfdc5922cb28557cd8449bbadb5fc49 Convert unicode to ascii for mercurial API. Mercurial API can't work with python's Unicode objects. Details http://mercurial.selenic.com/wiki/EncodingStrategy#Unicode_strings diff -r 73d048325dfd -r b443b42afe6f review/web.py --- a/review/web.py Fri Dec 12 10:36:19 2014 +0100 +++ b/review/web.py Mon Dec 15 02:06:13 2014 +0300 @@ -173,6 +173,7 @@ @app.route('/changeset//', methods=['GET', 'POST']) def changeset(revhash): + revhash = revhash.encode('ascii') if request.method == 'POST': signoff = request.form.get('signoff', None) if signoff and not app.read_only: @@ -197,6 +198,7 @@ def patch(revhash): result = StringIO.StringIO() try: + revhash = revhash.encode('ascii') diff_opts = _patch.diffopts(app.ui, {'git': True}) cmdutil.export(g.datastore.target, [revhash], fp=result, opts=diff_opts) except error.RepoLookupError: