subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1797122 - in /subversion/trunk/subversion: svnadmin/svnadmin.c tests/cmdline/svnadmin_tests.py
Date Wed, 31 May 2017 21:57:59 GMT
Author: danielsh
Date: Wed May 31 21:57:59 2017
New Revision: 1797122

URL: http://svn.apache.org/viewvc?rev=1797122&view=rev
Log:
svnadmin: Print LOCK_PATH's correctly.

Review by: julianfoad

* subversion/svnadmin/svnadmin.c
  (subcommand_lock,
   subcommand_unlock,
   subcommand_rmlocks): Print the UTF-8, canonical version of the path.
     Using UTF-8 is a requirement of the API; using the canonical version
     is consistent with the cmdline client.

* subversion/tests/cmdline/svnadmin_tests.py
  (locking): Add leading slash to expected outputs.

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

Modified: subversion/trunk/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnadmin/svnadmin.c?rev=1797122&r1=1797121&r2=1797122&view=diff
==============================================================================
--- subversion/trunk/subversion/svnadmin/svnadmin.c (original)
+++ subversion/trunk/subversion/svnadmin/svnadmin.c Wed May 31 21:57:59 2017
@@ -2357,7 +2357,7 @@ subcommand_lock(apr_getopt_t *os, void *
 
   if (! opt_state->quiet)
     SVN_ERR(svn_cmdline_printf(pool, _("'%s' locked by user '%s'.\n"),
-                               lock_path, username));
+                               lock_path_utf8, username));
 
   return SVN_NO_ERROR;
 }
@@ -2486,9 +2486,10 @@ subcommand_rmlocks(apr_getopt_t *os, voi
           if (! opt_state->quiet)
             SVN_ERR(svn_cmdline_printf(subpool,
                                        _("Path '%s' isn't locked.\n"),
-                                       lock_path));
+                                       lock_path_utf8));
           continue;
         }
+      lock = NULL; /* Don't access LOCK after this point. */
 
       /* Now forcibly destroy the lock. */
       err = svn_fs_unlock(fs, lock_path_utf8,
@@ -2498,7 +2499,8 @@ subcommand_rmlocks(apr_getopt_t *os, voi
 
       if (! opt_state->quiet)
         SVN_ERR(svn_cmdline_printf(subpool,
-                                   _("Removed lock on '%s'.\n"), lock->path));
+                                   _("Removed lock on '%s'.\n"),
+                                   lock_path_utf8));
 
     move_on:
       if (err)
@@ -2553,7 +2555,7 @@ subcommand_unlock(apr_getopt_t *os, void
 
   if (! opt_state->quiet)
     SVN_ERR(svn_cmdline_printf(pool, _("'%s' unlocked by user '%s'.\n"),
-                               lock_path, username));
+                               lock_path_utf8, username));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py?rev=1797122&r1=1797121&r2=1797122&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py Wed May 31 21:57:59 2017
@@ -1901,7 +1901,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(expected_output,
                                           None, "lock",
                                           sbox.repo_dir,
@@ -1915,7 +1915,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(expected_output,
                                           None, "lock",
                                           sbox.repo_dir,
@@ -1939,7 +1939,7 @@ def locking(sbox):
                                           comment_path)
 
   # Test locking a path while specifying a lock 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(expected_output,
                                           None, "lock",
@@ -1958,7 +1958,7 @@ def locking(sbox):
 
   # Test unlocking the path again, but this time provide the correct
   # lock token.
-  expected_output = "'A/D/G/rho' unlocked."
+  expected_output = "'/A/D/G/rho' unlocked."
   svntest.actions.run_and_verify_svnadmin(expected_output,
                                           None, "unlock",
                                           sbox.repo_dir,
@@ -2004,7 +2004,7 @@ def locking(sbox):
 
   # Finally, use --bypass-hooks to unlock the path (again using the
   # correct lock token).
-  expected_output = "'iota' unlocked."
+  expected_output = "'/iota' unlocked."
   svntest.actions.run_and_verify_svnadmin(expected_output,
                                           None, "unlock",
                                           "--bypass-hooks",



Mime
View raw message