You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/06/15 14:16:00 UTC

svn commit: r954850 - /subversion/trunk/subversion/tests/cmdline/svntest/main.py

Author: hwright
Date: Tue Jun 15 12:15:59 2010
New Revision: 954850

URL: http://svn.apache.org/viewvc?rev=954850&view=rev
Log:
In the test suite, remove a separate global flag for knowing if the
comandline options have been parsed.  Actions which now attempt to check
the options object will just choke on a None options object, so the extra
variable and checks are superflous.

Plus, in the future, we may want to set the options object a different way,
and this gives us that option (no pun intended).

* subversion/tests/cmdline/svntest/main.py
  (command_line_parsed): Remove.
  (_check_command_line_parsed): Remove.
  (is_ra_type_dav, is_ra_type_dav_neon, is_ra_type_dav_serf, is_ra_type_svn,
   is_ra_type_file, is_fs_type_fsfs, server_has_mergeinfo,
   server_hash_revprop_commit, server_send_copyfrom_on_update,
   server_authz_has_aliases, server_gets_client_capabilities,
   server_has_partial_replay, server_enforces_date_syntax):
    Remove the explicit check for parsed commandlines.
  (run_tests): Don't set the removed variable.

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=954850&r1=954849&r2=954850&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Tue Jun 15 12:15:59 2010
@@ -146,11 +146,6 @@ def url2pathname(path):
   return os.path.normpath(urllib_parse_unquote(path))
 
 ######################################################################
-# Global variables set during option parsing.  These should not be used
-# until the variable command_line_parsed has been set to True, as is
-# done in run_tests below.
-command_line_parsed = False
-
 # The locations of the svn, svnadmin and svnlook binaries, relative to
 # the only scripts that import this file right now (they live in ../).
 # Use --bin to override these defaults.
@@ -984,41 +979,30 @@ def make_log_msg():
 # Functions which check the test configuration
 # (useful for conditional XFails)
 
-def _check_command_line_parsed():
-  """Raise an exception if the command line has not yet been parsed."""
-  if not command_line_parsed:
-    raise Failure("Condition cannot be tested until command line is parsed")
-
 def is_ra_type_dav():
-  _check_command_line_parsed()
   return options.test_area_url.startswith('http')
 
 def is_ra_type_dav_neon():
   """Return True iff running tests over RA-Neon.
      CAUTION: Result is only valid if svn was built to support both."""
-  _check_command_line_parsed()
   return options.test_area_url.startswith('http') and \
     (options.http_library == "neon")
 
 def is_ra_type_dav_serf():
   """Return True iff running tests over RA-Serf.
      CAUTION: Result is only valid if svn was built to support both."""
-  _check_command_line_parsed()
   return options.test_area_url.startswith('http') and \
     (options.http_library == "serf")
 
 def is_ra_type_svn():
   """Return True iff running tests over RA-svn."""
-  _check_command_line_parsed()
   return options.test_area_url.startswith('svn')
 
 def is_ra_type_file():
   """Return True iff running tests over RA-local."""
-  _check_command_line_parsed()
   return options.test_area_url.startswith('file')
 
 def is_fs_type_fsfs():
-  _check_command_line_parsed()
   # This assumes that fsfs is the default fs implementation.
   return options.fs_type == 'fsfs' or options.fs_type is None
 
@@ -1035,31 +1019,24 @@ def is_fs_case_insensitive():
   return (is_os_darwin() or is_os_windows())
 
 def server_has_mergeinfo():
-  _check_command_line_parsed()
   return options.server_minor_version >= 5
 
 def server_has_revprop_commit():
-  _check_command_line_parsed()
   return options.server_minor_version >= 5
 
 def server_sends_copyfrom_on_update():
-  _check_command_line_parsed()
   return options.server_minor_version >= 5
 
 def server_authz_has_aliases():
-  _check_command_line_parsed()
   return options.server_minor_version >= 5
 
 def server_gets_client_capabilities():
-  _check_command_line_parsed()
   return options.server_minor_version >= 5
 
 def server_has_partial_replay():
-  _check_command_line_parsed()
   return options.server_minor_version >= 5
 
 def server_enforces_date_syntax():
-  _check_command_line_parsed()
   return options.server_minor_version >= 5
 
 ######################################################################
@@ -1319,7 +1296,6 @@ def run_tests(test_list, serial_only = F
   global svnsync_binary
   global svndumpfilter_binary
   global svnversion_binary
-  global command_line_parsed
   global options
 
   testnums = []
@@ -1472,8 +1448,6 @@ def run_tests(test_list, serial_only = F
       svndumpfilter_binary = os.path.join(svn_bin, 'svndumpfilter' + _exe)
       svnversion_binary = os.path.join(svn_bin, 'svnversion' + _exe)
 
-  command_line_parsed = True
-
   ######################################################################
 
   # Cleanup: if a previous run crashed or interrupted the python