Hi all,
i'm working to create some perl scripts to make changes on a svn(subversion)
repository. One of this script try to change a svn:external but i have
a problem to do this with the propset().
I have a testing repository with this path
http://localhost/svn/testing/develop_area/mail
under this directory there are two svn:externals:
[laforge:302]$svn propget svn:externals http://localhost/svn/testing/develop_area/mail/
stable http://localhost/svn/testing/main/mail/branches/maintenance-release-1.64
develop http://localhost/svn/testing/main/mail/trunk
With perl i want to change the stable external to a new branch and this
a expert of the script that try to make this change:
[...]
print "Get svn:external\n";
print "================\n";
my $hash =
$ctx->propget("svn:externals","http://localhost/svn/testing/develop_area/mail",$revision,"0");
my $newexternal="";
my $setprop="";
my ($key, $value) = each(%$hash);
print "Key:$key\n\nValue:\n$value\n";
my $count="1";
foreach (split(/\n/,$value)) {
my $external=$_;
print "-----------------\n";
print "External$count: $external\n";
$count++;
my @exter=split(/\s+/,$external);
print "+++++++++++++++++++++\n";
print "\tName: $exter[0]\n";
print "\tUrl: $exter[1]\n";
if ( $exter[0] eq "stable" ) {
$exter[1]="https://localhost/svn/testing/main/mail/branches/maintenance-release-1.65";
$setprop="1";
}
$newexternal=$newexternal."$exter[0] $exter[1]\n";
}
print "\n\n\n";
if ( $setprop eq "1" ) {
print "Set svn:external\n";
print "================\n";
print "Key:$key\n\n";
print "Value:\n";
print $newexternal;
$ctx->propset("svn:externals",$newexternal,"http://localhost/svn/testing/develop_area/mail","0");
} else {
print "Value:\n";
print $value;
}
[...]
Running the script i have an error during the operation:
[laforge:303]$./update-svn.pl
Connect operation
================
Set log message
================
Get svn:external
================
Key:http://localhost/svn/testing/develop_area/mail
Value:
stable
http://localhost/svn/testing/main/mail/branches/maintenance-release-1.64
develop http://localhost/svn/testing/main/mail/trunk
-----------------
External1: stable
http://localhost/svn/testing/main/mail/branches/maintenance-release-1.64
+++++++++++++++++++++
Name: stable
Url:
http://localhost/svn/testing/main/mail/branches/maintenance-release-1.64
-----------------
External2: develop http://localhost/svn/testing/main/mail/trunk
+++++++++++++++++++++
Name: develop
Url: http://localhost/svn/testing/main/mail/trunk
Set svn:external
================
Key:http://localhost/svn/testing/develop_area/mail
Value:
stable https://localhost/svn/testing/main/mail/branches/maintenance-release-1.65
develop http://localhost/svn/testing/main/mail/trunk
i have this error:
Uncaught exception from user code:
Bogus revision information given: Setting property on non-local target
'http://localhost/svn/testing/develop_area/mail' needs a base revision at ./update-svn.pl line 84
at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/SVN/Core.pm line 632
SVN::Error::croak_on_error('_p_svn_error_t=SCALAR(0x947ff44)') called at
/usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/SVN/Client.pm line 927
SVN::Client::__ANON__(undef, 'svn:externals', 'stable
https://localhost/svn/testing/main/mail/branches/maint...', 'http://localhost/svn/testing/develop_area/mail', 0) called
at ./update-svn.pl line 84
With the cli command i can change the svn:externals without problem.
I'm on linux, distribution Fedora 10
Subversion command-line client, version 1.6.5.
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
Rpm package version:
subversion-1.6.5-1.fc10.1.i386
subversion-perl-1.6.5-1.fc10.1.i386
mod_dav_svn-1.6.5-1.fc10.1.i386
Anyone have an idea about this problem ? Need i to open a bug ?
Any idea on how change a svn:externals via perl on a remote repository?
Thank you
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2414022
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-11-03 08:14:29 CET