subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1591114 - in /subversion/branches/1.8.x: ./ STATUS configure.ac subversion/libsvn_ra_serf/locks.c subversion/tests/cmdline/lock_tests.py
Date Tue, 29 Apr 2014 21:34:09 GMT
Author: breser
Date: Tue Apr 29 21:34:08 2014
New Revision: 1591114

URL: http://svn.apache.org/r1591114
Log:
Merge the 1.8.x-r1579588 branch:

 * r1579588
   ra_serf: Fix 'svn unlock' interop with generic DAV clients that use timeout
   Justification:
     Local fix to resolve user reported issue.
   Notes:
     Branch needed as the lock code was split to multiple files on trunk.
   Branch:
     ^/subversion/branches/1.8.x-r1579588
   Votes:
     +1: philip, rhuijben, breser


Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/configure.ac   (props changed)
    subversion/branches/1.8.x/subversion/libsvn_ra_serf/locks.c   (contents, props changed)
    subversion/branches/1.8.x/subversion/tests/cmdline/lock_tests.py

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1579588
  Merged /subversion/branches/1.8.x-r1579588:r1579589-1591112

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1591114&r1=1591113&r2=1591114&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Tue Apr 29 21:34:08 2014
@@ -173,17 +173,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1579588
-   ra_serf: Fix 'svn unlock' interop with generic DAV clients that use timeout
-   Justification:
-     Local fix to resolve user reported issue.
-   Notes:
-     Branch needed as the lock code was split to multiple files on trunk.
-   Branch:
-     ^/subversion/branches/1.8.x-r1579588
-   Votes:
-     +1: philip, rhuijben, breser
-
  * r1584576, r1584592, r1584745
    Resolve issue #3515 "mod_dav_svn cannot refresh any locks"
    Justification:

Propchange: subversion/branches/1.8.x/configure.ac
------------------------------------------------------------------------------
  Merged /subversion/branches/1.8.x-r1579588/configure.ac:r1579589-1591112

Modified: subversion/branches/1.8.x/subversion/libsvn_ra_serf/locks.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_ra_serf/locks.c?rev=1591114&r1=1591113&r2=1591114&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_ra_serf/locks.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_ra_serf/locks.c Tue Apr 29 21:34:08 2014
@@ -156,11 +156,20 @@ locks_closed(svn_ra_serf__xml_estate_t *
 
   if (leaving_state == TIMEOUT)
     {
-      if (strcmp(cdata->data, "Infinite") == 0)
+      if (strcasecmp(cdata->data, "Infinite") == 0)
         lock_ctx->lock->expiration_date = 0;
+      else if (strncasecmp(cdata->data, "Second-", 7) == 0)
+        {
+          unsigned n;
+          SVN_ERR(svn_cstring_atoui(&n, cdata->data+7));
+
+          lock_ctx->lock->expiration_date = apr_time_now() +
+                                            apr_time_from_sec(n);
+        }
       else
-        SVN_ERR(svn_time_from_cstring(&lock_ctx->lock->creation_date,
-                                      cdata->data, lock_ctx->pool));
+        return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
+                                 _("Invalid LOCK timeout value '%s'"),
+                                 cdata->data);
     }
   else if (leaving_state == HREF)
     {

Propchange: subversion/branches/1.8.x/subversion/libsvn_ra_serf/locks.c
------------------------------------------------------------------------------
  Merged /subversion/trunk/subversion/libsvn_ra_serf/locks.c:r1573106,1573209,1579588
  Merged /subversion/branches/1.8.x-r1579588/subversion/libsvn_ra_serf/locks.c:r1579589-1591112

Modified: subversion/branches/1.8.x/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/tests/cmdline/lock_tests.py?rev=1591114&r1=1591113&r2=1591114&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/1.8.x/subversion/tests/cmdline/lock_tests.py Tue Apr 29 21:34:08 2014
@@ -1890,6 +1890,56 @@ def drop_locks_on_parent_deletion(sbox):
                                         wc_dir)
 	
 										
+@SkipUnless(svntest.main.is_ra_type_dav)
+def dav_lock_timeout(sbox):
+  "unlock a lock with timeout"
+
+  import httplib
+  from urlparse import urlparse
+  import base64
+
+  sbox.build()
+  loc = urlparse(sbox.repo_url)
+
+  if loc.scheme == 'http':
+    h = httplib.HTTPConnection(loc.hostname, loc.port)
+  else:
+    h = httplib.HTTPSConnection(loc.hostname, loc.port)
+
+  lock_body = '<?xml version="1.0" encoding="utf-8" ?>' \
+              '<D:lockinfo xmlns:D="DAV:">' \
+              '  <D:lockscope><D:exclusive/></D:lockscope>' \
+              '  <D:locktype><D:write/></D:locktype>' \
+              '  <D:owner>' \
+              '       <D:href>http://a/test</D:href>' \
+              '  </D:owner>' \
+              '</D:lockinfo>'
+
+  lock_headers = {
+    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Timeout': 'Second-86400'
+  }
+
+  # Enabling the following line makes this test easier to debug
+  h.set_debuglevel(9)
+
+  h.request('LOCK', sbox.repo_url + '/iota', lock_body, lock_headers)
+
+  r = h.getresponse()
+
+  # Verify that there is a lock, by trying to obtain one
+  svntest.actions.run_and_verify_svn2(None, None, ".*locked by user", 0,
+                                      'lock', '-m', '', sbox.ospath('iota'))
+
+  # Before this patch this used to fail with a parse error of the timeout
+  svntest.actions.run_and_verify_svn2(None, None, ".*W160039.*Unlock.*403", 0,
+                                     'unlock', sbox.repo_url + '/iota')
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'unlock', sbox.ospath('iota'), '--force')
+
+
+
 def non_root_locks(sbox):
   "locks for working copies not at repos root"
 
@@ -1993,6 +2043,7 @@ test_list = [ None,
               lock_unlock_deleted,
               commit_stolen_lock,
               drop_locks_on_parent_deletion,
+              dav_lock_timeout,
               non_root_locks,
             ]
 



Mime
View raw message