subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1743225 - /subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
Date Tue, 10 May 2016 16:30:17 GMT
Author: stefan2
Date: Tue May 10 16:30:17 2016
New Revision: 1743225

URL: http://svn.apache.org/viewvc?rev=1743225&view=rev
Log:
Follow-up to r1743217:  Fix svnadmin tests in Windows.

* subversion/tests/cmdline/svnadmin_tests.py
  (patch_format): We have to process the format file as binary to prevent
                platform-specific 
  (is_sharded): Although we only read here, we use binary processing here
                as well for consistency / to prevent confusion.

Modified:
    subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py?rev=1743225&r1=1743224&r2=1743225&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py Tue May 10 16:30:17 2016
@@ -236,27 +236,27 @@ def patch_format(repo_dir, shard_size):
   that it would use sharding with SHARDS revisions per shard."""
 
   format_path = os.path.join(repo_dir, "db", "format")
-  contents = open(format_path, 'r').read()
+  contents = open(format_path, 'rb').read()
   processed_lines = []
 
-  for line in contents.split("\n"):
+  for line in contents.split(b"\n"):
     if line.startswith("layout "):
-      processed_lines.append("layout sharded %d" % shard_size)
+      processed_lines.append(("layout sharded %d" % shard_size).encode())
     else:
       processed_lines.append(line)
 
-  new_contents = "\n".join(processed_lines)
+  new_contents = b"\n".join(processed_lines)
   os.chmod(format_path, svntest.main.S_ALL_RW)
-  open(format_path, 'w').write(new_contents)
+  open(format_path, 'wb').write(new_contents)
 
 def is_sharded(repo_dir):
   """Return whether the FSFS repository REPO_DIR is sharded."""
 
   format_path = os.path.join(repo_dir, "db", "format")
-  contents = open(format_path, 'r').read()
+  contents = open(format_path, 'rb').read()
 
-  for line in contents.split("\n"):
-    if line.startswith("layout sharded"):
+  for line in contents.split(b"\n"):
+    if line.startswith(b"layout sharded"):
       return True
 
   return False



Mime
View raw message