[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Perl SVN::Client status is sensitive to cwd

From: Leo Davis <ldavis_at_fonix.com>
Date: 2005-04-07 08:26:15 CEST

Hello,

I installed subversion 1.1.4 and the Perl swig bindings for that
release. I have a particular file that I'd like to get the status from
the root of the working copy using an absolute path (or a relative
path). However, I am unable to do so. The client thinks that the files
are not under revision control. However, if I chdir to the directory
containing the file I am able to get the status with both the absolute
and relative path. The 'svn' command line client seems to handle these
cases correctly.

I have tried this on Linux and on Windows, and they behave similarly. I
have attached some sample code to demonstrate this. Here is the output
I get:

calling non-functional status
calling non-functional status with relative path
calling non-functional status from dir using absolute path
**** calling get_status!
calling non-functional status from dir using relative path
**** calling get_status!

I have experienced this sensitivity to cwd with other SVN::Client calls,
but have not looked into them.

Perl on Windows: 5.8.6 (ActiveState Perl)
Perl on Linux: 5.8.5
swig on Linux: 1.3.21
swig on Windows: I don't know, but guess it might be 1.3.21

Leo

#!perl

use warnings;
use strict;

use SVN::Client;
use SVN::Core;
use SVN::Wc;

# callback for authentication
sub simple_prompt {
    my ($cred,$realm,$default_username,$may_save,$pool) = @_;

    $cred->username('username');
    $cred->password('password');
}

our $SVNClient =
        new SVN::Client(
                                        auth => [SVN::Client::get_simple_provider(),
                                                         SVN::Client::get_simple_prompt_provider(\&simple_prompt,2),
                                                         SVN::Client::get_username_provider()]);

undef $SVN::Error::handler;

# chdir to working directory
chdir "_vss2svn/work" or die "could not chdir";

our ($NONFUNCTIONAL);
$NONFUNCTIONAL = 'C:/foo/test2/_vss2svn/work/Workspaces/fTTSTest/fTTSTest.java';

# this does not work
print "calling non-functional status\n";
$SVNClient->status($NONFUNCTIONAL, 'BASE', \&get_status, 0, 1, 1, 0);

print "calling non-functional status with relative path\n";
$SVNClient->status('Workspaces/fTTSTest/fTTSTest.java', 'BASE', \&get_status, 0, 1, 1, 0);

chdir "Workspaces/fTTSTest";

print "calling non-functional status from dir using absolute path\n";
$SVNClient->status($NONFUNCTIONAL, 'BASE', \&get_status, 0, 1, 1, 0);

print "calling non-functional status from dir using relative path\n";
$SVNClient->status('fTTSTest.java', 'BASE', \&get_status, 0, 1, 1, 0);

sub get_status {
    my ($path, $status) = @_;
        print "**** calling get_status!\n";
}

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Apr 7 12:42:56 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.