You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/09/28 00:48:56 UTC

svn commit: r1391250 - in /subversion/trunk/subversion/bindings/swig/perl/native: Client.pm Core.pm t/3client.t

Author: breser
Date: Thu Sep 27 22:48:56 2012
New Revision: 1391250

URL: http://svn.apache.org/viewvc?rev=1391250&view=rev
Log:
Add support for status3 function to swig-pl.  Work towards resolving issue #2646

* subversion/bindings/swig/perl/native/Core.pm
  (SVN::Depth::unknown, SVN::Depth::exclude, SVN::Depth::empty, SVN::Depth::files,
   SVN::Depth::immediates, SVN::Depth::infinity): Add.

* subversion/bindings/swig/perl/native/Client.pm
  (status2): Update status2 documentation to just reference status3.
  (status3): Add.

* subversion/bindings/swig/perl/native/t/3client.t
  (status3): Add tests for status3.


Modified:
    subversion/trunk/subversion/bindings/swig/perl/native/Client.pm
    subversion/trunk/subversion/bindings/swig/perl/native/Core.pm
    subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t

Modified: subversion/trunk/subversion/bindings/swig/perl/native/Client.pm
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/Client.pm?rev=1391250&r1=1391249&r2=1391250&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/Client.pm (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/Client.pm Thu Sep 27 22:48:56 2012
@@ -736,6 +736,10 @@ Similar to $ctx-E<gt>status2(), but with
 
 =item $ctx-E<gt>status2($path, $revision, \&status_func, $recursive, $get_all, $update, $no_ignore, $ignore_externals, $pool);
 
+Similar to $ctx-E<gt>status3(), but with the changelists passed as undef, and with recursive instead of depth.
+
+=item $ctx-E<gt>status3($path, $revision, \&status_func, $depth, $get_all, $update, $no_ignore, $ignore_externals, $pool);
+
 Given $path to a working copy directory (or single file), call status_func()
 with a set of svn_wc_status2_t objects which describe the status of $path and
 its children.

Modified: subversion/trunk/subversion/bindings/swig/perl/native/Core.pm
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/Core.pm?rev=1391250&r1=1391249&r2=1391250&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/Core.pm (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/Core.pm Thu Sep 27 22:48:56 2012
@@ -710,6 +710,59 @@ $SVN::Node::dir, $SVN::Node::unknown.
 
 =cut
 
+package SVN::Depth;
+use SVN::Base qw(Core svn_depth_);
+
+=head2 svn_depth_t - SVN::Depth
+
+An enum of the following constants:
+
+=item $SVN::Depth::unknown
+
+Depth undetermined or ignored.  In some contexts, this means the client should
+choose an appropriate default depth.  The server will generally treat it as
+$SVN::Depth::infinity.
+
+=item $SVN::Depth::exclude
+
+Exclude (i.e., don't descend into) directory D.
+
+Note: In Subversion 1.5, $SVN::Depth::exclude is B<not> supported anyhwere in
+the client-side (Wc/Client/etc) code; it is only supported as an argument to
+set_path functions in the Ra and Repos reporters.  (This will enable future
+versions of Subversion to run updates, etc, against 1.5 servers with proper
+$SVN::Depth::exclude behavior, once we get a chance to implement client side
+support for $SVN::Depth::exclude).
+
+=item $SVN::Depth::empty
+
+Just the named directory D, no entries.
+
+Updates will not pull in any files or subdirectories not already present.
+
+=item $SVN::Depth::files
+
+D + its files children, but not subdirs.
+
+Updates will pull in any files not already present, but not subdirectories.
+
+=item $SVN::Depth::immediates
+
+D + immediate children (D and its entries).
+
+Updates will pull in any files or subdirectories not already present; those
+subdirectories' this_dir entries will have depth-empty.
+
+=item $SVN::Depth::infinity
+
+D + all descendants (full recursion from D).
+
+Updates will pull in any files or subdirectories not already present; those
+subdirectories' this_dir entries will have depth-infinity.  Equivalent to the
+pre 1.5 default update behavior.
+
+=cut
+
 package _p_svn_opt_revision_t;
 use SVN::Base qw(Core svn_opt_revision_t_);
 

Modified: subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t?rev=1391250&r1=1391249&r2=1391250&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t Thu Sep 27 22:48:56 2012
@@ -20,7 +20,7 @@
 #
 #
 
-use Test::More tests => 146;
+use Test::More tests => 165;
 use strict;
 
 # shut up about variables that are only used once.
@@ -450,6 +450,89 @@ is($ctx->status2($wcpath, undef, sub {
    $SVN::Core::INVALID_REVNUM,
    'status2 returns INVALID_REVNUM when run against a working copy');
 
+# No revnum for the working copy so we should get INVALID_REVNUM
+# TEST
+is($ctx->status3($wcpath, undef, sub {
+                                      my ($path,$wc_status) = @_;
+                                      # TEST
+                                      is($path,"$wcpath/dir1",
+                                         'path param to status3 callback');
+                                      # TEST
+                                      isa_ok($wc_status,'_p_svn_wc_status2_t',
+                                             'wc_stats param to the status3' .
+                                             ' callback');
+                                      # TEST
+                                      is($wc_status->text_status(),
+                                         $SVN::Wc::Status::normal,
+                                         'text_status param to status3' .
+                                         ' callback');
+                                      # TEST
+                                      is($wc_status->prop_status(),
+                                         $SVN::Wc::Status::modified,
+                                         'prop_status param to status3' .
+                                         ' callback');
+                                      # TEST
+                                      is($wc_status->locked(), 0,
+                                         'locked param to status3' .
+                                         ' callback');
+                                      # TEST
+                                      is($wc_status->copied(), 0,
+                                         'copied param to status3' .
+                                         ' callback');
+                                      # TEST
+                                      is($wc_status->switched(), 0,
+                                         'switched param to status3' .
+                                         ' callback');
+                                      # TEST
+                                      is($wc_status->repos_text_status(),
+                                         $SVN::Wc::Status::none,
+                                         'repos_text_status param to status3' .
+                                         ' callback');
+                                      # TEST
+                                      is($wc_status->repos_prop_status(),
+                                         $SVN::Wc::Status::none,
+                                         'repos_prop_status param to status3' .
+                                         ' callback');
+                                      # TEST
+                                      is($wc_status->repos_lock(), undef,
+                                        'repos_lock param to status3 callback');
+                                      # TEST
+                                      is($wc_status->url(),"$reposurl/dir1",
+                                        'url param to status3 callback');
+                                      # TEST
+                                      is($wc_status->ood_last_cmt_rev(),
+                                         $SVN::Core::INVALID_REVNUM,
+                                         'ood_last_cmt_rev to status3' .
+                                         ' callback');
+                                      # TEST
+                                      is($wc_status->ood_last_cmt_date(), 0,
+                                         'ood_last_cmt_date to status3' .
+                                         ' callback');
+                                      # TEST
+                                      is($wc_status->ood_kind(),
+                                         $SVN::Node::none,
+                                         'ood_kind param to status3 callback');
+                                      # TEST
+                                      is($wc_status->tree_conflict(), undef,
+                                         'tree_conflict to status3 callback');
+                                      # TEST
+                                      is($wc_status->file_external(), 0,
+                                         'file_external to status3 callback');
+                                      # TEST
+                                      is($wc_status->pristine_text_status(),
+                                         $SVN::Wc::Status::normal,
+                                         'pristine_text_status param to' .
+                                         ' status3 callback');
+                                      # TEST
+                                      is($wc_status->pristine_prop_status(),
+                                         $SVN::Wc::Status::modified,
+                                         'pristine_prop_status param to' .
+                                         ' status3 callback');
+                                    },
+                $SVN::Depth::infinity, 0, 0, 0, 0, undef),
+   $SVN::Core::INVALID_REVNUM,
+   'status3 returns INVALID_REVNUM when run against a working copy');
+
 my ($ci_commit2) = $ctx->commit($wcpath,0);
 # TEST
 isa_ok($ci_commit2,'_p_svn_client_commit_info_t',