Skip Menu |
 

This queue is for tickets about the svk CPAN distribution.

Report information
The Basics
Id: 28091
Status: open
Priority: 0/
Queue: svk

People
Owner: Nobody in particular
Requestors: adsb [...] openfoundry
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Please consider adding support for non interactive usage
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 530
Download (untitled) / with headers
text/plain 530b
===================== NOTE ===================== === We are in the process moving bug entries === === from rt.openfoundry.org to rt.cpan.org === === We apologize for any inconvenience === Hi, Please consider making it possible to run e.g. "svk info" non-interactively. The specific use case I have is to allow people to install svk and then run svk info from a script (in order to determine whether the current directory is an svk working directory) without being prompted if svk hasn't been initialised. Thanks, Adam
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Message-ID: <rt-3.6.HEAD-32127-1240697657-1526.28091-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: vincent.legoll [...] gmail.com
X-RT-Original-Encoding: utf-8
Content-Length: 433
Download (untitled) / with headers
text/plain 433b
Yes this would be very valuable, please add a command line option: --dont-create-repository or something like that. BTW it is not practical to workaround the issue by doing it like this: echo 'n' | svk info > /dev/null 2> /dev/null because svk breaks the tty input handling, you'll have to blindly type `stty sane` afterwards to restore proper echo handling. $ svk -v This is svk, version v2.2.1 (using Subversion bindings 1.5.4)
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-32127-1240697657-1526.28091-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Charset: utf8
References: <rt-3.6.HEAD-32127-1240697657-1526.28091-0-0 [...] rt.cpan.org>
Content-Type: multipart/mixed; boundary="----------=_1240756958-10159-304"
Message-ID: <rt-3.6.HEAD-10159-1240756958-1998.28091-0-0 [...] rt.cpan.org>
From: vincent.legoll [...] gmail.com
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1380
Download (untitled) / with headers
text/plain 1.3k
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 ?
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: multipart/mixed; boundary="----------=_1240756958-10159-303"
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: text/x-diff; name="whitespace-cleanup.patch"
Content-Disposition: inline; filename="whitespace-cleanup.patch"
Content-Transfer-Encoding: binary
Content-Length: 314
Index: lib/SVK/XD.pm =================================================================== --- lib/SVK/XD.pm (revision 3150) +++ lib/SVK/XD.pm (working copy) @@ -242,7 +242,7 @@ qr/^[yn]/i, ); next if $ans =~ /^n/i; - $self->_create_depot($path) + $self->_create_depot($path) } return; }
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1240756939-10159-302"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: text/x-diff; name="dont-mess-with-dev-tty-its-not-ours.patch"
Content-Disposition: inline; filename="dont-mess-with-dev-tty-its-not-ours.patch"
Content-Transfer-Encoding: binary
Content-Length: 582
Index: lib/SVK/Util.pm =================================================================== --- lib/SVK/Util.pm (revision 3150) +++ lib/SVK/Util.pm (working copy) @@ -180,15 +180,10 @@ local $| = 1; print $prompt; - local *IN; local *SAVED = *STDIN; local *STDIN = *STDIN; - my $formfeed = ""; - if (!-t STDIN and -r '/dev/tty' and open IN, '<', '/dev/tty') { - *STDIN = *IN; - $formfeed = "\r"; - } + my $formfeed = (IS_WIN32 ? "" : "\r"); require Term::ReadKey; Term::ReadKey::ReadMode(IS_WIN32 ? 'normal' : 'raw');


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.