subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1138096 - in /subversion/trunk/subversion: libsvn_client/commit_util.c libsvn_ra_neon/props.c tests/cmdline/lock_tests.py
Date Tue, 21 Jun 2011 17:07:41 GMT
Author: rhuijben
Date: Tue Jun 21 17:07:41 2011
New Revision: 1138096

URL: http://svn.apache.org/viewvc?rev=1138096&view=rev
Log:
Following up on r1138060, improve file locked message on nodes that only
receive property changes.

* subversion/libsvn_client/commit_util.c
  (fixup_out_of_date_error): Check for errors deeper to catch the response
    from serf.

* subversion/libsvn_ra_neon/props.c
  (svn_ra_neon__do_proppatch): Return recognizable error instead of generic
    failure for status 423.

* subversion/tests/cmdline/lock_tests.py
  (lock_file): Make regexes a bit stricter. ra_svn sometimes delays its
    editor errors to the next command, which avoids the nicer error :(

Modified:
    subversion/trunk/subversion/libsvn_client/commit_util.c
    subversion/trunk/subversion/libsvn_ra_neon/props.c
    subversion/trunk/subversion/tests/cmdline/lock_tests.py

Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=1138096&r1=1138095&r2=1138096&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Tue Jun 21 17:07:41 2011
@@ -99,7 +99,7 @@ fixup_out_of_date_error(const char *loca
                                                                 path,
                                                                 scratch_pool));
     }
-  else if (err->apr_err == SVN_ERR_FS_NO_LOCK_TOKEN
+  else if (svn_error_find_cause(err, SVN_ERR_FS_NO_LOCK_TOKEN)
            || err->apr_err == SVN_ERR_FS_LOCK_OWNER_MISMATCH
            || err->apr_err == SVN_ERR_RA_NOT_LOCKED)
     {
@@ -1684,7 +1684,13 @@ do_item_commit(void **dir_baton,
     {
       /* Close any outstanding file batons that didn't get caught by
          the "has local mods" conditional above. */
-      SVN_ERR(editor->close_file(file_baton, NULL, file_pool));
+      err = editor->close_file(file_baton, NULL, file_pool);
+
+      if (err)
+        return svn_error_return(fixup_out_of_date_error(local_abspath,
+                                                        icb->base_url,
+                                                        path, kind,
+                                                        err, ctx, pool));
     }
 
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/libsvn_ra_neon/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/props.c?rev=1138096&r1=1138095&r2=1138096&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/props.c (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/props.c Tue Jun 21 17:07:41 2011
@@ -1200,6 +1200,7 @@ svn_ra_neon__do_proppatch(svn_ra_neon__s
 {
   svn_error_t *err;
   svn_stringbuf_t *body;
+  int code;
   apr_pool_t *subpool = svn_pool_create(pool);
 
   /* just punt if there are no changes to make. */
@@ -1273,9 +1274,22 @@ svn_ra_neon__do_proppatch(svn_ra_neon__s
   apr_hash_set(extra_headers, "Content-Type", APR_HASH_KEY_STRING,
                "text/xml; charset=UTF-8");
 
-  err = svn_ra_neon__simple_request(NULL, ras, "PROPPATCH", url,
+  err = svn_ra_neon__simple_request(&code, ras, "PROPPATCH", url,
                                     extra_headers, body->data,
                                     200, 207, pool);
+
+  if (err && err->apr_err == SVN_ERR_RA_DAV_REQUEST_FAILED)
+    switch(code)
+      {
+        case 423:
+          return svn_error_createf(SVN_ERR_RA_NOT_LOCKED, err,
+                                   _("No lock on path '%s'; "
+                                     " repository is unchanged"), url);
+        /* ### Add case 412 for a better error on issue #3674 */
+        default:
+          break;
+      }
+
   if (err)
     return svn_error_create
       (SVN_ERR_RA_DAV_PROPPATCH_FAILED, err,

Modified: subversion/trunk/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/lock_tests.py?rev=1138096&r1=1138095&r2=1138096&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/lock_tests.py Tue Jun 21 17:07:41 2011
@@ -89,7 +89,8 @@ def lock_file(sbox):
                                      '-m', '', file_path)
 
   # --- Meanwhile, in our other working copy... ---
-  err_re = "((.*User 'jconstant' does not own lock on path.*)|(.*423 Locked.*))"
+  err_re = "(svn\: E195021\: File '.*iota' is locked in another)|" + \
+           "(svn\: E160039: User 'jconstant' does not own lock on path.*iota')"
 
   svntest.main.run_svn(None, 'update', wc_b)
   # -- Try to change a file --
@@ -109,8 +110,8 @@ def lock_file(sbox):
   # change the locked file's properties
   svntest.main.run_svn(None, 'propset', 'sneakyuser', 'Sally', file_path_b)
 
-  err_re = "((.*User 'jconstant' does not own lock on path.*)" + \
-             "|(.*At least one property change failed.*))"
+  err_re = "(svn\: E195021\: File '.*iota' is locked in another)|" + \
+           "(svn\: E160039\: User 'jconstant' does not own lock on path)"
 
   # attempt (and fail) to commit as user Sally
   svntest.actions.run_and_verify_commit(wc_b, None, None, err_re,



Mime
View raw message