subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1444238 - /subversion/trunk/subversion/tests/cmdline/input_validation_tests.py
Date Fri, 08 Feb 2013 21:06:48 GMT
Author: rhuijben
Date: Fri Feb  8 21:06:47 2013
New Revision: 1444238

URL: http://svn.apache.org/r1444238
Log:
Add a regression test for some stupid user errors that might break the working
copy if we don't detect them.

* subversion/tests/cmdline/input_validation_tests.py
  (delete_repos_root): New test.
  (test_list): Add test.

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

Modified: subversion/trunk/subversion/tests/cmdline/input_validation_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/input_validation_tests.py?rev=1444238&r1=1444237&r2=1444238&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/input_validation_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/input_validation_tests.py Fri Feb  8 21:06:47
2013
@@ -252,6 +252,48 @@ def invalid_update_targets(sbox):
   run_and_verify_svn_in_wc(sbox, "svn:.*is not a local path", 'update',
                            "^/")
 
+@XFail()
+def delete_repos_root(sbox):
+  "do stupid things with the repository root"
+
+  sbox.build(read_only=True)
+  wc_dir = sbox.wc_dir
+  repo_url = sbox.repo_url
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+
+  expected_status.tweak('A/D/G', switched='S')
+  expected_status.remove('A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau')
+  svntest.actions.run_and_verify_switch(sbox.wc_dir, sbox.ospath('A/D/G'),
+                                        repo_url,
+                                        None, None, expected_status,
+                                        None, None, None, None, None, None,
+                                        '--set-depth', 'empty', '--ignore-ancestry')
+
+  expected_status.tweak('A/B/F', switched='S')
+  svntest.actions.run_and_verify_switch(sbox.wc_dir, sbox.ospath('A/B/F'),
+                                        repo_url,
+                                        None, None, expected_status,
+                                        None, None, None, None, None, None,
+                                        '--depth', 'empty', '--ignore-ancestry')
+
+  # Delete the wcroot (which happens to be the repository root)
+  expected_error = 'svn: E155035: \'.*\' is the root of a working copy ' + \
+                   'and cannot be deleted'
+  svntest.actions.run_and_verify_svn('Delete root', [], expected_error,
+                                     'rm', wc_dir)
+
+  # This should produce some error, because we can never commit this
+  expected_error = '.*repository root.*'
+  svntest.actions.run_and_verify_svn('Move root', [], expected_error,
+                                     'mv', sbox.ospath('A/D/G'),
+                                     sbox.ospath('Z'))
+
+  # And this currently fails with another nasty error about a wc-lock
+  expected_error = '.*repository root.*'
+  svntest.actions.run_and_verify_svn('Delete root', [], expected_error,
+                                     'rm', sbox.ospath('A/B/F'))
+
 ########################################################################
 # Run the tests
 
@@ -281,6 +323,7 @@ test_list = [ None,
               invalid_relocate_targets,
               invalid_mkdir_targets,
               invalid_update_targets,
+              delete_repos_root,
              ]
 
 if __name__ == '__main__':



Mime
View raw message