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

SWIG bindings (Perl)

From: Giulio Troccoli <Giulio.Troccoli_at_uk.linedata.com>
Date: Mon, 4 Jan 2010 16:01:40 +0000

Hi everyone.

I am really struggling to understand how correctly use the bindings.

I have compiled Subversion 1.6.5 with Perl bindings. Subversion itself works perfectly. We have a series of scripts written in ksh at the moment but I'm working on rewriting them in Perl.

I have now reached a point where I need to detect tree conflicts after a status command.

The following subroutine works just fine

sub status_wc {
   my ($ctx_ref, $wc_path, $status_func_ref) = @_;

   ### Create a new client and authenticate, if necessary
   &$get_new_client($ctx_ref) unless (defined($$ctx_ref));

   ### Get the status of the working copy and process it;
   my $recursive = 1;
   my $get_all = 0;
   my $update = 0;
   my $no_ignore = 1;
   SVN::Client::status($$ctx_ref, $wc_path, 'HEAD', $status_func_ref, $recursive, $get_all, $update, $no_ignore);
}

My function to check the status is called and it prints the status of every file (well, every file that SVN has something to report about).

      my ($path, $status) = @_;
      say "none" if ($status->text_status() eq $SVN::Wc::Status::none);
      say "unversioned" if ($status->text_status() eq $SVN::Wc::Status::unversioned);
      say "normal" if ($status->text_status() eq $SVN::Wc::Status::normal);
      say "added" if ($status->text_status() eq $SVN::Wc::Status::added);
      say "missing" if ($status->text_status() eq $SVN::Wc::Status::missing);
      say "deleted" if ($status->text_status() eq $SVN::Wc::Status::deleted);
      say "replaced" if ($status->text_status() eq $SVN::Wc::Status::replaced);
      say "modified" if ($status->text_status() eq $SVN::Wc::Status::modified);
      say "merged" if ($status->text_status() eq $SVN::Wc::Status::merged);
      say "conflicted" if ($status->text_status() eq $SVN::Wc::Status::conflicted);
      say "ignored" if ($status->text_status() eq $SVN::Wc::Status::ignored);
      say "obstructed" if ($status->text_status() eq $SVN::Wc::Status::obstructed);
      say "external" if ($status->text_status() eq $SVN::Wc::Status::external);
      say "incomplete" if ($status->text_status() eq $SVN::Wc::Status::incomplete);

SVN::Client::status does not however have a way to report tree conflict (or I don't know how to).

I have tried to add the following at the end
      say "tree conflict" if ($status->tree_conflict);

But get the error

Can't locate object method "tree_conflict" via package "_p_svn_wc_status_t"

I have a ksh script that reproduce a tree conflict if anyone is interested.

Can anybody help me?

Thanks
Giulio

Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851 VAT Reg No 778499447
Received on 2010-01-04 17:02:19 CET

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.