subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1591134 - in /subversion/branches/1.8.x: ./ STATUS subversion/mod_dav_svn/lock.c subversion/tests/cmdline/lock_tests.py
Date Tue, 29 Apr 2014 22:51:46 GMT
Author: breser
Date: Tue Apr 29 22:51:45 2014
New Revision: 1591134

URL: http://svn.apache.org/r1591134
Log:
Merge the r1584576 group from trunk:

 * r1584576, r1584592, r1584745
   Resolve issue #3515 "mod_dav_svn cannot refresh any locks"
   Justification:
     Without this patch generic DAV clients can not refresh their own locks,
     causing them to lose their locks.
   Notes:
     Patch needed, because a plain merge triggers a text conflict while
     removing the XFail marker from the test. r1584745 makes the test code
     compatible with 1.8.
   Votes:
     +1: rhuijben, philip, breser


Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/mod_dav_svn/lock.c
    subversion/branches/1.8.x/subversion/tests/cmdline/lock_tests.py

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1584576,1584592,1584745

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1591134&r1=1591133&r2=1591134&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Tue Apr 29 22:51:45 2014
@@ -181,18 +181,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1584576, r1584592, r1584745
-   Resolve issue #3515 "mod_dav_svn cannot refresh any locks"
-   Justification:
-     Without this patch generic DAV clients can not refresh their own locks,
-     causing them to lose their locks.
-   Notes:
-     Patch needed, because a plain merge triggers a text conflict while
-     removing the XFail marker from the test. r1584745 makes the test code
-     compatible with 1.8.
-   Votes:
-     +1: rhuijben, philip, breser
-
  * r1580626, r1580650, r1581430
    Fix 'svn copy URL WC' after the working copy is relocated
    Justification:

Modified: subversion/branches/1.8.x/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/mod_dav_svn/lock.c?rev=1591134&r1=1591133&r2=1591134&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/mod_dav_svn/lock.c (original)
+++ subversion/branches/1.8.x/subversion/mod_dav_svn/lock.c Tue Apr 29 22:51:45 2014
@@ -453,7 +453,8 @@ get_locks(dav_lockdb *lockdb,
      lock.  For the --force case, this is required and for the non-force case,
      we allow the filesystem to produce a better error for svn clients.
   */
-  if (info->r->method_number == M_LOCK)
+  if (info->r->method_number == M_LOCK
+      && resource->info->repos->is_svn_client)
     {
       *locks = NULL;
       return 0;
@@ -594,7 +595,8 @@ has_locks(dav_lockdb *lockdb, const dav_
      lock.  For the --force case, this is required and for the non-force case,
      we allow the filesystem to produce a better error for svn clients.
   */
-  if (info->r->method_number == M_LOCK)
+  if (info->r->method_number == M_LOCK
+      && resource->info->repos->is_svn_client)
     {
       *locks_present = 0;
       return 0;

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=1591134&r1=1591133&r2=1591134&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 22:51:45 2014
@@ -1990,6 +1990,47 @@ def non_root_locks(sbox):
   expected_status.tweak('A/D/G/pi', writelocked=None)
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
+@Issue(3515)
+@SkipUnless(svntest.main.is_ra_type_dav)
+def dav_lock_refresh(sbox):
+  "refresh timeout of DAV lock"
+
+  import httplib
+  from urlparse import urlparse
+  import base64
+
+  sbox.build(create_wc = False)
+
+  # Acquire lock on 'iota'
+  svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
+                                     sbox.repo_url + '/iota')
+
+  # Try to refresh lock using 'If' header
+  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_token = svntest.actions.run_and_parse_info(sbox.repo_url + '/iota')[0]['Lock Token']
+
+  lock_headers = {
+    'Authorization': 'Basic ' + base64.b64encode('jrandom:rayjandom'),
+    'If': '(<' + lock_token + '>)',
+    'Timeout': 'Second-7200'
+  }
+
+  # Enabling the following line makes this test easier to debug
+  h.set_debuglevel(9)
+
+  h.request('LOCK', sbox.repo_url + '/iota', '', lock_headers)
+
+  # XFAIL Refreshing of DAV lock fails with error '412 Precondition Failed'
+  r = h.getresponse()
+  if r.status != httplib.OK:
+    raise svntest.Failure('Lock refresh failed: %d %s' % (r.status, r.reason))
+
 ########################################################################
 # Run the tests
 
@@ -2045,6 +2086,7 @@ test_list = [ None,
               drop_locks_on_parent_deletion,
               dav_lock_timeout,
               non_root_locks,
+              dav_lock_refresh,
             ]
 
 if __name__ == '__main__':



Mime
View raw message