You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/11/29 20:10:34 UTC

svn commit: r1040232 - /subversion/trunk/subversion/svn/update-cmd.c

Author: julianfoad
Date: Mon Nov 29 19:10:34 2010
New Revision: 1040232

URL: http://svn.apache.org/viewvc?rev=1040232&view=rev
Log:
Clean up "svn update" code.

* subversion/svn/update-cmd.c
  (print_update_summary): Mention the array element types, and that all
    target paths must be dirents.
  (svn_cl__update): Don't pass any URL targets into svn_client_update4() or
    print_update_summary(); skip them here instead.

Modified:
    subversion/trunk/subversion/svn/update-cmd.c

Modified: subversion/trunk/subversion/svn/update-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/update-cmd.c?rev=1040232&r1=1040231&r2=1040232&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/update-cmd.c (original)
+++ subversion/trunk/subversion/svn/update-cmd.c Mon Nov 29 19:10:34 2010
@@ -40,7 +40,9 @@
 /*** Code. ***/
 
 /* Print an update summary when there's more than one target to report
-   about. */
+   about.  Each (const char *) path in TARGETS is an absolute or relative
+   dirent, and each (svn_revnum_t) entry in RESULT_REVS is the corresponding
+   updated revision, or SVN_INVALID_REVNUM if not a valid target. */
 static svn_error_t *
 print_update_summary(apr_array_header_t *targets,
                      apr_array_header_t *result_revs,
@@ -119,6 +121,30 @@ svn_cl__update(apr_getopt_t *os,
 
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, scratch_pool));
 
+  /* If any targets are URLs, notify that we're skipping them and remove
+     them from TARGETS.  Although svn_client_update4() would skip them
+     anyway, we don't want to pass invalid targets to it, and especially
+     not to print_update_summary(). */
+  {
+    apr_array_header_t *new_targets
+      = apr_array_make(scratch_pool, targets->nelts, sizeof(const char *));
+    int i;
+
+    for (i = 0; i < targets->nelts; i++)
+      {
+        const char *target = APR_ARRAY_IDX(targets, i, const char *);
+
+        if (svn_path_is_url(target))
+          ctx->notify_func2(ctx->notify_baton2,
+                            svn_wc_create_notify_url(
+                              target, svn_wc_notify_skip, scratch_pool),
+                            scratch_pool);
+        else
+          APR_ARRAY_PUSH(new_targets, const char *) = target;
+      }
+    targets = new_targets;
+  }
+
   /* If using changelists, convert targets into a set of paths that
      match the specified changelist(s). */
   if (opt_state->changelists)