Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED37AE6E2 for ; Fri, 8 Feb 2013 21:07:10 +0000 (UTC) Received: (qmail 87749 invoked by uid 500); 8 Feb 2013 21:07:10 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 87719 invoked by uid 500); 8 Feb 2013 21:07:10 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 87712 invoked by uid 99); 8 Feb 2013 21:07:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2013 21:07:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2013 21:07:08 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 30CAF23889D7; Fri, 8 Feb 2013 21:06:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1444238 - /subversion/trunk/subversion/tests/cmdline/input_validation_tests.py Date: Fri, 08 Feb 2013 21:06:48 -0000 To: commits@subversion.apache.org From: rhuijben@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130208210648.30CAF23889D7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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__':