You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2022/01/25 07:33:34 UTC

svn commit: r1897439 - /subversion/trunk/subversion/tests/cmdline/pegrev_parse_tests.py

Author: danielsh
Date: Tue Jan 25 07:33:33 2022
New Revision: 1897439

URL: http://svn.apache.org/viewvc?rev=1897439&view=rev
Log:
Rename an internal function.  No functional change.

The name of pegrev_parse_tests.run_svn() can be confused with the name of
svntest.main.run_svn() when using one's $EDITOR's "Jump to the definition of
the function named «run_svn»" functionality, or when referring to functions
solely by their basename.  Furthermore, calling the latter function with actual
arguments appropriate for the former doesn't raise any obvious exception; for
instance, calling «svntest.main.run_svn(sbox, None, [], 'info')» actually runs
«svn None "[]" info» and — because «sbox» is true in boolean context, and
svntest.main.run_svn() doesn't inspect its first actual argument in any other
way — doesn't raise any exception when that command returns a non-zero exit
code.

Furthermore, the new name is more descriptive.

* subversion/tests/cmdline/pegrev_parse_tests.py
  (run_svn): Rename to…
  (run_svn_at_wcdir): … this.

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

Modified: subversion/trunk/subversion/tests/cmdline/pegrev_parse_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/pegrev_parse_tests.py?rev=1897439&r1=1897438&r2=1897439&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/pegrev_parse_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/pegrev_parse_tests.py Tue Jan 25 07:33:33 2022
@@ -52,7 +52,7 @@ Item = wc.StateItem
 # commands, because the parser may have (and as of this writing does have)
 # edge-case bugs that we can only expose in this way. Therefore, these helpers
 # ensure that we run 'svn' with the CWD at the root of the working copy.
-def run_svn(sbox, expected_status, expected_stderr, *varargs):
+def run_svn_at_wcdir(sbox, expected_status, expected_stderr, *varargs):
   if expected_stderr is None:
     expected_stderr = []
 
@@ -96,8 +96,8 @@ def do_add_file(sbox, dst, dst_cmdline,
     expected_status.add({dst: Item(status='A ', wc_rev='-')})
 
   main.file_write(sbox.ospath(dst), "This is file '"  + dst + "'.")
-  run_svn(sbox, expected_status, expected_stderr,
-          'add', dst_cmdline)
+  run_svn_at_wcdir(sbox, expected_status, expected_stderr,
+                   'add', dst_cmdline)
 
 def do_add_file_e(sbox, dst, dst_cmdline, expected_stderr=None):
   "like do_add_file() but with an empty sandbox"
@@ -109,8 +109,8 @@ def do_make_dir(sbox, dst, dst_cmdline,
   if expected_status is not None:
     expected_status.add({dst: Item(status='A ', wc_rev='-')})
 
-  run_svn(sbox, expected_status, expected_stderr,
-          'mkdir', dst_cmdline)
+  run_svn_at_wcdir(sbox, expected_status, expected_stderr,
+                   'mkdir', dst_cmdline)
 
 def do_make_dir_e(sbox, dst, dst_cmdline, expected_stderr=None):
   "like do_make_dir() but with an empty sandbox"
@@ -121,8 +121,8 @@ def do_remove(sbox, dst, dst_cmdline, ex
   if expected_status is not None and dst in expected_status.desc:
     expected_status.tweak(dst, status='D ')
 
-  run_svn(sbox, expected_status, expected_stderr,
-          'remove', dst_cmdline)
+  run_svn_at_wcdir(sbox, expected_status, expected_stderr,
+                   'remove', dst_cmdline)
 
 def do_rename(sbox, src, src_cmdline, dst, dst_cmdline,
               expected_stderr=None):
@@ -132,8 +132,8 @@ def do_rename(sbox, src, src_cmdline, ds
     expected_status.add({dst: Item(status='A ', copied='+',
                                    moved_from=src, wc_rev='-')})
 
-  run_svn(sbox, expected_status, expected_stderr,
-          'rename', src_cmdline, dst_cmdline)
+  run_svn_at_wcdir(sbox, expected_status, expected_stderr,
+                   'rename', src_cmdline, dst_cmdline)
 
 
 ######################################################################