[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Re: svn commit: rev 4801 - in trunk/subversion: libsvn_fs libsvn_fs/bdb libsvn_wc libsvn_subr libsvn_ra_local svnlook libsvn_client bindings/ruby clients/cmdline tests/libsvn_wc libsvn_ra_svn libsvn_repos libsvn_ra_dav svnserve

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-02-11 02:40:43 CET

Karl Fogel wrote:
> dwhedon@tigris.org writes:
>
>>Calls to svn_error_createf() changed to make error messages clear
>>with respect to paths and urls. In most cases I simply add
>>quotation marks around paths and urls. In a few cases the messages
>>were changed so that quotation marks would not conflict with
>>apostrophes indicating possession.
>
>
> Nice!

Yes. Thanks. I had made a start but got distracted. Attached is a
patch (against r4825) for the few remaining ones that I could see, done
in the style that best matches each source file, or single quotes when
not obvious. Log message (substantially plagiarised):

Quotation marks added around paths, urls, external commands, etc. in
error messages (svn_error_createf and apr_psprintf) to make the messages
less ambiguous. In one case the message was changed slightly to avoid
an apostrophe indicating possession.

* subversion/libsvn_client/update.c
   subversion/libsvn_fs/dag.c
   subversion/libsvn_ra/ra_loader.c
   subversion/libsvn_ra_dav/commit.c
   subversion/libsvn_ra_dav/util.c
   subversion/libsvn_repos/hooks.c
   subversion/libsvn_subr/io.c
   subversion/libsvn_wc/entries.c
   subversion/libsvn_wc/log.c
   subversion/libsvn_wc/props.c
   subversion/libsvn_wc/update_editor.c
   subversion/svnserve/serve.c
   subversion/tests/libsvn_fs/fs-test.c : Fix error messages.

> So, it looks like we've standardized on forward single quotes for
> paths in error messages.

Not really. Yes, all the new ones that David put in. But overall,
- about 300 occurrences use '...'
- about 200 occurrences use `...'
- about 100 occurrences use "..."
- about 50 occurrences use (...) or [...]
- about 100 occurrences use just a colon before or after

That's %s strings in general, more than half of which are "paths" of
some kind. In many cases they are consistent within a file, but in
several cases they are not. But there's more variations than just the
type of quote marks... One step at a time.

- Julian

Index: subversion/libsvn_ra/ra_loader.c
===================================================================
--- subversion/libsvn_ra/ra_loader.c (revision 4825)
+++ subversion/libsvn_ra/ra_loader.c (working copy)
@@ -122,7 +122,7 @@
     if (status)
       {
         return svn_error_createf (status, NULL,
- "%s does not define %s()",
+ "\"%s\" does not define \"%s()\"",
                                   libname, funcname);
       }
 
@@ -206,7 +206,7 @@
   /* Couldn't find a match... */
   *library = NULL;
   return svn_error_createf (SVN_ERR_RA_ILLEGAL_URL, NULL,
- "Unrecognized URL scheme: %s", URL);
+ "Unrecognized URL scheme: \"%s\"", URL);
 }
 
 
Index: subversion/libsvn_fs/dag.c
===================================================================
--- subversion/libsvn_fs/dag.c (revision 4825)
+++ subversion/libsvn_fs/dag.c (working copy)
@@ -1448,7 +1448,7 @@
   if (! node_id)
     return svn_error_createf
       (SVN_ERR_FS_NOT_FOUND, NULL,
- "Attempted to open non-existant child node \"%s\"", name);
+ "Attempted to open non-existant child node `%s'", name);
   
   /* Make sure that NAME is a single path component. */
   if (! svn_path_is_single_path_component (name))
Index: subversion/libsvn_wc/props.c
===================================================================
--- subversion/libsvn_wc/props.c (revision 4825)
+++ subversion/libsvn_wc/props.c (working copy)
@@ -1034,7 +1034,7 @@
   while (*node_kind_prohibit)
     if (strcmp (name, *node_kind_prohibit++) == 0)
       return svn_error_createf (SVN_ERR_ILLEGAL_TARGET, NULL,
- "Cannot set %s on a %s (%s)",
+ "Cannot set '%s' on a %s (%s)",
                                 name, node_kind_text, path);
 
   return SVN_NO_ERROR;
Index: subversion/libsvn_wc/entries.c
===================================================================
--- subversion/libsvn_wc/entries.c (revision 4825)
+++ subversion/libsvn_wc/entries.c (working copy)
@@ -1702,6 +1702,6 @@
     }
   else
     return svn_error_createf (SVN_ERR_WC_PATH_FOUND, NULL,
- "svn_wc_mark_missing_deleted: path %s isn't "
+ "svn_wc_mark_missing_deleted: path '%s' isn't "
                               "missing.", path);
 }
Index: subversion/libsvn_wc/log.c
===================================================================
--- subversion/libsvn_wc/log.c (revision 4825)
+++ subversion/libsvn_wc/log.c (working copy)
@@ -1130,7 +1130,7 @@
       signal_error
         (loggy, svn_error_createf
          (SVN_ERR_WC_BAD_ADM_LOG, NULL,
- "log entry missing name attribute (entry %s for dir %s)",
+ "log entry missing name attribute (entry '%s' for dir '%s')",
           eltname, svn_wc_adm_access_path (loggy->adm_access)));
       return;
     }
@@ -1180,7 +1180,7 @@
       signal_error
         (loggy, svn_error_createf (SVN_ERR_WC_BAD_ADM_LOG,
                                    NULL,
- "unrecognized logfile element in %s: `%s'",
+ "unrecognized logfile element in `%s': `%s'",
                                    svn_wc_adm_access_path (loggy->adm_access),
                                    eltname));
       return;
Index: subversion/libsvn_wc/update_editor.c
===================================================================
--- subversion/libsvn_wc/update_editor.c (revision 4825)
+++ subversion/libsvn_wc/update_editor.c (working copy)
@@ -966,7 +966,7 @@
         {
           apr_file_close (log_fp);
           return svn_error_createf (apr_err, NULL,
- "close_dir: error writing %s's log file",
+ "close_dir: error writing log file for '%s'.",
                                     db->path);
         }
       
Index: subversion/libsvn_subr/io.c
===================================================================
--- subversion/libsvn_subr/io.c (revision 4825)
+++ subversion/libsvn_subr/io.c (working copy)
@@ -1188,7 +1188,7 @@
    */
   if (*pexitcode != 0 && *pexitcode != 1)
     return svn_error_createf (SVN_ERR_EXTERNAL_PROGRAM, NULL,
- "%s returned %d", diff_utf8, *pexitcode);
+ "'%s' returned %d", diff_utf8, *pexitcode);
 
   svn_pool_destroy (subpool);
 
@@ -1276,8 +1276,8 @@
   if ((*exitcode != 0) && (*exitcode != 1))
     return svn_error_createf (SVN_ERR_EXTERNAL_PROGRAM, NULL,
                               "svn_io_run_diff3: "
- "Error running %s: exitcode was %d, args were:"
- "\nin directory %s, basenames:\n%s\n%s\n%s",
+ "Error running '%s': exitcode was %d, args were:"
+ "\nin directory '%s', basenames:\n%s\n%s\n%s",
                               diff3_utf8, *exitcode,
                               dir, mine, older, yours);
 
Index: subversion/libsvn_client/update.c
===================================================================
--- subversion/libsvn_client/update.c (revision 4825)
+++ subversion/libsvn_client/update.c (working copy)
@@ -66,7 +66,7 @@
   if (! entry)
     return svn_error_createf
       (SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
- "svn_client_update: %s is not under revision control", anchor);
+ "svn_client_update: '%s' is not under revision control", anchor);
   if (! entry->url)
     return svn_error_createf
       (SVN_ERR_ENTRY_MISSING_URL, NULL,
Index: subversion/tests/libsvn_fs/fs-test.c
===================================================================
--- subversion/tests/libsvn_fs/fs-test.c (revision 4825)
+++ subversion/tests/libsvn_fs/fs-test.c (working copy)
@@ -5700,7 +5700,7 @@
         s = svn_fs_unparse_id (id, spool);
         if (strcmp (s->data, node->unparsed_id) != 0)
           return svn_error_createf (SVN_ERR_TEST_FAILED, NULL,
- "%s id: expected %s got: %s",
+ "`%s' id: expected `%s'; got `%s'",
                                     node->path, node->unparsed_id, s->data);
         ++node;
       }
Index: subversion/libsvn_repos/hooks.c
===================================================================
--- subversion/libsvn_repos/hooks.c (revision 4825)
+++ subversion/libsvn_repos/hooks.c (working copy)
@@ -60,7 +60,7 @@
   apr_err = apr_file_pipe_create(&read_errhandle, &write_errhandle, pool);
   if (apr_err)
     return svn_error_createf
- (apr_err, NULL, "can't create pipe for %s hook", cmd);
+ (apr_err, NULL, "can't create pipe for '%s' hook", cmd);
 
   err = svn_io_run_cmd (".", cmd, args, &exitcode, &exitwhy, FALSE,
                         NULL, NULL, write_errhandle, pool);
@@ -77,7 +77,7 @@
   if (err)
     {
       err = svn_error_createf
- (SVN_ERR_REPOS_HOOK_FAILURE, err, "failed to run %s hook", cmd);
+ (SVN_ERR_REPOS_HOOK_FAILURE, err, "failed to run '%s' hook", cmd);
     }
 
   if (!err && check_exitcode)
@@ -92,7 +92,7 @@
 
           err = svn_error_createf
               (SVN_ERR_REPOS_HOOK_FAILURE, err,
- "%s hook failed with error output:\n%s",
+ "'%s' hook failed with error output:\n%s",
                name, error->data);
         }
     }
Index: subversion/libsvn_ra_dav/commit.c
===================================================================
--- subversion/libsvn_ra_dav/commit.c (revision 4825)
+++ subversion/libsvn_ra_dav/commit.c (working copy)
@@ -146,7 +146,7 @@
   if (req == NULL)
     {
       return svn_error_createf(SVN_ERR_RA_DAV_CREATING_REQUEST, NULL,
- "Could not create a request (%s %s)",
+ "Could not create a request (%s '%s')",
                                method, url);
     }
 
Index: subversion/libsvn_ra_dav/util.c
===================================================================
--- subversion/libsvn_ra_dav/util.c (revision 4825)
+++ subversion/libsvn_ra_dav/util.c (working copy)
@@ -373,7 +373,7 @@
   if (code != 200
       || rv != NE_OK)
     {
- msg = apr_psprintf(pool, "%s of %s", method, url);
+ msg = apr_psprintf(pool, "%s of '%s'", method, url);
       err = svn_ra_dav__convert_error(ras->sess, msg, rv);
       goto error;
     }
@@ -398,7 +398,7 @@
   ne_xml_destroy(success_parser);
   ne_xml_destroy(error_parser);
   return svn_error_createf(err->apr_err, err,
- "%s request failed on %s", method, url );
+ "%s request failed on '%s'", method, url );
 }
 
 
Index: subversion/svnserve/serve.c
===================================================================
--- subversion/svnserve/serve.c (revision 4825)
+++ subversion/svnserve/serve.c (working copy)
@@ -846,7 +846,7 @@
   /* Verify the scheme part. */
   if (strncmp(url, "svn://", 6) != 0)
     return svn_error_createf(SVN_ERR_BAD_URL, NULL,
- "Non-svn URL passed to svn server: %s", url);
+ "Non-svn URL passed to svn server: '%s'", url);
 
   /* Skip past the authority part. */
   client_path = strchr(url + 6, '/');

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Feb 11 02:38:27 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.