subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1664672 - /subversion/trunk/subversion/mod_dav_svn/repos.c
Date Fri, 06 Mar 2015 16:00:16 GMT
Author: rhuijben
Date: Fri Mar  6 16:00:15 2015
New Revision: 1664672

URL: http://svn.apache.org/r1664672
Log:
Following up on r1664664, make mod_dav return a proper error when a commit
specifies a higher revision than the one committing against. This fixes
out of date detection for too-new revisions via httpv2.
(For httpv1 this happens on the checkout requests)

* subversion/mod_dav_svn/repos.c
  (do_out_of_date_check): Verify that a passed revision makes sense, instead
    of that it is ok when it is higher than anything we know.

Modified:
    subversion/trunk/subversion/mod_dav_svn/repos.c

Modified: subversion/trunk/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/repos.c?rev=1664672&r1=1664671&r2=1664672&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/repos.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/repos.c Fri Mar  6 16:00:15 2015
@@ -1858,6 +1858,22 @@ do_out_of_date_check(dav_resource_combin
                                       "Attempting to modify out-of-date resource.",
                                       r->pool);
         }
+      else if (comb->priv.version_name > created_rev)
+        {
+          svn_revnum_t txn_base_rev;
+
+          txn_base_rev = svn_fs_txn_base_revision(comb->res.info->root.txn);
+          if (comb->priv.version_name > txn_base_rev)
+            {
+              serr = svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
+                                       "No such revision %ld",
+                                       comb->priv.version_name);
+
+              return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+                                          "Unknown base revision",
+                                          r->pool);
+            }
+        }
     }
   else if (comb->res.collection)
     {



Mime
View raw message