subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1483856 - /subversion/trunk/subversion/svnadmin/svnadmin.c
Date Fri, 17 May 2013 15:18:20 GMT
Author: danielsh
Date: Fri May 17 15:18:19 2013
New Revision: 1483856

URL: http://svn.apache.org/r1483856
Log:
Tweak 'svnadmin info' output: print each capability in its own line.

Before:
    % svnadmin info r | grep Capabilit
    Repository Capabilities: mergeinfo,foo
After:
    % svnadmin info r | grep Capabilit
    Repository Capability: mergeinfo
    Repository Capability: foo

* subversion/svnadmin/svnadmin.c
  (subcommand_info): As above.

Modified:
    subversion/trunk/subversion/svnadmin/svnadmin.c

Modified: subversion/trunk/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnadmin/svnadmin.c?rev=1483856&r1=1483855&r2=1483856&view=diff
==============================================================================
--- subversion/trunk/subversion/svnadmin/svnadmin.c (original)
+++ subversion/trunk/subversion/svnadmin/svnadmin.c Fri May 17 15:18:19 2013
@@ -39,6 +39,7 @@
 #include "svn_cache_config.h"
 #include "svn_version.h"
 #include "svn_props.h"
+#include "svn_sorts.h"
 #include "svn_time.h"
 #include "svn_user.h"
 #include "svn_xml.h"
@@ -1673,19 +1674,16 @@ subcommand_info(apr_getopt_t *os, void *
   {
     apr_hash_t *capabilities_set;
     apr_array_header_t *capabilities;
-    char *as_string;
+    int i;
 
     SVN_ERR(svn_repos_capabilities(&capabilities_set, repos, pool, pool));
-    SVN_ERR(svn_hash_keys(&capabilities, capabilities_set, pool));
-    as_string = svn_cstring_join(capabilities, ",", pool);
-
-    /* Delete the trailing comma. */
-    if (as_string[0])
-      as_string[strlen(as_string)-1] = '\0';
-
-    if (capabilities->nelts)
-      SVN_ERR(svn_cmdline_printf(pool, _("Repository Capabilities: %s\n"),
-                                 as_string));
+    capabilities = svn_sort__hash(capabilities_set,
+                                  svn_sort_compare_items_lexically,
+                                  pool);
+
+    for (i = 0; i < capabilities->nelts; i++)
+      SVN_ERR(svn_cmdline_printf(pool, _("Repository Capability: %s\n"),
+                                 APR_ARRAY_IDX(capabilities, i, const char *)));
   }
 
   {



Mime
View raw message