You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/04/14 22:26:01 UTC

svn commit: r1092502 - in /subversion/trunk/subversion: libsvn_client/switch.c libsvn_client/update.c libsvn_wc/adm_crawler.c

Author: rhuijben
Date: Thu Apr 14 20:26:00 2011
New Revision: 1092502

URL: http://svn.apache.org/viewvc?rev=1092502&view=rev
Log:
Following up on r1091187, tweak the adm_crawler and switch and update
processing a bit to make sure they get the updates they ask for and
not more than that, when using depth filtering.

Before this patch the update and switch editor relied on a client side depth
filter to drop changes from the repository that shouldn't be applied. After
this patch the repository simply doesn't sent the changes that we don't need.

* subversion/libsvn_client/switch.c
  (switch_internal): On a not depth sticky update always sent depth unknown
    to the ra layer.

* subversion/libsvn_client/update.c
  (switch_internal): On a not depth sticky update always sent depth unknown
    to the ra layer.

* subversion/libsvn_wc/adm_crawler.c
  (svn_wc_crawl_revisions5): When performing a not-sticky crawl and a depth is
    provided, limit the anchor depth to the provided depth.

Modified:
    subversion/trunk/subversion/libsvn_client/switch.c
    subversion/trunk/subversion/libsvn_client/update.c
    subversion/trunk/subversion/libsvn_wc/adm_crawler.c

Modified: subversion/trunk/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/switch.c?rev=1092502&r1=1092501&r2=1092502&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/switch.c (original)
+++ subversion/trunk/subversion/libsvn_client/switch.c Thu Apr 14 20:26:00 2011
@@ -218,8 +218,7 @@ switch_internal(svn_revnum_t *result_rev
                                     target, switch_rev_url, use_commit_times,
                                     depth,
                                     depth_is_sticky, allow_unver_obstructions,
-                                    server_supports_depth
-                                        && (depth == svn_depth_unknown),
+                                    server_supports_depth,
                                     diff3_cmd, preserved_exts,
                                     ctx->conflict_func, ctx->conflict_baton,
                                     svn_client__external_info_gatherer, &efb,
@@ -230,7 +229,9 @@ switch_internal(svn_revnum_t *result_rev
   /* Tell RA to do an update of URL+TARGET to REVISION; if we pass an
      invalid revnum, that means RA will use the latest revision. */
   SVN_ERR(svn_ra_do_switch2(ra_session, &reporter, &report_baton, revnum,
-                            target, depth, switch_rev_url,
+                            target,
+                            depth_is_sticky ? depth : svn_depth_unknown,
+                            switch_rev_url,
                             switch_editor, switch_edit_baton, pool));
 
   /* Drive the reporter structure, describing the revisions within

Modified: subversion/trunk/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/update.c?rev=1092502&r1=1092501&r2=1092502&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/update.c (original)
+++ subversion/trunk/subversion/libsvn_client/update.c Thu Apr 14 20:26:00 2011
@@ -235,8 +235,7 @@ update_internal(svn_revnum_t *result_rev
                                     target, use_commit_times, depth,
                                     depth_is_sticky, allow_unver_obstructions,
                                     adds_as_modification,
-                                    server_supports_depth
-                                        && (depth == svn_depth_unknown),
+                                    server_supports_depth,
                                     diff3_cmd, preserved_exts,
                                     ctx->conflict_func, ctx->conflict_baton,
                                     ignore_externals
@@ -250,8 +249,9 @@ update_internal(svn_revnum_t *result_rev
   /* Tell RA to do an update of URL+TARGET to REVISION; if we pass an
      invalid revnum, that means RA will use the latest revision.  */
   SVN_ERR(svn_ra_do_update2(ra_session, &reporter, &report_baton,
-                            revnum, target, depth, FALSE,
-                            update_editor, update_edit_baton, pool));
+                            revnum, target,
+                            depth_is_sticky ? depth : svn_depth_unknown,
+                            FALSE, update_editor, update_edit_baton, pool));
 
   /* Drive the reporter structure, describing the revisions within
      PATH.  When we call reporter->finish_report, the

Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=1092502&r1=1092501&r2=1092502&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Thu Apr 14 20:26:00 2011
@@ -867,12 +867,20 @@ svn_wc_crawl_revisions5(svn_wc_context_t
         }
     }
 
-  /* The first call to the reporter merely informs it that the
-     top-level directory being updated is at BASE_REV.  Its PATH
-     argument is ignored. */
-  SVN_ERR(reporter->set_path(report_baton, "", target_rev, target_depth,
-                             start_empty, NULL, scratch_pool));
+  {
+    svn_depth_t anchor_depth = target_depth;
 
+    if (honor_depth_exclude 
+        && depth != svn_depth_unknown
+        && depth < target_depth)
+      anchor_depth = depth;
+
+    /* The first call to the reporter merely informs it that the
+       top-level directory being updated is at BASE_REV.  Its PATH
+       argument is ignored. */
+    SVN_ERR(reporter->set_path(report_baton, "", target_rev, anchor_depth,
+                               start_empty, NULL, scratch_pool));
+  }
   if (target_kind == svn_wc__db_kind_dir)
     {
       if (depth != svn_depth_empty)