You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2011/12/10 17:45:32 UTC

svn commit: r1212823 - /subversion/trunk/subversion/svn/main.c

Author: julianfoad
Date: Sat Dec 10 16:45:32 2011
New Revision: 1212823

URL: http://svn.apache.org/viewvc?rev=1212823&view=rev
Log:
When 'svn' prints a message about running 'cleanup' because the WC is
locked, use the standard mechanism for error messages so, for example, the
error code will be displayed.

Previously:

  svn: E155004: Working copy '/home/.../wc' locked.
  svn: E155004: '/home/.../wc' is already locked.
  svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for
  details)

Now:

  svn: E155004: Run 'svn cleanup' to remove locks (type 'svn help cleanup'
  for details)
  svn: E155004: Working copy '/home/.../wc' locked.
  svn: E155004: '/home/.../wc' is already locked.

This also makes it consistent with other messages added by 'svn', such as:

  svn: E155036: Please see the 'svn upgrade' command
  svn: E155036: Working copy '/home/.../wc' is too old (format 10, created
  by Subversion 1.6)

* subversion/svn/main.c
  (main): Print the message about running 'cleanup' in the standard way.

Modified:
    subversion/trunk/subversion/svn/main.c

Modified: subversion/trunk/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/main.c?rev=1212823&r1=1212822&r2=1212823&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/main.c (original)
+++ subversion/trunk/subversion/svn/main.c Sat Dec 10 16:45:32 2011
@@ -2691,6 +2691,15 @@ main(int argc, const char *argv[])
                                      _("Please see the 'svn upgrade' command"));
         }
 
+      /* Tell the user about 'svn cleanup' if any error on the stack
+         was about locked working copies. */
+      if (svn_error_find_cause(err, SVN_ERR_WC_LOCKED))
+        {
+          err = svn_error_quick_wrap(
+                  err, _("Run 'svn cleanup' to remove locks "
+                         "(type 'svn help cleanup' for details)"));
+        }
+
       /* Issue #3014:
        * Don't print anything on broken pipes. The pipe was likely
        * closed by the process at the other end. We expect that
@@ -2701,14 +2710,6 @@ main(int argc, const char *argv[])
       if (err->apr_err != SVN_ERR_IO_PIPE_WRITE_ERROR)
         svn_handle_error2(err, stderr, FALSE, "svn: ");
 
-      /* Tell the user about 'svn cleanup' if any error on the stack
-         was about locked working copies. */
-      if (svn_error_find_cause(err, SVN_ERR_WC_LOCKED))
-        svn_error_clear(svn_cmdline_fputs(_("svn: run 'svn cleanup' to "
-                                            "remove locks (type 'svn help "
-                                            "cleanup' for details)\n"),
-                                          stderr, pool));
-
       svn_error_clear(err);
       svn_pool_destroy(pool);
       return EXIT_FAILURE;