26 Apr 2009 16:34
[PATCH] don't mess with /dev/tty, it's not ours
Vincent Legoll <vincent.legoll <at> gmail.com>
2009-04-26 14:34:32 GMT
2009-04-26 14:34:32 GMT
Hello, I wanted to automate some svk use from a script, but found that even `svk info` is interactive (asking to create a local repo) I tried to overcome the problem with: echo n | svk info but that won't work properly, neither did `expect`, BTW. And add that when doing the above `echo n | svk info` the tty was messed with and left in a bad state: local echo was disabled and has to be restored manually with `stty sane`.Then I though something should already exist to avoid that user interaction, and after some search found the following bug report: #28091: Please consider adding support for non interactive usage. I looked at the code and found the "I'm not given a tty as stdin, let's use /dev/tty" gem (ruby pun intended) in Util.pm::get_prompt(). If you're not given a "real" tty, maybe that's just what the user wants, don't try to be smarter, please. The attached patch remove that code, and allows one to do: echo n | svk info /tmp/this/is/not/a/svk/repo And still have a tty in a good shape afterwards. Ok, this is still a workaround for that there's no command line option to disallow svk from creating a local repository when all we want to know if some directory is a working copy. Maybe the real fix would be not to ask for a local repo creation from SVK::Command::Info, and just return the "%1 is not a checkout path" mantra What do you think ? -- -- Vincent Legoll
_______________________________________________ svk-devel mailing list svk-devel <at> bestpractical.com http://lists.bestpractical.com/cgi-bin/mailman/listinfo/svk-devel
Then I though something should already exist to avoid that user
interaction, and after some search found the following bug report:
#28091: Please consider adding support for non interactive usage.
I looked at the code and found the "I'm not given a tty as stdin,
let's use /dev/tty" gem (ruby pun intended) in Util.pm::get_prompt().
If you're not given a "real" tty, maybe that's just what the user
wants, don't try to be smarter, please.
The attached patch remove that code, and allows one to do:
echo n | svk info /tmp/this/is/not/a/svk/repo
And still have a tty in a good shape afterwards.
Ok, this is still a workaround for that there's no command line
option to disallow svk from creating a local repository when
all we want to know if some directory is a working copy.
Maybe the real fix would be not to ask for a local repo creation
from SVK::Command::Info, and just return the "%1 is not a
checkout path" mantra
What do you think ?
RSS Feed