On the 1.6.x-svn_fs_commit_txn branch, merge in r1053233 from trunk.

Additionally:

* subversion/include/svn_error.h,
* subversion/libsvn_subr/error.c,
* subversion/mod_dav_svn/deadprops.c,
* subversion/mod_dav_svn/util.c,
* subversion/tests/libsvn_subr/error-test.c:
  Revert these files since the revision only modified svn_error_purge_tracing()
  which doesn't exist in this branch, the remaining changes relating to
  svn_repos__post_commit_error_str() were kept.

Original log message:

Make semantics of svn_error_purge_tracing() and
svn_repos__post_commit_error_str() easier to work with.  Now, both do
not modify the input error chain and svn_error_purge_tracing() returns
a new chain instead of modifying the input chain.

* subversion/include/private/svn_repos_private.h
  (svn_repos__validate_prop):
    Document that this does not modify the input error.

* subversion/include/svn_error.h
  (svn_error_purge_tracing):
    Document that the input chain is not modified and should be the
    chain that is cleared, not the returned chain.

* subversion/libsvn_repos/commit.c
  (svn_repos__post_commit_error_str):
    No longer clear the input error chain.
  (clear):
    Clear the error after calling svn_repos__post_commit_error_str().

* subversion/libsvn_subr/error.c
  (svn_error_purge_tracing):
    Reimplement to match the documented behavior.

* subversion/mod_dav_svn/deadprops.c
  (save_value):
    Now that the error passed to svn_error_purge_tracing() should be
    cleared instead of the returned error, use another variable to
    hold the purged chain.

* subversion/mod_dav_svn/util.c
  (dav_svn__convert_err):
    Now that the error passed to svn_error_purge_tracing() should be
    cleared instead of the returned error, use another variable to
    hold the purged chain.

* subversion/mod_dav_svn/version.c
  (dav_svn__checkin),
  (merge):
    Clear the error after calling svn_repos__post_commit_error_str().

* subversion/tests/libsvn_subr/error-test.c
  (test_error_purge_tracing):
    Update to use the new line number that svn_error_purge_tracing()
    calls SVN_ERR_ASSERT(err).


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/1.6.x-svn_fs_commit_txn@1053496 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/subversion/include/private/svn_repos_private.h b/subversion/include/private/svn_repos_private.h
index f28c1e2..24f15ce 100644
--- a/subversion/include/private/svn_repos_private.h
+++ b/subversion/include/private/svn_repos_private.h
@@ -44,8 +44,7 @@
  * the post-commit hook.  Any error tracing placeholders in the error
  * chain are skipped over.
  *
- * This function clears @a err and it should not be used after passing
- * it to this function.
+ * This function does not modify @a err.
  *
  * ### This method should not be necessary, but there are a few
  * ### places, e.g. mod_dav_svn, where only a single error message
diff --git a/subversion/libsvn_repos/commit.c b/subversion/libsvn_repos/commit.c
index 26d654d..e3a3f0c 100644
--- a/subversion/libsvn_repos/commit.c
+++ b/subversion/libsvn_repos/commit.c
@@ -709,11 +709,6 @@
                                             : _("(no error message)"));
     }
 
-  /* Because svn_error_purge_tracing() was used on the input error,
-     the purged error must either be cleared here or returned to the
-     caller.  This function just clears it. */
-  svn_error_clear(err);
-
   return msg;
 }
 
@@ -747,6 +742,7 @@
              (to be reported back to the client, who will probably
              display it as a warning) and clear the error. */
           post_commit_err = svn_repos__post_commit_error_str(err, pool);
+          svn_error_clear(err);
           err = SVN_NO_ERROR;
         }
     }
diff --git a/subversion/mod_dav_svn/version.c b/subversion/mod_dav_svn/version.c
index 5ed3851..e785625 100644
--- a/subversion/mod_dav_svn/version.c
+++ b/subversion/mod_dav_svn/version.c
@@ -851,16 +851,16 @@
         {
           if (serr)
             {
-              const char *post_commit_err;
-              apr_err = serr->apr_err;
-              post_commit_err = svn_repos__post_commit_error_str
-                                  (serr, resource->pool);
-              serr = SVN_NO_ERROR;
-              ap_log_perror(APLOG_MARK, APLOG_ERR, apr_err, resource->pool,
+              const char *post_commit_err = svn_repos__post_commit_error_str
+                                              (serr, resource->pool);
+              ap_log_perror(APLOG_MARK, APLOG_ERR, serr->apr_err,
+                            resource->pool,
                             "commit of r%ld succeeded, but an error occurred "
                             "after the commit: '%s'",
                             new_rev,
                             post_commit_err);
+              svn_error_clear(serr);
+              serr = SVN_NO_ERROR;
             }
         }
       else
@@ -1348,6 +1348,7 @@
              ### client some other way than hijacking the post-commit
              ### error message.*/
           post_commit_err = svn_repos__post_commit_error_str(serr, pool);
+          svn_error_clear(serr);
           serr = SVN_NO_ERROR;
         }
     }