##// END OF EJS Templates
procutil: fix error message of tempfile filter...
Yuya Nishihara -
r37479:538353b8 default
parent child Browse files
Show More
@@ -174,12 +174,12 b' def tempfilter(s, cmd):'
174 os.close(outfd)
174 os.close(outfd)
175 cmd = cmd.replace('INFILE', inname)
175 cmd = cmd.replace('INFILE', inname)
176 cmd = cmd.replace('OUTFILE', outname)
176 cmd = cmd.replace('OUTFILE', outname)
177 code = os.system(cmd)
177 code = system(cmd)
178 if pycompat.sysplatform == 'OpenVMS' and code & 1:
178 if pycompat.sysplatform == 'OpenVMS' and code & 1:
179 code = 0
179 code = 0
180 if code:
180 if code:
181 raise error.Abort(_("command '%s' failed: %s") %
181 raise error.Abort(_("command '%s' failed: %s") %
182 (cmd, explainexit(code)))
182 (cmd, explainexit(code)[0]))
183 with open(outname, 'rb') as fp:
183 with open(outname, 'rb') as fp:
184 return fp.read()
184 return fp.read()
185 finally:
185 finally:
@@ -59,5 +59,14 b' check hg cat operation'
59 this is a test
59 this is a test
60 $ hg -R .. cat --decode ../a.gz | gunzip
60 $ hg -R .. cat --decode ../a.gz | gunzip
61 this is a test
61 this is a test
62 $ cd ..
63
64 check tempfile filter
65
66 $ hg cat a.gz --decode --config 'decode.*.gz=tempfile:gzip -c INFILE > OUTFILE' | gunzip
67 this is a test
68 $ hg cat a.gz --decode --config 'decode.*.gz=tempfile:sh -c "exit 1"'
69 abort: command '*' failed: exited with status 1 (glob)
70 [255]
62
71
63 $ cd ..
72 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now