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/09/22 23:05:04 UTC

svn commit: r1000230 - /subversion/trunk/subversion/tests/cmdline/svntest/wc.py

Author: philip
Date: Wed Sep 22 21:05:04 2010
New Revision: 1000230

URL: http://svn.apache.org/viewvc?rev=1000230&view=rev
Log:
Add NODES support to the testsuite.

* subversion/tests/cmdline/svntest/wc.py
  (text_base_path): Remove WORKING_NODE support, it was not used and
   didn't work, remove per-dir support, add NODES support.

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

Modified: subversion/trunk/subversion/tests/cmdline/svntest/wc.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/wc.py?rev=1000230&r1=1000229&r2=1000230&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/wc.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/wc.py Wed Sep 22 21:05:04 2010
@@ -836,18 +836,23 @@ def text_base_path(file_path):
     relpath = os.path.join(tail, relpath).replace(os.sep, '/')
 
   c = db.cursor()
-  c.execute("""select checksum from working_node
-               where local_relpath = '""" + relpath + """'""")
-  checksum = c.fetchone()
-  if checksum is None:
+  # NODES conversion is complete enough that we can use it if it exists
+  c.execute("""pragma table_info(nodes)""")
+  if c.fetchone():
+    c.execute("""select checksum from nodes
+                 where local_relpath = '""" + relpath + """'
+                 and op_depth = 0""")
+  else:
     c.execute("""select checksum from base_node
                  where local_relpath = '""" + relpath + """'""")
-    checksum = c.fetchone()[0]
-  if checksum is not None and checksum[0:6] == "$md5 $":
-    c.execute("""select checksum from pristine
-                 where md5_checksum = '""" + checksum + """'""")
-    checksum = c.fetchone()[0]
-  if checksum is None:
+  row = c.fetchone()
+  if row is not None:
+    checksum = row[0]
+    if checksum is not None and checksum[0:6] == "$md5 $":
+      c.execute("""select checksum from pristine
+                   where md5_checksum = '""" + checksum + """'""")
+      checksum = c.fetchone()[0]
+  if row is None or checksum is None:
     raise svntest.Failure("No SHA1 checksum for " + relpath)
   db.close()
 
@@ -858,8 +863,7 @@ def text_base_path(file_path):
   if os.path.isfile(fn):
     return fn
 
-  # Calculate per dir location
-  return os.path.join(root_path, dot_svn, 'pristine', checksum)
+  raise svntest.Failure("No pristine text for " + relpath)
 
 
 # ------------