Author: rhuijben
Date: Wed Jul 13 12:47:26 2011
New Revision: 1145982

URL: http://svn.apache.org/viewvc?rev=1145982&view=rev
Log:
Resolve another review todo from issue #3779 "how to handle actual only nodes"
by making 'svn proplist' return a non zero exit code when one or more errors
occurred.

* subversion/svn/proplist-cmd.c
  (svn_cl__proplist): Check if all operations completed successfully and if
    not return an error.

* subversion/tests/cmdline/tree_conflict_tests.py
  (actual_only_node_behaviour): Update expected result.

Modified:
    subversion/trunk/subversion/svn/proplist-cmd.c
    subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py

Modified: subversion/trunk/subversion/svn/proplist-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/proplist-cmd.c?rev=1145982&r1=1145981&r2=1145982&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/proplist-cmd.c (original)
+++ subversion/trunk/subversion/svn/proplist-cmd.c Wed Jul 13 12:47:26 2011
@@ -168,6 +168,7 @@ svn_cl__proplist(apr_getopt_t *os,
       int i;
       apr_pool_t *iterpool;
       svn_proplist_receiver_t pl_receiver;
+      svn_boolean_t had_errors = FALSE;
 
       if (opt_state->xml)
         {
@@ -189,6 +190,7 @@ svn_cl__proplist(apr_getopt_t *os,
           proplist_baton_t pl_baton;
           const char *truepath;
           svn_opt_revision_t peg_revision;
+          svn_boolean_t success;
 
           svn_pool_clear(iterpool);
           SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
@@ -200,22 +202,31 @@ svn_cl__proplist(apr_getopt_t *os,
           SVN_ERR(svn_opt_parse_path(&peg_revision, &truepath, target,
                                      iterpool));
 
-          SVN_ERR(svn_cl__try
-                  (svn_client_proplist3(truepath, &peg_revision,
+          SVN_ERR(svn_cl__try(
+                   svn_client_proplist3(truepath, &peg_revision,
                                         &(opt_state->start_revision),
                                         opt_state->depth,
                                         opt_state->changelists,
                                         pl_receiver, &pl_baton,
                                         ctx, iterpool),
-                   NULL, opt_state->quiet,
+                   &success, opt_state->quiet,
                    SVN_ERR_UNVERSIONED_RESOURCE,
                    SVN_ERR_ENTRY_NOT_FOUND,
                    SVN_NO_ERROR));
+
+          if (!success)
+            had_errors = TRUE;
         }
       svn_pool_destroy(iterpool);
 
       if (opt_state->xml)
         SVN_ERR(svn_cl__xml_print_footer("properties", scratch_pool));
+
+      /* Error out *after* we closed the XML element */
+      if (had_errors)
+        return svn_error_create(SVN_ERR_ILLEGAL_TARGET, NULL,
+                                _("Could not display info for all targets "
+                                  "because some targets don't exist"));
     }
 
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py?rev=1145982&r1=1145981&r2=1145982&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py Wed Jul 13 
12:47:26 2011
@@ -1301,11 +1301,10 @@ def actual_only_node_behaviour(sbox):
                      "propget", "svn:eol-style", foo_path)
 
   # proplist (plist, pl)
-  ### proplist does exit(0) -- is that expected?
   expected_stdout = None
   expected_stderr = ".*foo.*is not under version control.*"
-  svntest.actions.run_and_verify_svn2(None, expected_stdout, expected_stderr,
-                                      0, "proplist", foo_path)
+  svntest.actions.run_and_verify_svn(None, expected_stdout, expected_stderr,
+                                     "proplist", foo_path)
 
   # propset (pset, ps)
   expected_stdout = None


Reply via email to