Download:
child 62:fe5e2ab8ca2d
parent 60:39064bc2bcb4
61:16a9800b0bf3
Anton Shestakov <av6@dwimlabs.net>, Mon, 04 Jul 2016 18:27:36 +0800
viewer: import from subprocess

1 файлов изменено, 3 вставок(+), 3 удалений(-) [+]
viewer.py file | annotate | diff | comparison | revisions
--- a/viewer.py Mon Jul 04 18:06:48 2016 +0800
+++ b/viewer.py Mon Jul 04 18:27:36 2016 +0800
@@ -5,8 +5,8 @@
import os
import re
import sqlite3
-import subprocess
from collections import OrderedDict
+from subprocess import check_output, Popen, PIPE
from urllib import quote_plus
from tornado.escape import xhtml_escape
@@ -25,7 +25,7 @@
def getinfo(revset):
- 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)
@@ -152,7 +152,7 @@
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)