subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1656875 - in /subversion/trunk/subversion: include/svn_fs.h include/svn_ra.h libsvn_ra_serf/get_lock.c tests/libsvn_ra/ra-test.c
Date Tue, 03 Feb 2015 18:19:18 GMT
Author: rhuijben
Date: Tue Feb  3 18:19:17 2015
New Revision: 1656875

URL: http://svn.apache.org/r1656875
Log:
Make svn_ra_get_lock() consistent with svn_fs_get_lock() in not returning an
error when the specified path does not exist on trunk and document this
behavior.

This function is within svn only used for 'svn info', and introducing the
error in the other ra layers would make this function fail in some cases.

* subversion/include/svn_fs.h
  (svn_fs_get_lock): Extend documentation.

* subversion/include/svn_ra.h
  (svn_ra_get_lock): Extend documentation.

* subversion/libsvn_ra_serf/get_lock.c
  (svn_ra_serf__get_lock): Handle SVN_ERR_FS_NOT_FOUND.

* subversion/tests/libsvn_ra/ra-test.c
  (expect_error): Update expected result.

Modified:
    subversion/trunk/subversion/include/svn_fs.h
    subversion/trunk/subversion/include/svn_ra.h
    subversion/trunk/subversion/libsvn_ra_serf/get_lock.c
    subversion/trunk/subversion/tests/libsvn_ra/ra-test.c

Modified: subversion/trunk/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_fs.h?rev=1656875&r1=1656874&r2=1656875&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_fs.h (original)
+++ subversion/trunk/subversion/include/svn_fs.h Tue Feb  3 18:19:17 2015
@@ -2807,7 +2807,7 @@ svn_fs_unlock(svn_fs_t *fs,
 /** If @a path is locked in @a fs, set @a *lock to an svn_lock_t which
  *  represents the lock, allocated in @a pool.
  *
- * If @a path is not locked, set @a *lock to NULL.
+ * If @a path is not locked or does not exist in HEAD, set @a *lock to NULL.
  */
 svn_error_t *
 svn_fs_get_lock(svn_lock_t **lock,

Modified: subversion/trunk/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_ra.h?rev=1656875&r1=1656874&r2=1656875&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_ra.h (original)
+++ subversion/trunk/subversion/include/svn_ra.h Tue Feb  3 18:19:17 2015
@@ -1906,8 +1906,12 @@ svn_ra_unlock(svn_ra_session_t *session,
 
 /**
  * If @a path is locked, set @a *lock to an svn_lock_t which
- * represents the lock, allocated in @a pool.  If @a path is not
- * locked, set @a *lock to NULL.
+ * represents the lock, allocated in @a pool.
+ *
+ * If @a path is not locked or does not exist in HEAD, set @a *lock to NULL.
+ *
+ * @note Before 1.9, this function could return SVN_ERR_FS_NOT_FOUND
+ * when @a path didn't exist in HEAD on specific ra layers.
  *
  * @since New in 1.2.
  */

Modified: subversion/trunk/subversion/libsvn_ra_serf/get_lock.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/get_lock.c?rev=1656875&r1=1656874&r2=1656875&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/get_lock.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/get_lock.c Tue Feb  3 18:19:17 2015
@@ -321,8 +321,8 @@ svn_ra_serf__get_lock(svn_ra_session_t *
     return svn_error_trace(
              svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, err,
                               _("Server does not support locking features")));
-  else if (err)
-    return svn_error_trace(err);
+  else if (svn_error_find_cause(err, SVN_ERR_FS_NOT_FOUND))
+    svn_error_clear(err); /* Behave like the other RA layers */
   else if (handler->sline.code != 207)
     return svn_error_trace(svn_ra_serf__unexpected_status(handler));
 

Modified: subversion/trunk/subversion/tests/libsvn_ra/ra-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_ra/ra-test.c?rev=1656875&r1=1656874&r2=1656875&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_ra/ra-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_ra/ra-test.c Tue Feb  3 18:19:17 2015
@@ -434,15 +434,8 @@ expect_error(const char *path,
 
   SVN_TEST_ASSERT(result && result->err);
   SVN_TEST_ASSERT(!result->lock);
-  err = svn_ra_get_lock(session, &lock, path, scratch_pool);
-  if (err) /* ra_serf reports SVN_ERR_FS_NOT_FOUND. ### Consistency? */
-    {
-      if (err->apr_err != SVN_ERR_FS_NOT_FOUND)
-        return svn_error_trace(err);
-
-      svn_error_clear(err);
-      lock = NULL;
-    }
+  /* RA layers shouldn't report SVN_ERR_FS_NOT_FOUND */
+  SVN_ERR(svn_ra_get_lock(session, &lock, path, scratch_pool));
 
   SVN_TEST_ASSERT(!lock);
   return SVN_NO_ERROR;



Mime
View raw message