Author: rhuijben
Date: Thu Sep 26 10:19:23 2013
New Revision: 1526439

URL: http://svn.apache.org/r1526439
Log:
Yet another serf server response handling improvement.

* subversion/libsvn_ra_serf/commit.c
  (add_file): Improve diagnostics. Not every HTTP status code tells us that a
    node already exists. Use the usual error handling for other responses.
    Use the same error code as the other RA layers use.

* subversion/tests/cmdline/commit_tests.py
  (commit_add_file_twice): Apply stricter error check.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/commit.c
    subversion/trunk/subversion/tests/cmdline/commit_tests.py

Modified: subversion/trunk/subversion/libsvn_ra_serf/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/commit.c?rev=1526439&r1=1526438&r2=1526439&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/commit.c Thu Sep 26 10:19:23 2013
@@ -1933,7 +1933,18 @@ add_file(const char *path,
 
       if (handler->sline.code != 404)
         {
-          return svn_error_createf(SVN_ERR_RA_DAV_ALREADY_EXISTS, NULL,
+          if (handler->sline.code != 200)
+            {
+              svn_error_t *err;
+
+              err = svn_ra_serf__error_on_status(handler->sline,
+                                                 handler->path,
+                                                 handler->location);
+
+              SVN_ERR(err);
+            }
+
+          return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
                                    _("File '%s' already exists"), path);
         }
     }

Modified: subversion/trunk/subversion/tests/cmdline/commit_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/commit_tests.py?rev=1526439&r1=1526438&r2=1526439&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/commit_tests.py Thu Sep 26 
10:19:23 2013
@@ -1250,7 +1250,7 @@ def commit_add_file_twice(sbox):
   svntest.actions.run_and_verify_commit(wc_dir,
                                         None,
                                         None,
-                                        "already exists",
+                                        "E160020: File.*already exists",
                                         wc_dir)
 
 #----------------------------------------------------------------------


Reply via email to