subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1816949 - /subversion/trunk/subversion/tests/cmdline/svntest/main.py
Date Sat, 02 Dec 2017 13:21:00 GMT
Author: stefan2
Date: Sat Dec  2 13:21:00 2017
New Revision: 1816949

URL: http://svn.apache.org/viewvc?rev=1816949&view=rev
Log:
In our test suite, use more generic code to support old FSFS versions.

Over ra_svn, 76 test are failing for fsfs-v1, 70 for v2 and 21 for v3,
while v4, v6 and v7 pass.

* subversion/tests/cmdline/svntest/main.py
  (parse_options): Replace the ever-growing 'if' chain by a one generic
                   check using a simple Python dict.

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

Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=1816949&r1=1816948&r2=1816949&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Sat Dec  2 13:21:00 2017
@@ -2216,25 +2216,18 @@ def parse_options(arglist=sys.argv[1:],
                  % SVN_VER_MINOR)
 
   # Make sure the server-minor-version matches the fsfs-version parameter.
+  #
+  # Server versions that introduced the respective FSFS formats:
+  introducing_version = { 1:1, 2:4, 3:5, 4:7, 6:8, 7:9 }
   if options.fsfs_version:
-    if options.fsfs_version == 7:
+    if options.fsfs_version in introducing_version:
+      introduced_in = introducing_version[options.fsfs_version]
       if options.server_minor_version \
-        and options.server_minor_version != 9 \
+        and options.server_minor_version != introduced_in \
         and options.server_minor_version != SVN_VER_MINOR:
-        parser.error("--fsfs-version=7 requires --server-minor-version=9")
-      options.server_minor_version = 9
-    if options.fsfs_version == 6:
-      if options.server_minor_version \
-        and options.server_minor_version != 8 \
-        and options.server_minor_version != SVN_VER_MINOR:
-        parser.error("--fsfs-version=6 requires --server-minor-version=8")
-      options.server_minor_version = 8
-    if options.fsfs_version == 4:
-      if options.server_minor_version \
-        and options.server_minor_version != 7 \
-        and options.server_minor_version != SVN_VER_MINOR:
-        parser.error("--fsfs-version=4 requires --server-minor-version=7")
-      options.server_minor_version = 7
+        parser.error("--fsfs-version=%d requires --server-minor-version=%d" \
+                     % (options.fsfs_version, introduced_in))
+      options.server_minor_version = introduced_in
     pass
     # ### Add more tweaks here if and when we support pre-cooked versions
     # ### of FSFS repositories.



Mime
View raw message