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

Re: How to use SVN::Client status() method?

From: 1arrybarnett <lb99999999_at_aol.com>
Date: Sat, 27 Jun 2009 16:34:38 -0700 (PDT)


Better late than never, I suppose. First of all, status_func is never called
unless: a) the get_all parameter is given (see the SVN::Client perldoc) OR
b) the file is "interesting", in that it isn't up-to-date.

A basic status_func looks like:

sub status_func {
    my ($path, $status) = @_;
    my $actual_status = $status->text_status(); # svn_wc_status_kind enum

On my system, $path is the full pathname to the current file. $status is an
svn_wc_status_t C type as defined in
src/subversion/subversion/include/svn_wc.h of the Alien::SVN CPAN
distribution. If you call $status->text_status() in your status_func, you'll
get a useful file status, BUT it's just a number!! Actually, the result of
$status->text_status() is an svn_wc_status_kind enum (defined in the same
include file). Here's an enum to text conversion array I cribbed from the

my @svn_status2text = (
    '', # status 0 is not defined.
    'does not exist',
    'is not a versioned thing in this wc',
    'exists, but uninteresting',
    'is scheduled for addition',
    'under v.c., but is missing',
    'scheduled for deletion',
    'was deleted and then re-added',
    'text or props have been modified',
    'local mods received repos mods',
    'local mods received conflicting repos mods',
    'is unversioned but configured to be ignored'
    'an unversioned resource is in the way of the versioned resource
    'an unversioned path populated by an svn:externals property
    'a directory doesn't contain a complete entries list



Josef Wolf wrote:
> Hello,
> I'd like to check the status of a working copy with SVN::Client
> status() method.
> I see that the status_func is called for every interesting item.
> But I can not figure out how to find out about the details of the
> status. I can not find any documentation of the svn_wc_status_t
> object.
> Any hints?

View this message in context: http://www.nabble.com/How-to-use-SVN%3A%3AClient-status%28%29-method--tp22529385p24237579.html
Sent from the Subversion Users mailing list archive at Nabble.com.
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-06-28 02:00:50 CEST

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