Show More
@@ -174,12 +174,12 b' def tempfilter(s, cmd):' | |||
|
174 | 174 | os.close(outfd) |
|
175 | 175 | cmd = cmd.replace('INFILE', inname) |
|
176 | 176 | cmd = cmd.replace('OUTFILE', outname) |
|
177 |
code = |
|
|
177 | code = system(cmd) | |
|
178 | 178 | if pycompat.sysplatform == 'OpenVMS' and code & 1: |
|
179 | 179 | code = 0 |
|
180 | 180 | if code: |
|
181 | 181 | raise error.Abort(_("command '%s' failed: %s") % |
|
182 | (cmd, explainexit(code))) | |
|
182 | (cmd, explainexit(code)[0])) | |
|
183 | 183 | with open(outname, 'rb') as fp: |
|
184 | 184 | return fp.read() |
|
185 | 185 | finally: |
@@ -59,5 +59,14 b' check hg cat operation' | |||
|
59 | 59 | this is a test |
|
60 | 60 | $ hg -R .. cat --decode ../a.gz | gunzip |
|
61 | 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 | 72 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now