subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1070969 - in /subversion/trunk/subversion: svn/cat-cmd.c svn/info-cmd.c tests/cmdline/cat_tests.py
Date Tue, 15 Feb 2011 17:01:17 GMT
Author: stsp
Date: Tue Feb 15 17:01:17 2011
New Revision: 1070969

URL: http://svn.apache.org/viewvc?rev=1070969&view=rev
Log:
Improve error message displayed by info/cat for consistency.

* subversion/svn/info-cmd.c,
  subversion/svn/cat-cmd.c
  (svn_cl__info, svn_cl__cat): Improve error message. Use meaningful
    variable.

* subversion/tests/cmdline/cat_tests.py
  (cat_skip_uncattable): Modify test.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>

Modified:
    subversion/trunk/subversion/svn/cat-cmd.c
    subversion/trunk/subversion/svn/info-cmd.c
    subversion/trunk/subversion/tests/cmdline/cat_tests.py

Modified: subversion/trunk/subversion/svn/cat-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/cat-cmd.c?rev=1070969&r1=1070968&r2=1070969&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/cat-cmd.c (original)
+++ subversion/trunk/subversion/svn/cat-cmd.c Tue Feb 15 17:01:17 2011
@@ -32,6 +32,8 @@
 #include "svn_error.h"
 #include "cl.h"
 
+#include "svn_private_config.h"
+
 
 /*** Code. ***/
 
@@ -47,7 +49,7 @@ svn_cl__cat(apr_getopt_t *os,
   int i;
   svn_stream_t *out;
   apr_pool_t *subpool = svn_pool_create(pool);
-  svn_boolean_t saw_a_problem = FALSE;
+  svn_boolean_t seen_nonexistent_target = FALSE;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
@@ -83,12 +85,14 @@ svn_cl__cat(apr_getopt_t *os,
                            SVN_ERR_FS_NOT_FOUND,
                            SVN_NO_ERROR));
       if (! success)
-        saw_a_problem = TRUE;
+        seen_nonexistent_target = TRUE;
     }
   svn_pool_destroy(subpool);
 
-  if (saw_a_problem)
-    return svn_error_create(SVN_ERR_BASE, NULL, NULL);
+  if (seen_nonexistent_target)
+    return svn_error_create(
+      SVN_ERR_ILLEGAL_TARGET, NULL, 
+      _("Could not cat all targets because some targets don't exist"));
   else
     return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/svn/info-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/info-cmd.c?rev=1070969&r1=1070968&r2=1070969&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/info-cmd.c (original)
+++ subversion/trunk/subversion/svn/info-cmd.c Tue Feb 15 17:01:17 2011
@@ -494,7 +494,7 @@ svn_cl__info(apr_getopt_t *os,
   apr_pool_t *subpool = svn_pool_create(pool);
   int i;
   svn_error_t *err;
-  svn_boolean_t saw_a_problem = FALSE;
+  svn_boolean_t seen_nonexistent_target = FALSE;
   svn_opt_revision_t peg_revision;
   svn_info_receiver_t receiver;
   const char *path_prefix;
@@ -579,7 +579,7 @@ svn_cl__info(apr_getopt_t *os,
 
           svn_error_clear(err);
           err = NULL;
-          saw_a_problem = TRUE;
+          seen_nonexistent_target = TRUE;
         }
     }
   svn_pool_destroy(subpool);
@@ -587,8 +587,11 @@ svn_cl__info(apr_getopt_t *os,
   if (opt_state->xml && (! opt_state->incremental))
     SVN_ERR(svn_cl__xml_print_footer("info", pool));
 
-  if (saw_a_problem)
-    return svn_error_create(SVN_ERR_BASE, NULL, NULL);
+  if (seen_nonexistent_target)
+    return svn_error_create(
+      SVN_ERR_ILLEGAL_TARGET, NULL, 
+      _("Could not display info for all targets because some "
+        "targets don't exist"));
   else
     return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/tests/cmdline/cat_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/cat_tests.py?rev=1070969&r1=1070968&r2=1070969&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/cat_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/cat_tests.py Tue Feb 15 17:01:17 2011
@@ -158,8 +158,9 @@ def cat_skip_uncattable(sbox):
   svntest.actions.run_and_verify_svn2(None, expected_out, expected_err2, 1,
                                        'cat', rho_path, new_file_path)
 
-  expected_err3 = expected_err1 + expected_err2 + ".*\n" + \
-      "svn: E200000: A problem occurred; see other errors for details\n"
+  expected_err3 = expected_err1 + expected_err2 + \
+      ".*\nsvn: E200009: Could not cat all targets because some targets " + \
+      "don't exist\n"
   expected_err_re = re.compile(expected_err3)
 
   exit_code, output, error = svntest.main.run_svn(1, 'cat', rho_path, G_path, new_file_path)



Mime
View raw message