You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/07/22 15:59:51 UTC

svn commit: r966660 - /subversion/trunk/subversion/tests/cmdline/svntest/actions.py

Author: philip
Date: Thu Jul 22 13:59:51 2010
New Revision: 966660

URL: http://svn.apache.org/viewvc?rev=966660&view=rev
Log:
* subversion/tests/cmdline/svntest/actions.py
  (lock_admin_dir): Prepare for single-db.

Modified:
    subversion/trunk/subversion/tests/cmdline/svntest/actions.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/actions.py?rev=966660&r1=966659&r2=966660&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/actions.py Thu Jul 22 13:59:51 2010
@@ -1602,12 +1602,25 @@ def get_virginal_state(wc_dir, rev):
 # Cheap administrative directory locking
 def lock_admin_dir(wc_dir):
   "Lock a SVN administrative directory"
+  dot_svn = svntest.main.get_admin_name()
+  root_path = wc_dir
+  relpath = ''
+
+  while True:
+    db_path = os.path.join(root_path, dot_svn, 'wc.db')
+    try:
+      db = svntest.sqlite3.connect(db_path)
+      break
+    except: pass
+    head, tail = os.path.split(root_path)
+    if head == root_path:
+      raise svntest.Failure("No DB for " + file_path)
+    root_path = head
+    relpath = os.path.join(tail, relpath).rstrip('/')
 
-  db = svntest.sqlite3.connect(os.path.join(wc_dir, main.get_admin_name(),
-                                            'wc.db'))
   db.execute('insert into wc_lock (wc_id, local_dir_relpath, locked_levels) '
              + 'values (?, ?, ?)',
-             (1, '', 0))
+             (1, relpath, 0))
   db.commit()
   db.close()