subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmpil...@apache.org
Subject svn commit: r1228362 - in /subversion/trunk/subversion: svnadmin/main.c tests/cmdline/svnadmin_tests.py
Date Fri, 06 Jan 2012 19:38:54 GMT
Author: cmpilato
Date: Fri Jan  6 19:38:54 2012
New Revision: 1228362

URL: http://svn.apache.org/viewvc?rev=1228362&view=rev
Log:
More cleanups in and around the 'svnadmin lock' subcommand code.

* subversion/svnadmin/main.c
  (cmd_table): Mention --bypass-hooks in 'lock' subcommand usage
    string.
  (subcommand_lock): Wrap path in 'lock' output in quotes.

* subversion/tests/cmdline/svnadmin_tests.py
  (locking): Expect paths in 'lock' output to be wrapped in quotes,
    and continue genericizing the error output regexps to mention only
    the error code.

Modified:
    subversion/trunk/subversion/svnadmin/main.c
    subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py

Modified: subversion/trunk/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnadmin/main.c?rev=1228362&r1=1228361&r2=1228362&view=diff
==============================================================================
--- subversion/trunk/subversion/svnadmin/main.c (original)
+++ subversion/trunk/subversion/svnadmin/main.c Fri Jan  6 19:38:54 2012
@@ -366,7 +366,8 @@ static const svn_opt_subcommand_desc2_t 
   {"lock", subcommand_lock, {0}, N_
    ("usage: svnadmin lock REPOS_PATH PATH USERNAME COMMENT-FILE [TOKEN]\n\n"
     "Lock PATH by USERNAME setting comments from COMMENT-FILE.\n"
-    "If provided, use TOKEN as lock token.\n"),
+    "If provided, use TOKEN as lock token.  Use --bypass-hooks to avoid\n"
+    "triggering the pre- and post-lock hook scripts.\n"),
   {svnadmin__bypass_hooks} },
 
   {"lslocks", subcommand_lslocks, {0}, N_
@@ -1507,7 +1508,7 @@ subcommand_lock(apr_getopt_t *os, void *
                               FALSE, subpool));
 
   SVN_ERR(svn_cmdline_printf(subpool,
-                             _("%s locked by user '%s'.\n"),
+                             _("'%s' locked by user '%s'.\n"),
                              lock_path, username));
 
   svn_pool_destroy(subpool);

Modified: subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py?rev=1228362&r1=1228361&r2=1228362&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py Fri Jan  6 19:38:54 2012
@@ -1657,8 +1657,7 @@ def locking(sbox):
   svntest.main.file_write(invalid_comment_path, "character  is invalid")
 
   # Test illegal character in comment file.
-  expected_error = "svnadmin: E130004: Lock comment contains " + \
-                   "illegal characters"
+  expected_error = ".*svnadmin: E130004:.*"
   svntest.actions.run_and_verify_svnadmin(None, None,
                                           expected_error, "lock", 
                                           sbox.repo_dir,
@@ -1666,7 +1665,7 @@ def locking(sbox):
                                           invalid_comment_path)
   
   # Test locking path with --bypass-hooks
-  expected_output = "iota locked by user 'jrandom'."
+  expected_output = "'iota' locked by user 'jrandom'."
   svntest.actions.run_and_verify_svnadmin(None, expected_output,
                                           None, "lock", 
                                           sbox.repo_dir,
@@ -1680,7 +1679,7 @@ def locking(sbox):
                                           sbox.repo_dir, "iota")
   
   # Test locking path without --bypass-hooks
-  expected_output = "iota locked by user 'jrandom'."
+  expected_output = "'iota' locked by user 'jrandom'."
   svntest.actions.run_and_verify_svnadmin(None, expected_output,
                                           None, "lock", 
                                           sbox.repo_dir,
@@ -1704,7 +1703,7 @@ def locking(sbox):
                                           comment_path)
 
   # Test locking a path with a specified token.
-  expected_output = "A/D/G/rho locked by user 'jrandom'."
+  expected_output = "'A/D/G/rho' locked by user 'jrandom'."
   lock_token = "opaquelocktoken:01234567-89ab-cdef-89ab-cdef01234567"
   svntest.actions.run_and_verify_svnadmin(None, expected_output,
                                           None, "lock", 
@@ -1714,9 +1713,7 @@ def locking(sbox):
 
   # Test locking path without --bypass-hooks to see that hook script
   # is really getting executed.
-  expected_error = "svnadmin: E165001: Lock blocked by pre-lock hook " + \
-                   "\(exit code 1\) with no output."
-
+  expected_error = ".*svnadmin: E165001:.*"
   hook_path = svntest.main.get_pre_lock_hook_path(sbox.repo_dir)
   svntest.main.create_python_hook_script(hook_path, 'import sys; sys.exit(1)')
 



Mime
View raw message