subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r889568 - in /subversion/trunk/subversion/tests/cmdline: obliterate_tests.py svntest/actions.py svntest/objects.py
Date Fri, 11 Dec 2009 10:51:05 GMT
Author: julianfoad
Date: Fri Dec 11 10:51:04 2009
New Revision: 889568

URL: http://svn.apache.org/viewvc?rev=889568&view=rev
Log:
Fix some portability problems with the python tests for obliterate which I
added in r889342. Remove the "import csvn" statement, as that module may not
be available and is not needed. Ignore any error in trying to dump the BDB
repository state using an external "db_dump" program, as that program may not
be available and the purpose is only to assist with external debugging.
When creating the empty repository, use a function that deletes any previous
repository at that location, so that it does not fail if a previous test run
did not clean up.

* subversion/tests/cmdline/svntest/objects.py
  Remove the "import csvn" statement and the associated commented-out usage.

* subversion/tests/cmdline/svntest/actions.py
  (guarantee_empty_repository): New function.

* subversion/tests/cmdline/obliterate_tests.py
  (obliterate_1): Use guarantee_empty_repository() instead of trying to
    create a repository directly. If an exception is thrown when dumping the
    BDB repository state, ignore it and continue.

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

Modified: subversion/trunk/subversion/tests/cmdline/obliterate_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/obliterate_tests.py?rev=889568&r1=889567&r2=889568&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/obliterate_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/obliterate_tests.py Fri Dec 11 10:51:04 2009
@@ -92,7 +92,7 @@
   "test svn obliterate"
 
   # Create empty repos and WC
-  main.create_repos(sbox.repo_dir)
+  actions.guarantee_empty_repository(sbox.repo_dir)
   expected_out = svntest.wc.State(sbox.wc_dir, {})
   expected_disk = svntest.wc.State(sbox.wc_dir, {})
   actions.run_and_verify_checkout(sbox.repo_url, sbox.wc_dir, expected_out,
@@ -107,14 +107,20 @@
   # Create scenarios ready for obliteration
   apple_rev = create_dd1_scenarios(wc)
 
-  # Dump the repository state
-  repo.dump('before.dump')
+  # Dump the repository state, if possible, for debugging
+  try:
+    repo.dump('before.dump')
+  except:
+    pass
 
   # Obliterate d/foo@{content=Apple}
   repo.obliterate_node_rev('/d/foo', apple_rev)
 
-  # Dump the repository state
-  repo.dump('after.dump')
+  # Dump the repository state, if possible, for debugging
+  try:
+    repo.dump('after.dump')
+  except:
+    pass
 
 
 ########################################################################

Modified: subversion/trunk/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/actions.py?rev=889568&r1=889567&r2=889568&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/actions.py Fri Dec 11 10:51:04 2009
@@ -105,12 +105,24 @@
 
 
 ######################################################################
+
+def guarantee_empty_repository(path):
+  """Guarantee that a local svn repository exists at PATH, containing
+  nothing."""
+
+  if path == main.pristine_dir:
+    print("ERROR:  attempt to overwrite the pristine repos!  Aborting.")
+    sys.exit(1)
+
+  # create an empty repository at PATH.
+  main.safe_rmtree(path)
+  main.create_repos(path)
+
 # Used by every test, so that they can run independently of  one
 # another. Every time this routine is called, it recursively copies
 # the `pristine repos' to a new location.
 # Note: make sure setup_pristine_repository was called once before
 # using this function.
-
 def guarantee_greek_repository(path):
   """Guarantee that a local svn repository exists at PATH, containing
   nothing but the greek-tree at revision 1."""

Modified: subversion/trunk/subversion/tests/cmdline/svntest/objects.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/objects.py?rev=889568&r1=889567&r2=889568&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/objects.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/objects.py Fri Dec 11 10:51:04 2009
@@ -27,8 +27,6 @@
 # General modules
 import shutil, sys, re, os, subprocess
 
-import csvn.wc
-
 # Our testing module
 import svntest
 from svntest import actions, main, tree, verify, wc
@@ -198,9 +196,6 @@
     # ### Shouldn't be in this class: should ask the repository instead.
     self.head_rev = 0
 
-    # ### experimenting with csvn (Python Ctypes bindings)
-    #self.wc = csvn.wc.WC(self.wc_absdir)
-
     print "## new SvnWC:"
     print self
 



Mime
View raw message