You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by IPv7 Develop Group <de...@ipv7.org> on 2009/10/30 18:27:40 UTC

Problem with revprop_set under perl and svn:external

Hi all,
i'm working to create some perl scripts to make changes on a svn
respository. One of this script try to change a svn:external but i have
a problem to do this with the revprop_set().

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
expert of the script 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->revprop_set("svn:externals",$newexternal,"http://localhost/svn/testing/develop_area/mail",$revision,"1");
} else {
	print "Value:\n";
	print $value;	
}
[...]

Running the script no 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

But if i verify the repoitory i see that no change was made:

[laforge:304]$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

No changes on the repository...

On the apache log for the dav_svn i can see this:
[30/Oct/2009:19:11:00 +0100] - get-dir /develop_area/mail r22794 props
[30/Oct/2009:19:11:01 +0100] deployer change-rev-prop r22794 svn:externals

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 ?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2413080

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Problem with revprop_set under perl and svn:external

Posted by IPv7 Develop Group <de...@ipv7.org>.
Ryan Schmidt wrote:
> On Oct 30, 2009, at 13:27, IPv7 Develop Group wrote:
> 
>> i'm working to create some perl scripts to make changes on a svn
>> respository. One of this script try to change a svn:external but i  
>> have
>> a problem to do this with the revprop_set().
> 
> svn:externals is not a revprop. It is a normal versioned prop.

So to change it, need i to use the propset()?
Like this example of code:
$ctx->propset("svn:externals",$newexternal,"http://localhost/svn/testing/develop_area/mail","0");

But in this case 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

Any idea on how change a svn:externals via perl on a remote repository?


> 
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2413082
> 
> To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2413186

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Problem with revprop_set under perl and svn:external

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Oct 30, 2009, at 13:27, IPv7 Develop Group wrote:

> i'm working to create some perl scripts to make changes on a svn
> respository. One of this script try to change a svn:external but i  
> have
> a problem to do this with the revprop_set().

svn:externals is not a revprop. It is a normal versioned prop.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2413082

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].