subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
Subject svn commit: r1670556 - in /subversion/branches/1.9.x: ./ subversion/include/ subversion/libsvn_fs_base/ subversion/libsvn_fs_fs/ subversion/libsvn_fs_x/ subversion/libsvn_ra_serf/ subversion/mod_dav_svn/
Date Wed, 01 Apr 2015 04:00:12 GMT
Author: svn-role
Date: Wed Apr  1 04:00:12 2015
New Revision: 1670556

URL: http://svn.apache.org/r1670556
Log:
Merge r1665318 from trunk:

 * r1665318
   Make lock/unlock result reporting consistent over ra layers and fs backends
   Justification:
     With the 1.9 redesign of multiple locks in a single operation differences
     between the different ra layers were introduced in how out of date
     revisions are reported. This patch makes the behavior consistent, which
     in turn will help clients produce a more stable result.
     (This resolves multiple long standing AnkhSVN issues that I wasn't
      aware of)
     .
     Without this patch some ra layers report out of dates via the callback
     while others (read: serf) fail directly, causing locks not to be stored
     in the working copy, etc.
   Notes:
     The regression test on trunk tests a bit more behavior than is backported
     here. Check r1665319 for details on what is ensured on trunk now.
   Votes:
     +1: rhuijben, philip, stefan2

Modified:
    subversion/branches/1.9.x/   (props changed)
    subversion/branches/1.9.x/STATUS
    subversion/branches/1.9.x/subversion/include/svn_error.h
    subversion/branches/1.9.x/subversion/libsvn_fs_base/lock.c
    subversion/branches/1.9.x/subversion/libsvn_fs_fs/lock.c
    subversion/branches/1.9.x/subversion/libsvn_fs_x/   (props changed)
    subversion/branches/1.9.x/subversion/libsvn_fs_x/lock.c
    subversion/branches/1.9.x/subversion/libsvn_ra_serf/lock.c
    subversion/branches/1.9.x/subversion/mod_dav_svn/util.c

Propchange: subversion/branches/1.9.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr  1 04:00:12 2015
@@ -89,4 +89,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1660545-1660547,1660549-1662901,1663003,1663183-1663184,1663338,1663347,1663355,1663374,1663450,1663697,1663706,1663738,1663749,1663791,1664078,1664080,1664084-1664085,1664187,1664191,1664193,1664200,1664344,1664476,1664480-1664481,1664483,1664507,1664520-1664521,1664523,1664526-1664527,1664531-1664532,1664588,1664653,1664684,1664927,1664997,1665164,1665195,1665437-1665438,1665611-1665612,1665845,1665850,1665852,1665886,1665894,1665896,1666096,1666270,1666272,1666379,1666449,1666690,1666851,1667101,1667106-1667107,1667941,1667976,1668598,1668600,1668602-1668603,1670329
+/subversion/trunk:1660545-1660547,1660549-1662901,1663003,1663183-1663184,1663338,1663347,1663355,1663374,1663450,1663697,1663706,1663738,1663749,1663791,1664078,1664080,1664084-1664085,1664187,1664191,1664193,1664200,1664344,1664476,1664480-1664481,1664483,1664507,1664520-1664521,1664523,1664526-1664527,1664531-1664532,1664588,1664653,1664684,1664927,1664997,1665164,1665195,1665318,1665437-1665438,1665611-1665612,1665845,1665850,1665852,1665886,1665894,1665896,1666096,1666270,1666272,1666379,1666449,1666690,1666851,1667101,1667106-1667107,1667941,1667976,1668598,1668600,1668602-1668603,1670329

Modified: subversion/branches/1.9.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/STATUS?rev=1670556&r1=1670555&r2=1670556&view=diff
==============================================================================
--- subversion/branches/1.9.x/STATUS (original)
+++ subversion/branches/1.9.x/STATUS Wed Apr  1 04:00:12 2015
@@ -241,22 +241,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1665318
-   Make lock/unlock result reporting consistent over ra layers and fs backends
-   Justification:
-     With the 1.9 redesign of multiple locks in a single operation differences
-     between the different ra layers were introduced in how out of date
-     revisions are reported. This patch makes the behavior consistent, which
-     in turn will help clients produce a more stable result.
-     (This resolves multiple long standing AnkhSVN issues that I wasn't
-      aware of)
-     .
-     Without this patch some ra layers report out of dates via the callback
-     while others (read: serf) fail directly, causing locks not to be stored
-     in the working copy, etc.
-   Notes:
-     The regression test on trunk tests a bit more behavior than is backported
-     here. Check r1665319 for details on what is ensured on trunk now.
-   Votes:
-     +1: rhuijben, philip, stefan2

Modified: subversion/branches/1.9.x/subversion/include/svn_error.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/include/svn_error.h?rev=1670556&r1=1670555&r2=1670556&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/include/svn_error.h (original)
+++ subversion/branches/1.9.x/subversion/include/svn_error.h Wed Apr  1 04:00:12 2015
@@ -455,7 +455,10 @@ svn_error_t *svn_error_purge_tracing(svn
    err->apr_err == SVN_ERR_FS_NOT_FOUND           ||        \
    err->apr_err == SVN_ERR_FS_OUT_OF_DATE         ||        \
    err->apr_err == SVN_ERR_FS_BAD_LOCK_TOKEN      ||        \
-   err->apr_err == SVN_ERR_REPOS_HOOK_FAILURE)
+   err->apr_err == SVN_ERR_REPOS_HOOK_FAILURE     ||        \
+   err->apr_err == SVN_ERR_FS_NO_SUCH_REVISION    ||        \
+   err->apr_err == SVN_ERR_FS_OUT_OF_DATE         ||        \
+   err->apr_err == SVN_ERR_FS_NOT_FILE)
 
 /**
  * Return TRUE if @a err is an error specifically related to unlocking

Modified: subversion/branches/1.9.x/subversion/libsvn_fs_base/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_fs_base/lock.c?rev=1670556&r1=1670555&r2=1670556&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_fs_base/lock.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_fs_base/lock.c Wed Apr  1 04:00:12 2015
@@ -39,6 +39,7 @@
 #include "private/svn_fs_util.h"
 #include "private/svn_subr_private.h"
 #include "private/svn_dep_compat.h"
+#include "revs-txns.h"
 
 
 /* Add LOCK and its associated LOCK_TOKEN (associated with PATH) as
@@ -241,8 +242,10 @@ svn_fs_base__lock(svn_fs_t *fs,
 {
   apr_hash_index_t *hi;
   svn_error_t *cb_err = SVN_NO_ERROR;
+  svn_revnum_t youngest_rev = SVN_INVALID_REVNUM;
 
   SVN_ERR(svn_fs__check_fs(fs, TRUE));
+  SVN_ERR(svn_fs_base__youngest_rev(&youngest_rev, fs, scratch_pool));
 
   for (hi = apr_hash_first(scratch_pool, targets); hi; hi = apr_hash_next(hi))
     {
@@ -250,7 +253,7 @@ svn_fs_base__lock(svn_fs_t *fs,
       const char *path = apr_hash_this_key(hi);
       const svn_fs_lock_target_t *target = apr_hash_this_val(hi);
       svn_lock_t *lock;
-      svn_error_t *err;
+      svn_error_t *err = NULL;
 
       args.lock_p = &lock;
       args.path = svn_fs__canonicalize_abspath(path, result_pool);
@@ -262,8 +265,17 @@ svn_fs_base__lock(svn_fs_t *fs,
       args.current_rev = target->current_rev;
       args.result_pool = result_pool;
 
-      err = svn_fs_base__retry_txn(fs, txn_body_lock, &args, TRUE,
-                                   scratch_pool);
+      if (SVN_IS_VALID_REVNUM(target->current_rev))
+        {
+          if (target->current_rev > youngest_rev)
+            err = svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
+                                    _("No such revision %ld"),
+                                    target->current_rev);
+        }
+
+      if (!err)
+        err = svn_fs_base__retry_txn(fs, txn_body_lock, &args, TRUE,
+                                     scratch_pool);
       if (!cb_err && lock_callback)
         cb_err = lock_callback(lock_baton, args.path, lock, err, scratch_pool);
       svn_error_clear(err);

Modified: subversion/branches/1.9.x/subversion/libsvn_fs_fs/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_fs_fs/lock.c?rev=1670556&r1=1670555&r2=1670556&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_fs_fs/lock.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_fs_fs/lock.c Wed Apr  1 04:00:12 2015
@@ -715,6 +715,7 @@ check_lock(svn_error_t **fs_err,
            const svn_fs_lock_target_t *target,
            struct lock_baton *lb,
            svn_fs_root_t *root,
+           svn_revnum_t youngest_rev,
            apr_pool_t *pool)
 {
   svn_node_kind_t kind;
@@ -751,6 +752,15 @@ check_lock(svn_error_t **fs_err,
   if (SVN_IS_VALID_REVNUM(target->current_rev))
     {
       svn_revnum_t created_rev;
+
+      if (target->current_rev > youngest_rev)
+        {
+          *fs_err = svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
+                                      _("No such revision %ld"),
+                                      target->current_rev);
+          return SVN_NO_ERROR;
+        }
+
       SVN_ERR(svn_fs_fs__node_created_rev(&created_rev, root, path,
                                           pool));
 
@@ -856,7 +866,7 @@ lock_body(void *baton, apr_pool_t *pool)
       info.fs_err = SVN_NO_ERROR;
 
       SVN_ERR(check_lock(&info.fs_err, info.path, item->value, lb, root,
-                         iterpool));
+                         youngest, iterpool));
 
       /* If no error occurred while pre-checking, schedule the index updates for
          this path. */

Propchange: subversion/branches/1.9.x/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr  1 04:00:12 2015
@@ -90,4 +90,4 @@
 /subversion/branches/verify-keep-going/subversion/libsvn_fs_x:1439280-1492639,1546002-1546110
 /subversion/branches/wc-collate-path/subversion/libsvn_fs_x:1402685-1480384
 /subversion/trunk/subversion/libsvn_fs_fs:1415133-1596500,1596567,1597414,1597989,1598273,1599140,1600872,1601633,1603485-1603487,1603499,1603605,1604128,1604188,1604413-1604414,1604416-1604417,1604421,1604442,1604700,1604717,1604720,1604726,1604755,1604794,1604802,1604824,1604836,1604844,1604902-1604903,1604911,1604925,1604933,1604947,1605059-1605060,1605064-1605065,1605068,1605071-1605073,1605075,1605123,1605188-1605189,1605191,1605197,1605444,1605633,1606132,1606142,1606144,1606514,1606526,1606528,1606551,1606554,1606564,1606598-1606599,1606656,1606658,1606662,1606744,1606840,1607085,1607572,1612407,1612810,1613339,1613872,1614611,1615348,1615351-1615352,1615356,1616338-1616339,1616613,1617586,1617688,1618138,1618151,1618153,1618226,1618641,1618653,1618662,1619068,1619358,1619413,1619769,1619774,1620602,1620909,1620912,1620928,1620930,1621275,1621635,1622931,1622937,1622942,1622946,1622959-1622960,1622963,1622987,1623007,1623368,1623373,1623377,1623379,1623381,1623398,1623402,162
 4011,1624265,1624512,1626246,1626871,1626873,1626886,1627497-1627498,1627502,1627947-1627949,1627966,1628083,1628093,1628158-1628159,1628161,1628392-1628393,1628415,1628427,1628676,1628738,1628762,1628764,1629854-1629855,1629857,1629865,1629873,1629875,1629879,1630067,1630070,1631049-1631051,1631075,1631115,1631171,1631180,1631185-1631186,1631196-1631197,1631239-1631240,1631548,1631550,1631563,1631567,1631588,1631598,1632646,1632776,1632849,1632851-1632853,1632856-1632857,1632868,1632908,1632926,1633232,1633617-1633618,1634872,1634875,1634879-1634880,1634920,1636478,1636483,1636629,1636644,1637184,1637186,1637330,1637358,1637363,1637393,1639319,1639322,1639335,1639348,1639352,1639355,1639358,1639414,1639419,1639426,1639430,1639436,1639440,1639549,1640061-1640062,1640197,1640915,1640966,1641013,1643139,1643233,1645567,1646021,1646712,1646716,1647537,1647540-1647541,1647820,1647905,1648230,1648238,1648241-1648243,1648253,1648272,1648532,1648537-1648539,1648542,1648591,1648612,1653608,
 1658482
-/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1665894,1667101
+/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1665318,1665894,1667101

Modified: subversion/branches/1.9.x/subversion/libsvn_fs_x/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_fs_x/lock.c?rev=1670556&r1=1670555&r2=1670556&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_fs_x/lock.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_fs_x/lock.c Wed Apr  1 04:00:12 2015
@@ -755,6 +755,7 @@ check_lock(svn_error_t **fs_err,
            const svn_fs_lock_target_t *target,
            lock_baton_t *lb,
            svn_fs_root_t *root,
+           svn_revnum_t youngest_rev,
            apr_pool_t *pool)
 {
   svn_node_kind_t kind;
@@ -791,6 +792,15 @@ check_lock(svn_error_t **fs_err,
   if (SVN_IS_VALID_REVNUM(target->current_rev))
     {
       svn_revnum_t created_rev;
+
+      if (target->current_rev > youngest_rev)
+        {
+          *fs_err = svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
+                                      _("No such revision %ld"),
+                                      target->current_rev);
+          return SVN_NO_ERROR;
+        }
+
       SVN_ERR(svn_fs_x__node_created_rev(&created_rev, root, path,
                                          pool));
 
@@ -895,7 +905,8 @@ lock_body(void *baton, apr_pool_t *pool)
       svn_pool_clear(iterpool);
 
       info.path = item->key;
-      SVN_ERR(check_lock(&info.fs_err, info.path, target, lb, root, iterpool));
+      SVN_ERR(check_lock(&info.fs_err, info.path, target, lb, root,
+                         youngest, iterpool));
       info.lock = NULL;
       info.component = NULL;
       APR_ARRAY_PUSH(lb->infos, lock_info_t) = info;

Modified: subversion/branches/1.9.x/subversion/libsvn_ra_serf/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_ra_serf/lock.c?rev=1670556&r1=1670555&r2=1670556&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_ra_serf/lock.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_ra_serf/lock.c Wed Apr  1 04:00:12 2015
@@ -291,6 +291,7 @@ run_locks(svn_ra_serf__session_t *sess,
                                             ctx->handler->sline.reason);
                     break;
 
+                  case 404:
                   case 409:
                   case 500:
                     if (server_err)

Modified: subversion/branches/1.9.x/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/mod_dav_svn/util.c?rev=1670556&r1=1670555&r2=1670556&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/1.9.x/subversion/mod_dav_svn/util.c Wed Apr  1 04:00:12 2015
@@ -135,6 +135,7 @@ dav_svn__convert_err(svn_error_t *serr,
   switch (purged_serr->apr_err)
     {
     case SVN_ERR_FS_NOT_FOUND:
+    case SVN_ERR_FS_NO_SUCH_REVISION:
       status = HTTP_NOT_FOUND;
       break;
     case SVN_ERR_UNSUPPORTED_FEATURE:



Mime
View raw message