Author: julianfoad
Date: Wed Nov 22 13:01:58 2017
New Revision: 1816054

URL: http://svn.apache.org/viewvc?rev=1816054&view=rev
Log:
Fix printing issues in shelving.

* subversion/svn/shelve-cmd.c
  (shelves_list): Don't attempt to execute system("diffstat") on Windows,
    as on most systems it would print an error message to the console.
  (...): Use svn_cmdline_printf() instead of plain printf().

* subversion/libsvn_client/shelve.c
  (svn_client_shelf_write_patch,
   svn_client_shelf_delete_patch): Don't print feedback as this is in a library.

Modified:
    subversion/trunk/subversion/libsvn_client/shelve.c
    subversion/trunk/subversion/svn/shelve-cmd.c

Modified: subversion/trunk/subversion/libsvn_client/shelve.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/shelve.c?rev=1816054&r1=1816053&r2=1816054&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/shelve.c (original)
+++ subversion/trunk/subversion/libsvn_client/shelve.c Wed Nov 22 13:01:58 2017
@@ -95,8 +95,6 @@ svn_client_shelf_write_patch(const char
   svn_opt_revision_t start_revision = {svn_opt_revision_base, {0}};
   svn_opt_revision_t end_revision = {svn_opt_revision_working, {0}};
 
-  printf("writing '%s.patch'\n", name);
-
   SVN_ERR(get_patch_abspath(&patch_abspath, name, wc_root_abspath,
                             ctx, scratch_pool, scratch_pool));
 
@@ -198,7 +196,6 @@ svn_client_shelf_delete_patch(const char
                               scratch_pool));
 
   /* move the patch to a backup file */
-  printf("moving '%s.patch' to '%s.patch.bak'\n", name, name);
   SVN_ERR(svn_io_file_rename2(patch_abspath, to_abspath, FALSE 
/*flush_to_disk*/,
                               scratch_pool));
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/svn/shelve-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/shelve-cmd.c?rev=1816054&r1=1816053&r2=1816054&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/shelve-cmd.c (original)
+++ subversion/trunk/subversion/svn/shelve-cmd.c Wed Nov 22 13:01:58 2017
@@ -104,16 +104,23 @@ shelves_list(const char *local_abspath,
       svn_client_shelved_patch_info_t *info = item->value;
       int age = (apr_time_now() - info->mtime) / 1000000 / 60;
 
-      printf("%-30s %6d mins old %10ld bytes\n",
-             name, age, (long)info->dirent->filesize);
-      printf(" %.50s\n",
-             info->message);
+      SVN_ERR(svn_cmdline_printf(scratch_pool,
+                                 _("%-30s %6d mins old %10ld bytes\n"),
+                                 name, age, (long)info->dirent->filesize));
+      SVN_ERR(svn_cmdline_printf(scratch_pool,
+                                 _(" %.50s\n"),
+                                 info->message));
 
       if (diffstat)
         {
-          system(apr_psprintf(scratch_pool, "diffstat %s 2> /dev/null",
-                              info->patch_path));
-          printf("\n");
+#ifndef WIN32
+          int result = system(apr_psprintf(scratch_pool,
+                                           "diffstat %s 2> /dev/null",
+                                           info->patch_path));
+          if (result == 0)
+            SVN_ERR(svn_cmdline_printf(scratch_pool,
+                                       "\n"));
+#endif
         }
     }
 
@@ -261,7 +268,9 @@ svn_cl__unshelve(apr_getopt_t *os,
   else
     {
       SVN_ERR(name_of_youngest(&name, local_abspath, ctx, pool, pool));
-      printf("unshelving the youngest change, '%s'\n", name);
+      SVN_ERR(svn_cmdline_printf(pool,
+                                 _("unshelving the youngest change, '%s'\n"),
+                                 name));
     }
 
   /* There should be no remaining arguments. */


Reply via email to