equal
deleted
inserted
replaced
326 with the strings INFILE and OUTFILE replaced by the real names of |
326 with the strings INFILE and OUTFILE replaced by the real names of |
327 the temporary files generated.""" |
327 the temporary files generated.""" |
328 inname, outname = None, None |
328 inname, outname = None, None |
329 try: |
329 try: |
330 infd, inname = pycompat.mkstemp(prefix=b'hg-filter-in-') |
330 infd, inname = pycompat.mkstemp(prefix=b'hg-filter-in-') |
331 fp = os.fdopen(infd, 'wb') |
331 |
332 fp.write(s) |
332 with os.fdopen(infd, 'wb') as fp: |
333 fp.close() |
333 fp.write(s) |
|
334 |
334 outfd, outname = pycompat.mkstemp(prefix=b'hg-filter-out-') |
335 outfd, outname = pycompat.mkstemp(prefix=b'hg-filter-out-') |
335 os.close(outfd) |
336 os.close(outfd) |
336 cmd = cmd.replace(b'INFILE', inname) |
337 cmd = cmd.replace(b'INFILE', inname) |
337 cmd = cmd.replace(b'OUTFILE', outname) |
338 cmd = cmd.replace(b'OUTFILE', outname) |
338 code = system(cmd) |
339 code = system(cmd) |