##// END OF EJS Templates
hgk: stop using util.bytesinput() to read a single line from stdin...
Yuya Nishihara -
r36808:cb0afaf1 default
parent child Browse files
Show More
@@ -51,7 +51,6 b' from mercurial import ('
51 51 pycompat,
52 52 registrar,
53 53 scmutil,
54 util,
55 54 )
56 55
57 56 cmdtable = {}
@@ -105,15 +104,15 b' def difftree(ui, repo, node1=None, node2'
105 104
106 105 while True:
107 106 if opts[r'stdin']:
108 try:
109 line = util.bytesinput(ui.fin, ui.fout).split(' ')
110 node1 = line[0]
111 if len(line) > 1:
112 node2 = line[1]
113 else:
114 node2 = None
115 except EOFError:
107 line = ui.fin.readline()
108 if not line:
116 109 break
110 line = line.rstrip(pycompat.oslinesep).split(b' ')
111 node1 = line[0]
112 if len(line) > 1:
113 node2 = line[1]
114 else:
115 node2 = None
117 116 node1 = repo.lookup(node1)
118 117 if node2:
119 118 node2 = repo.lookup(node2)
@@ -186,12 +185,11 b' def catfile(ui, repo, type=None, r=None,'
186 185 #
187 186 prefix = ""
188 187 if opts[r'stdin']:
189 try:
190 (type, r) = util.bytesinput(ui.fin, ui.fout).split(' ')
191 prefix = " "
192 except EOFError:
188 line = ui.fin.readline()
189 if not line:
193 190 return
194
191 (type, r) = line.rstrip(pycompat.oslinesep).split(b' ')
192 prefix = " "
195 193 else:
196 194 if not type or not r:
197 195 ui.warn(_("cat-file: type or revision not supplied\n"))
@@ -204,10 +202,10 b' def catfile(ui, repo, type=None, r=None,'
204 202 n = repo.lookup(r)
205 203 catcommit(ui, repo, n, prefix)
206 204 if opts[r'stdin']:
207 try:
208 (type, r) = util.bytesinput(ui.fin, ui.fout).split(' ')
209 except EOFError:
205 line = ui.fin.readline()
206 if not line:
210 207 break
208 (type, r) = line.rstrip(pycompat.oslinesep).split(b' ')
211 209 else:
212 210 break
213 211
General Comments 0
You need to be logged in to leave comments. Login now