Closed potatosalad closed 12 years ago
Great addition, thanks.
Sure thing, potatsalad/mercurial-ruby@6d213bbd745987e148c0814395a8be2eab364a95 moves the exit status logic inside the raise_error_if_needed method.
I just realized that this will not work with Ruby 1.8 as wait_thr was added to popen3 only in Ruby 1.9. I will have to revert this until we figure out a way to make both versions work.
This actually reminded me why I didn't do the status check in a first place. There's no simple way to check process exit status in 1.8.
I just pushed a new version of the gem that's using Open4 to check status of the executed commands on 1.8.7.
An error should only be raised if the process exited irregularly (non-zero).
Here's the example case I ran into:
Technically this command was successful, but when running it from the gem...
This pull request allows the previous command to run as expected...
...while still throwing a ruby exception if the exitstatus is not 0