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

#774: [PATCH] avoid early exit when acting on some non-versioned files

From: Eric Gillespie <epg_at_pretzelnet.org>
Date: 2003-04-26 22:23:56 CEST

I finally got around to fixing this. Log message and patch
below. If this looks OK, i'll go ahead and commit it. This is
not, of course, the same patch i originally submitted to that
issue so long ago.

Resolve #774 ([PATCH] avoid early exit when acting on some
non-versioned files).

* subversion/clients/cmdline/main.c:

  (svn_cl__cmd_table): Add -q option to proplist and revert.

* subversion/clients/cmdline/proplist-cmd.c:

  (svn_cl__proplist): Instead of using SVN_ERR, just store the err and
  check to see if it is SVN_ERR_ENTRY_NOT_FOUND. If it is, ignore the
  error and stop processing this file, printing a warning if the -q
  option was not used. For all other errors return the err object and
  let normal error processing occur.

* subversion/clients/cmdline/revert-cmd.c:

  (svn_cl__revert): Same change.

* subversion/clients/cmdline/update-cmd.c:

  (svn_cl__update): Same change.

Index: subversion/clients/cmdline/revert-cmd.c
===================================================================
--- subversion/clients/cmdline/revert-cmd.c (revision 5739)
+++ subversion/clients/cmdline/revert-cmd.c (working copy)
@@ -64,9 +64,23 @@
   for (i = 0; i < targets->nelts; i++)
     {
       const char *target = ((const char **) (targets->elts))[i];
-
- SVN_ERR (svn_client_revert (target, recursive, ctx, subpool));
+ svn_error_t *err;
 
+ err = svn_client_revert (target, recursive, ctx, subpool);
+ if (err)
+ {
+ if (err->apr_err == SVN_ERR_ENTRY_NOT_FOUND)
+ {
+ if (!opt_state->quiet)
+ {
+ svn_handle_warning (stderr, err);
+ }
+ continue;
+ }
+ else
+ return err;
+ }
+
       svn_pool_clear (subpool);
     }
   
Index: subversion/clients/cmdline/update-cmd.c
===================================================================
--- subversion/clients/cmdline/update-cmd.c (revision 5739)
+++ subversion/clients/cmdline/update-cmd.c (working copy)
@@ -66,13 +66,28 @@
   for (i = 0; i < condensed_targets->nelts; i++)
     {
       const char *target = ((const char **) (condensed_targets->elts))[i];
+ svn_error_t *err;
 
- SVN_ERR (svn_client_update
+ err = svn_client_update
                (target,
                 &(opt_state->start_revision),
                 opt_state->nonrecursive ? FALSE : TRUE,
                 ctx,
- pool));
+ pool);
+ if (err)
+ {
+ if (err->apr_err == SVN_ERR_ENTRY_NOT_FOUND)
+ {
+ if (!opt_state->quiet)
+ {
+ svn_handle_warning (stderr, err);
+ }
+ continue;
+ }
+ else
+ return err;
+ }
+
     }
 
   return SVN_NO_ERROR;
Index: subversion/clients/cmdline/proplist-cmd.c
===================================================================
--- subversion/clients/cmdline/proplist-cmd.c (revision 5739)
+++ subversion/clients/cmdline/proplist-cmd.c (working copy)
@@ -97,11 +97,25 @@
           const char *target = ((const char **) (targets->elts))[i];
           apr_array_header_t *props;
           int j;
-
- SVN_ERR (svn_client_proplist (&props, target,
- &(opt_state->start_revision),
- opt_state->recursive, ctx, pool));
-
+ svn_error_t *err;
+
+ err = svn_client_proplist (&props, target,
+ &(opt_state->start_revision),
+ opt_state->recursive, ctx, pool);
+ if (err)
+ {
+ if (err->apr_err == SVN_ERR_ENTRY_NOT_FOUND)
+ {
+ if (!opt_state->quiet)
+ {
+ svn_handle_warning (stderr, err);
+ }
+ continue;
+ }
+ else
+ return err;
+ }
+
           for (j = 0; j < props->nelts; ++j)
             {
               svn_client_proplist_item_t *item
Index: subversion/clients/cmdline/main.c
===================================================================
--- subversion/clients/cmdline/main.c (revision 5739)
+++ subversion/clients/cmdline/main.c (working copy)
@@ -350,15 +350,15 @@
     " for example, when redirecting binary property values to a file).\n",
     {'R', 'r', svn_cl__revprop_opt, svn_cl__strict_opt,
      SVN_CL__AUTH_OPTIONS} },
-
+
   { "proplist", svn_cl__proplist, {"plist", "pl"},
     "List all properties on files, dirs, or revisions.\n"
     "usage: 1. proplist [PATH [PATH ... ]]\n"
     " 2. proplist --revprop -r REV [URL]\n\n"
     " 1. Lists versioned props in working copy.\n"
     " 2. Lists unversioned remote props on repos revision.\n",
- {'v', 'R', 'r', svn_cl__revprop_opt, SVN_CL__AUTH_OPTIONS} },
-
+ {'v', 'R', 'r', 'q', svn_cl__revprop_opt, SVN_CL__AUTH_OPTIONS} },
+
   { "propset", svn_cl__propset, {"pset", "ps"},
     "Set PROPNAME to PROPVAL on files, dirs, or revisions.\n\n"
     "usage: 1. propset PROPNAME [PROPVAL | -F VALFILE] PATH [PATH [PATH ... ]]\n"
@@ -394,7 +394,7 @@
     " foo/bar -r 1234 http://example.com/repos/zag\n",
     {'F', 'q', 'r', svn_cl__targets_opt, 'R', svn_cl__revprop_opt,
      SVN_CL__AUTH_OPTIONS, svn_cl__encoding_opt} },
-
+
   { "revert", svn_cl__revert, {0},
     "Restore pristine working copy file (undo all local edits)\n"
     "usage: revert PATH [PATH [PATH ... ]]\n\n"

-- 
Eric Gillespie, Jr. <*> epg@pretzelnet.org
Build a fire for a man, and he'll be warm for a day.  Set a man on
fire, and he'll be warm for the rest of his life. -Terry Pratchett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Apr 26 22:24:44 2003

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.