özgü yerel ayarlarından çevrilemeyen benim önceden taahhüt kancayla bir sorun var.öncesi işlemek svn kanca: UTF-8
kullanıcı işlediğinde bir dosya kilitli, bu kanca testi. Kötü bir durum gerçekleştiğinde, bu çıkış başka bir kullanıcı bu dosyayı kilitliyor gerektiğini ya da hiç kimse kilitleme ise, bu "(isme file's) Bu dosya mesajı kilitleme değil" göstermesi gerekir. Hata, dosyanın adı "ç" gibi bir latin karaktere sahip olduğunda ve kaplumbağa bunu çıktıda gösterdiğinde gerçekleşir.
Teslim (ayrıntılar izleyin) başarısız oldu: [. Erro çıkış UTF-8'e yerli yerel ayarlarından çevrilemeyen]
Do: öncesi işlemek çıkışı ile kancayı (çıkış kodu 1) tarafından bloke Commit Bunu nasıl çözebilirim biliyor musun?
sayesinde
Alexandre
Benim kabuk komut dosyası burada:
#!/bin/sh
REPOS="$1"
TXN="$2"
export LANG="en_US.UTF-8"
/app/svn/hooks/ensure-has-need-lock.pl "$REPOS" "$TXN"
if [ $? -ne 0 ]; then exit 1; fi
exit 0
Ve perl buradadır:
!/usr/bin/env perl
#Turn on warnings the best way depending on the Perl version.
BEGIN {
if ($] >= 5.006_000)
{ require warnings; import warnings; }
else
{ $^W = 1; }
}
use strict;
use Carp;
&usage unless @ARGV == 2;
my $repos = shift;
my $txn = shift;
my $svnlook = "/usr/local/bin/svnlook";
my $user;
my $ok = 1;
foreach my $program ($svnlook)
{
if (-e $program)
{
unless (-x $program)
{
warn "$0: required program $program' is not executable, ",
"edit $0.\n";
$ok = 0;
}
}
else
{
warn "$0: required program $program' does not exist, edit $0.\n";
$ok = 0;
}
}
exit 1 unless $ok;
unless (-e $repos){
&usage("$0: repository directory $repos' does not exist.");
}
unless (-d $repos){
&usage("$0: repository directory $repos' is not a directory.");
}
foreach my $user_tmp (&read_from_process($svnlook, 'author', $repos, '-t', $txn))
{
$user = $user_tmp;
}
my @errors;
foreach my $transaction (&read_from_process($svnlook, 'changed', $repos, '-t', $txn)){
if ($transaction =~ /^U. (.*[^\/])$/){
my $file = $1;
my $err = 0;
foreach my $locks (&read_from_process($svnlook, 'lock', $repos, $file)){
$err = 1;
if($locks=~ /Owner: (.*)/){
if($1 != $user){
push @errors, "$file : You are not locking this file!";
}
}
}
if($err==0){
push @errors, "$file : You are not locking this file!";
}
}
elsif($transaction =~ /^D. (.*[^\/])$/){
my $file = $1;
my $tchan = &read_from_process($svnlook, 'lock', $repos, $file);
foreach my $locks (&read_from_process($svnlook, 'lock', $repos, $file)){
push @errors, "$1 : cannot delete locked Files";
}
}
elsif($transaction =~ /^A. (.*[^\/])$/){
my $needs_lock;
my $path = $1;
foreach my $prop (&read_from_process($svnlook, 'proplist', $repos, '-t', $txn, '--verbose', $path)){
if ($prop =~ /^\s*svn:needs-lock : (\S+)/){
$needs_lock = $1;
}
}
if (not $needs_lock){
push @errors, "$path : svn:needs-lock is not set. Pleas ask TCC for support.";
}
}
}
if (@errors)
{
warn "$0:\n\n",
join("\n", @errors), "\n\n";
exit 1;
}
else
{
exit 0;
}
sub usage
{
warn "@_\n" if @_;
die "usage: $0 REPOS TXN-NAME\n";
}
sub safe_read_from_pipe
{
unless (@_)
{
croak "$0: safe_read_from_pipe passed no arguments.\n";
}
print "Running @_\n";
my $pid = open(SAFE_READ, '-|');
unless (defined $pid)
{
die "$0: cannot fork: $!\n";
}
unless ($pid)
{
open(STDERR, ">&STDOUT")
or die "$0: cannot dup STDOUT: $!\n";
exec(@_)
or die "$0: cannot exec @_': $!\n";
}
my @output;
while (<SAFE_READ>)
{
chomp;
push(@output, $_);
}
close(SAFE_READ);
my $result = $?;
my $exit = $result >> 8;
my $signal = $result & 127;
my $cd = $result & 128 ? "with core dump" : "";
if ($signal or $cd)
{
warn "$0: pipe from @_' failed $cd: exit=$exit signal=$signal\n";
}
if (wantarray)
{
return ($result, @output);
}
else
{
return $result;
}
}
sub read_from_process
{
unless (@_)
{
croak "$0: read_from_process passed no arguments.\n";
}
my ($status, @output) = &safe_read_from_pipe(@_);
if ($status)
{
if (@output)
{
die "$0: @_' failed with this output:\n", join("\n", @output), "\n";
}
else
{
die "$0: @_' failed with no output.\n";
}
}
else
{
return @output;
}
}
Perl betiğinin kaynağını da görmenin değerli olacağını düşünüyorum. Neden hatanın orada olmadığını varsayıyorsunuz? – amarillion
Sanırım kabuk kabukta veya kaplumbağanın üzerindeyse (Bilmiyorum) bu kabuk yalnızca şunu içeriyorsa, ouca: echo "testç" 1> & 2 aynı hata meydana gelir. Ama perl kodumu koyacağım. –
Bu çözümü 5 gün boyunca arıyorum ve bulamıyorum. Belki bu bir böcek ya da bir şeydir. Birileri neler olup bittiği hakkında bir fikri varsa, ya da bir hata ya da biriyle olsaydı. Teşekkürler –