subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1339233 - in /subversion/trunk/subversion: libsvn_ra_neon/util.c libsvn_ra_serf/util.c tests/cmdline/prop_tests.py tests/cmdline/svnmucc_tests.py
Date Wed, 16 May 2012 15:37:11 GMT
Author: philip
Date: Wed May 16 15:37:10 2012
New Revision: 1339233

URL: http://svn.apache.org/viewvc?rev=1339233&view=rev
Log:
Apache puts extra newlines in responses when built with AP_DEBUG
so remove these from some error messages.  Fix svnmucc_tests 1
over ra_serf.

* subversion/libsvn_ra_serf/util.c
  (end_207): Strip leading newline from responsedescription.

* subversion/libsvn_ra_neon/util.c
  (end_207_element): Strip leading newline from responsedescription.

* subversion/tests/cmdline/prop_tests.py
  (post_revprop_change_hook): Expect single line error.

* subversion/tests/cmdline/svnmucc_tests.py
  (reject_bogus_mergeinfo): Expect DAV error.

Modified:
    subversion/trunk/subversion/libsvn_ra_neon/util.c
    subversion/trunk/subversion/libsvn_ra_serf/util.c
    subversion/trunk/subversion/tests/cmdline/prop_tests.py
    subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py

Modified: subversion/trunk/subversion/libsvn_ra_neon/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/util.c?rev=1339233&r1=1339232&r2=1339233&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/util.c (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/util.c Wed May 16 15:37:10 2012
@@ -245,7 +245,15 @@ end_207_element(void *baton, int state,
 
     case ELEM_responsedescription:
       if (b->in_propstat)
-        svn_stringbuf_set(b->propstat_description, b->cdata->data);
+        {
+          const char *data = b->cdata->data;
+
+          /* Remove leading newline added by DEBUG_CR on server */
+          if (*data == '\n')
+              ++data;
+
+            svn_stringbuf_set(b->propstat_description, data);
+        }
       else
         {
           if (! svn_stringbuf_isempty(b->description))

Modified: subversion/trunk/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/util.c?rev=1339233&r1=1339232&r2=1339233&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/util.c Wed May 16 15:37:10 2012
@@ -1148,9 +1148,18 @@ end_207(svn_ra_serf__xml_parser_t *parse
     }
   if (ctx->in_error && strcmp(name.name, "responsedescription") == 0)
     {
+      apr_size_t len = ctx->cdata->len;
+      const char *data = ctx->cdata->data;
+
+      /* Remove leading newline added by DEBUG_CR on server */
+      if (*data == '\n')
+        {
+          ++data;
+          --len;
+        }
+
       ctx->collect_cdata = FALSE;
-      ctx->error->message = apr_pstrmemdup(ctx->error->pool, ctx->cdata->data,
-                                           ctx->cdata->len);
+      ctx->error->message = apr_pstrmemdup(ctx->error->pool, data, len);
       if (ctx->contains_precondition_error)
         ctx->error->apr_err = SVN_ERR_FS_PROP_BASEVALUE_MISMATCH;
       else

Modified: subversion/trunk/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/prop_tests.py?rev=1339233&r1=1339232&r2=1339233&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/prop_tests.py Wed May 16 15:37:10 2012
@@ -1740,11 +1740,9 @@ def post_revprop_change_hook(sbox):
   svntest.actions.create_failing_hook(repo_dir, 'post-revprop-change',
                                       error_msg)
 
-  # serf/neon/mod_dav_svn splits the "svn: hook failed" line
-  expected_error = svntest.verify.RegexOutput([
-    '(svn: E165001: |)post-revprop-change hook failed',
-    error_msg + "\n",
-  ], match_all = False)
+  # serf/neon/mod_dav_svn give SVN_ERR_RA_DAV_REQUEST_FAILED
+  # file/svn give SVN_ERR_REPOS_HOOK_FAILURE
+  expected_error = 'svn: (E175002|E165001).*post-revprop-change hook failed'
 
   svntest.actions.run_and_verify_svn(None, [], expected_error,
                                      'ps', '--revprop', '-r0', 'p', 'v',

Modified: subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py?rev=1339233&r1=1339232&r2=1339233&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnmucc_tests.py Wed May 16 15:37:10 2012
@@ -39,7 +39,7 @@ def reject_bogus_mergeinfo(sbox):
 
   sbox.build(create_wc=False)
 
-  expected_error = ".*(E200020.*Invalid revision|E175008.*property change)"
+  expected_error = ".*(E200020.*Invalid revision|E175002.*PROPPATCH)"
 
   # At present this tests the server, but if we ever make svnmucc
   # validate the mergeinfo up front then it will only test the client



Mime
View raw message