"apply" should not ask anything if it is reading patches from stdin.
"darcs apply --test <patch-set" crashes if the test fails, because it
attempts to ask "Shall I apply them anyway? [yN]":
Running test...
Test failed!
Looks like those patches do not pass the tests.
darcs-2.8.0: <stdin>: hIsTerminalDevice: illegal operation (handle is
closed)
"darcs apply -i <../foo/patch1" crashes too.
Test case:
mkdir foo
cd foo
darcs init
cd ..
darcs get foo
cd foo
echo 123 >file1
darcs add file1
darcs rec --name=patch1 -a
darcs send -a --output=./patch1 --no-edit-description ../foo_0/
cd ../foo_0/
darcs setpref test /bin/false
# Remove < from the next line to see what is going on
darcs apply --test <../foo/patch1
Ilya
Hi,
There is already an issue very similar to this:
http://bugs.darcs.net/issue1648
There is a patch in development, but we are uncertain if the current
solution(take input from tty when using apply interactive) is
worth the user surprise.
Aditya
On Sat, Apr 28, 2012 at 4:56 AM, Ilya Perminov <bugs@darcs.net> wrote:
>
> New submission from Ilya Perminov <iperminov@dwavesys.com>:
>
> "apply" should not ask anything if it is reading patches from stdin.
>
> "darcs apply --test <patch-set" crashes if the test fails, because it
> attempts to ask "Shall I apply them anyway? [yN]":
> Running test...
>
> Test failed!
>
> Looks like those patches do not pass the tests.
> darcs-2.8.0: <stdin>: hIsTerminalDevice: illegal operation (handle is
> closed)
>
>
> "darcs apply -i <../foo/patch1" crashes too.
>
> Test case:
> mkdir foo
> cd foo
> darcs init
> cd ..
> darcs get foo
> cd foo
> echo 123 >file1
> darcs add file1
> darcs rec --name=patch1 -a
> darcs send -a --output=./patch1 --no-edit-description ../foo_0/
> cd ../foo_0/
> darcs setpref test /bin/false
> # Remove < from the next line to see what is going on
> darcs apply --test <../foo/patch1
>
>
> Ilya
>
> ----------
> messages: 15625
> nosy: ilya
> priority: bug
> status: unknown
> title: apply: hIsTerminalDevice: illegal operation (handle is closed)
>
> __________________________________
> Darcs bug tracker <bugs@darcs.net>
> <http://bugs.darcs.net/issue2187>
> __________________________________
> _______________________________________________
> darcs-devel mailing list
> darcs-devel@darcs.net
> http://lists.osuosl.org/mailman/listinfo/darcs-devel
>
--
BSRK Aditya
Hi,
Please ignore "apply -i" part of this bug report, it is the same as
1648. I somehow missed it.
However, failing "apply --test" is a different issue. It happens always,
even when "-i" is not used.
Ilya
Do I understand correctly that the objection is not to apply failing but
to the illegal operation on handle close? It's supposed to fail, as far
as I can tell. Thanks for the tests. Yours are quite readable.
rc <- testTentative repository
when (rc /= ExitSuccess) $ do
when (not $ isInteractive opts) $ exitWith rc
putStrLn $ "Looks like those patches do not pass the tests."
let prompt = "Shall I apply them anyway?"
yn <- promptChar (PromptConfig prompt "yn" [] (Just 'n') [])
case yn of
'y' -> return ()
_ -> exitWith rc
I've tacked on a small refactor task for anybody who wants to work on
this