--- a/viewer.py Mon Jul 04 18:06:48 2016 +0800
+++ b/viewer.py Mon Jul 04 18:27:36 2016 +0800
from collections import OrderedDict
+from subprocess import check_output, Popen, PIPE
from urllib import quote_plus
from tornado.escape import xhtml_escape
- output = subprocess.check_output([HG, 'log', '-R', TESTHGREPO, '-T', 'json', '-r', revset])
+ output = check_output([HG, 'log', '-R', TESTHGREPO, '-T', 'json', '-r', revset])
return json.loads(output)
template = '{rev}:{node|short} {tags} {date|isodate} {author|user} {desc|firstline|strip}\n {node}\n\n'
revset = 'first({}:0, {})'.format(rev, revcount)
cmd = [HG, 'log', '-R', TESTHGREPO, '-G', '-T', template, '-r', revset]
- graph = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+ graph = Popen(cmd, stdout=PIPE)
while graph.poll() is None:
line = graph.stdout.readline()
matches = regex.findall(line)