Mercurial > hg
comparison contrib/undumprevlog @ 45055:4c1b4805db57
pycompat: change users of pycompat.{stdin,stdout,stderr} to use procutil.std*
On Python 3, pycompat.{stdin,stdout,stderr} are usually block-buffered even if
connected to a TTY. procutil.{stdin,stdout,stderr} provide consistent behavior
across platforms and Python versions.
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Mon, 06 Jul 2020 17:44:25 +0200 |
parents | 99e231afc29c |
children | c102b704edb5 |
comparison
equal
deleted
inserted
replaced
45054:922dbf0df4f1 | 45055:4c1b4805db57 |
---|---|
7 | 7 |
8 import sys | 8 import sys |
9 from mercurial import ( | 9 from mercurial import ( |
10 encoding, | 10 encoding, |
11 node, | 11 node, |
12 pycompat, | |
13 revlog, | 12 revlog, |
14 transaction, | 13 transaction, |
15 vfs as vfsmod, | 14 vfs as vfsmod, |
16 ) | 15 ) |
17 from mercurial.utils import procutil | 16 from mercurial.utils import procutil |
28 if not l: | 27 if not l: |
29 break | 28 break |
30 if l.startswith("file:"): | 29 if l.startswith("file:"): |
31 f = encoding.strtolocal(l[6:-1]) | 30 f = encoding.strtolocal(l[6:-1]) |
32 r = revlog.revlog(opener, f) | 31 r = revlog.revlog(opener, f) |
33 pycompat.stdout.write(b'%s\n' % f) | 32 procutil.stdout.write(b'%s\n' % f) |
34 elif l.startswith("node:"): | 33 elif l.startswith("node:"): |
35 n = node.bin(l[6:-1]) | 34 n = node.bin(l[6:-1]) |
36 elif l.startswith("linkrev:"): | 35 elif l.startswith("linkrev:"): |
37 lr = int(l[9:-1]) | 36 lr = int(l[9:-1]) |
38 elif l.startswith("parents:"): | 37 elif l.startswith("parents:"): |