Problem on subversion using propset with perl on a svn:external

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi all,
i'm working to create some perl scripts to make changes on a svn(subversion)
respository. 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


under this directory there are two svn:externals:

[laforge:302]$svn propget svn:externals
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 =
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";
            my @exter=split(/\s+/,$external);
                print "+++++++++++++++++++++\n";
                print "\tName: $exter[0]\n";
                print "\tUrl:  $exter[1]\n";
            if ( $exter[0] eq "stable" ) {
            $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;
} else {
    print "Value:\n";
    print $value;    

Running the script i have an error during the operation:

Connect operation
Set log message
Get svn:external

develop http://localhost/svn/testing/main/mail/trunk

External1: stable
        Name: stable
External2: develop      http://localhost/svn/testing/main/mail/trunk
        Name: develop
        Url:  http://localhost/svn/testing/main/mail/trunk

Set svn:external

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
./ line 84
 at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/SVN/ line
        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/ line 927
        SVN::Client::__ANON__(undef, 'svn:externals', 'stable
'http://localhost/svn/testing/develop_area/mail', 0) called
at ./ 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:

Anyone have an idea about this problem ?
Any idea on how change a svn:externals via perl on a remote repository?

Thank you

Re: Problem on subversion using propset with perl on a svn:external

If someone need something that change a svn:external on a remote svn repository
can try to start with lines of code.
The problem is that the SVN::Client not support the change of the prop in a
remote repository (the command line yes with
propedit...). So the idea is to get the url, checkout it, change on the working
copy, commit, and remove the temporary
working copy...
If someone need to do something like this, this is a base, so you don't loose
time like me to understand why not work...

use SVN::Client;
use File::Remove 'remove';

sub svnupdateexternals {
    my ($svn_ext_ctx,$svn_ext_url,$svn_ext_link,$svn_ext_target) = @_;
    my $recursive = "0";
    my $svn_ext_path = "/tmp/external-update-".$$;
    my $svn_ext_name="svn:externals";
    my $svn_ext_rev="HEAD";
    my $svn_ext_force="0";
    my $svn_ext_hash =
    my $svn_ext_newexternal="";
    my $svn_ext_setprop="";
    my $svn_ext_count="1";
    my ($svn_ext_key, $svn_ext_value) = each(%$svn_ext_hash);
        print "Key:$svn_ext_key\n\nValue:\n$svn_ext_value\n";
    foreach (split(/\n/,$svn_ext_value)) {
                        my $svn_ext_external=$_;
            #if you want some useful message uncoment print lines
                        #print "-----------------\n";
                        #print "External$svn_ext_count: $svn_ext_external\n";
            my @svn_ext_exter=split(/\s+/,$svn_ext_external);
                #if you want some useful message uncoment print lines
                #print "+++++++++++++++++++++\n";
                #print "\tName: $svn_ext_exter[0]\n";
                #print "\tUrl:  $svn_ext_exter[1]\n";
            if ( $svn_ext_exter[0] eq $svn_ext_link ) {

    print "\n\n\n";
    if ( $svn_ext_setprop eq "1" ) {
        #if you want some useful message uncoment print lines
        #print "Set svn:external\n";
        #print "================\n";
        #print "Key:$svn_ext_key\n\n";    
        #print "Value:\n";
        #print "Tmpdir: $svn_ext_path\n";
        #print $svn_ext_newexternal;
        my $svn_ext_logmsg="Operation: Change svn:externals\nRepo path:
        #print "Log message: $svn_ext_logmsg";
        $svn_ext_ctx->checkout($svn_ext_url, $svn_ext_path, "HEAD", $recursive);
        $svn_ext_ctx->commit($svn_ext_path, $recursive);
        remove( , $svn_ext_path );
    } else {
        #if you want some useful message uncoment print lines
        #print "Value:\n";
        #print $svn_ext_value;    

#This is equivalent of the example in the doc to set the message in a svn
sub svnsetlogmsg {
    my ($svn_log_ctx, $svn_set_log_mesg) = @_;
    my $svn_set_log_msg_handler = sub {
            my $stringptr = shift;
        $$stringptr = $svn_set_log_mesg;
            return 1;

Hartigan wrote:
Quoted text here. Click to load it
[Big cut!!!]
Quoted text here. Click to load it

Site Timeline