You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/05/02 15:15:48 UTC

svn commit: r1098549 - in /subversion/trunk/subversion/tests/cmdline: svntest/actions.py svntest/sandbox.py svnversion_tests.py

Author: rhuijben
Date: Mon May  2 13:15:47 2011
New Revision: 1098549

URL: http://svn.apache.org/viewvc?rev=1098549&view=rev
Log:
For issue #3858, add an XFail test on the simple svnversion output.

* subversion/tests/cmdline/svntest/actions.py
  (run_and_verify_svnversion): Rename argument to match documentation.
  (run_and_verify_svnversion2): Allow running without trail_url.

* subversion/tests/cmdline/svntest/sandbox.py
  (simple_switch): New function.

* subversion/tests/cmdline/svnversion_tests.py
  (child_switched): New function, showing behavior changes since 1.6.
  (test_list): Add child_switched.

Modified:
    subversion/trunk/subversion/tests/cmdline/svntest/actions.py
    subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py
    subversion/trunk/subversion/tests/cmdline/svnversion_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/actions.py?rev=1098549&r1=1098548&r2=1098549&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/actions.py Mon May  2 13:15:47 2011
@@ -226,7 +226,7 @@ def run_and_verify_svnadmin2(message, ex
   return exit_code, out, err
 
 
-def run_and_verify_svnversion(message, wc_dir, repo_url,
+def run_and_verify_svnversion(message, wc_dir, trail_url,
                               expected_stdout, expected_stderr, *varargs):
   """like run_and_verify_svnversion2, but the expected exit code is
   assumed to be 0 if no output is expected on stderr, and 1 otherwise."""
@@ -234,16 +234,20 @@ def run_and_verify_svnversion(message, w
   expected_exit = 0
   if expected_stderr is not None and expected_stderr != []:
     expected_exit = 1
-  return run_and_verify_svnversion2(message, wc_dir, repo_url,
+  return run_and_verify_svnversion2(message, wc_dir, trail_url,
                                     expected_stdout, expected_stderr,
                                     expected_exit, *varargs)
 
-def run_and_verify_svnversion2(message, wc_dir, repo_url,
+def run_and_verify_svnversion2(message, wc_dir, trail_url,
                                expected_stdout, expected_stderr,
                                expected_exit, *varargs):
   """Run svnversion command and check its output and exit code."""
 
-  exit_code, out, err = main.run_svnversion(wc_dir, repo_url, *varargs)
+  if trail_url is None:
+    exit_code, out, err = main.run_svnversion(wc_dir, *varargs)
+  else:
+    exit_code, out, err = main.run_svnversion(wc_dir, trail_url, *varargs)
+
   verify.verify_outputs("Unexpected output", out, err,
                         expected_stdout, expected_stderr)
   verify.verify_exit_code(message, exit_code, expected_exit)

Modified: subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py?rev=1098549&r1=1098548&r2=1098549&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py Mon May  2 13:15:47 2011
@@ -196,6 +196,14 @@ class Sandbox:
       target = self.ospath(target)
     svntest.main.run_svn(False, 'update', target)
 
+  def simple_switch(self, url, target=None):
+    """Switch a TARGET to URL"""
+    if target is None:
+      target = self.wc_dir
+    else:
+      target = self.ospath(target)
+    svntest.main.run_svn(False, 'switch', url, target, '--ignore-ancestry')
+
   def simple_commit(self, target=None):
     """Commit the WC or TARGET with a default log message.
        TARGET is a relpath relative to the WC."""

Modified: subversion/trunk/subversion/tests/cmdline/svnversion_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnversion_tests.py?rev=1098549&r1=1098548&r2=1098549&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnversion_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnversion_tests.py Mon May  2 13:15:47 2011
@@ -317,6 +317,48 @@ def non_reposroot_wc(sbox):
                                             wc_dir, repo_url,
                                             [ "1\n" ], [])
 
+@XFail()
+@Issue(3858)
+def child_switched(sbox):
+  "test svnversion output for switched children"
+  sbox.build(read_only = True)
+  wc_dir = sbox.wc_dir
+  repo_url = sbox.repo_url
+
+  sbox.simple_switch(repo_url + '/A/D', 'A/B')
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/B', switched='S')
+  expected_status.add( {
+      'A/B/H'             : Item(status='  ', wc_rev='1'),
+      'A/B/H/psi'         : Item(status='  ', wc_rev='1'),
+      'A/B/H/omega'       : Item(status='  ', wc_rev='1'),
+      'A/B/H/chi'         : Item(status='  ', wc_rev='1'),
+      'A/B/G'             : Item(status='  ', wc_rev='1'),
+      'A/B/G/tau'         : Item(status='  ', wc_rev='1'),
+      'A/B/G/pi'          : Item(status='  ', wc_rev='1'),
+      'A/B/G/rho'         : Item(status='  ', wc_rev='1'),
+      'A/B/gamma'         : Item(status='  ', wc_rev='1'),
+  })
+  expected_status.remove('A/B/E', 'A/B/E/alpha', 'A/B/E/beta', 'A/B/lambda',
+                         'A/B/F')
+
+
+  # Commit the new binary file, creating revision 2.
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+  # This should detect the switch at A/B
+  svntest.actions.run_and_verify_svnversion(None, wc_dir, None,
+                                            [ "1S\n" ], [])
+
+  # But A/B/G and its children are not switched by itself
+  svntest.actions.run_and_verify_svnversion(None, os.path.join(wc_dir,'A/B/G'),
+                                            None, [ "1\n" ], [])
+
+  # And A/B isn't when you look at it directlry
+  svntest.actions.run_and_verify_svnversion(None, os.path.join(wc_dir,'A/B'),
+                                            None, [ "1\n" ], [])
+
 
 ########################################################################
 # Run the tests
@@ -330,6 +372,7 @@ test_list = [ None,
               svnversion_with_structural_changes,
               committed_revisions,
               non_reposroot_wc,
+              child_switched,
              ]
 
 if __name__ == '__main__':