subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1382762 - in /subversion/trunk/subversion/libsvn_subr: deprecated.c opt.c opt.h
Date Mon, 10 Sep 2012 11:34:32 GMT
Author: brane
Date: Mon Sep 10 11:34:31 2012
New Revision: 1382762

URL: http://svn.apache.org/viewvc?rev=1382762&view=rev
Log:
Make the expensive bits of version retreival optional.

* subversion/libsvn_subr/opt.h (svn_opt__get_version_info):
  Change prototype: add verbose flag.
* subversion/libsvn_subr/opt.h (svn_opt__get_version_info):
  Gather runtime system info only when verbose is set.
  (svn_opt_print_help4): Update.
* subversion/libsvn_subr/deprecated.c (svn_opt_print_help): Update.

Modified:
    subversion/trunk/subversion/libsvn_subr/deprecated.c
    subversion/trunk/subversion/libsvn_subr/opt.c
    subversion/trunk/subversion/libsvn_subr/opt.h

Modified: subversion/trunk/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/deprecated.c?rev=1382762&r1=1382761&r2=1382762&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_subr/deprecated.c Mon Sep 10 11:34:31 2012
@@ -606,7 +606,8 @@ svn_opt_print_help(apr_getopt_t *os,
   else if (print_version)   /* just --version */
     {
       SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer,
-                                          svn_opt__get_version_info(pool),
+                                          svn_opt__get_version_info(FALSE,
+                                                                    pool),
                                           quiet, FALSE, pool));
     }
   else if (os && !targets->nelts)            /* `-h', `--help', or `help' */

Modified: subversion/trunk/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/opt.c?rev=1382762&r1=1382761&r2=1382762&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/opt.c (original)
+++ subversion/trunk/subversion/libsvn_subr/opt.c Mon Sep 10 11:34:31 2012
@@ -1104,7 +1104,8 @@ svn_opt__arg_canonicalize_path(const cha
 
 
 const svn_opt__version_info_t *
-svn_opt__get_version_info(apr_pool_t *pool)
+svn_opt__get_version_info(svn_boolean_t verbose,
+                          apr_pool_t *pool)
 {
   svn_opt__version_info_t *info = apr_pcalloc(pool, sizeof(*info));
 
@@ -1120,10 +1121,14 @@ svn_opt__get_version_info(apr_pool_t *po
              "file for more information.\n"
              "Subversion is open source software, see "
              "http://subversion.apache.org/\n"));
-  info->runtime_host = svn_sysinfo__canonical_host(pool);
-  info->runtime_osname = svn_sysinfo__release_name(pool);
-  info->linked_libs = svn_sysinfo__linked_libs(pool);
-  info->loaded_libs = svn_sysinfo__loaded_libs(pool);
+
+  if (verbose)
+    {
+      info->runtime_host = svn_sysinfo__canonical_host(pool);
+      info->runtime_osname = svn_sysinfo__release_name(pool);
+      info->linked_libs = svn_sysinfo__linked_libs(pool);
+      info->loaded_libs = svn_sysinfo__loaded_libs(pool);
+    }
 
   return info;
 }
@@ -1245,7 +1250,8 @@ svn_opt_print_help4(apr_getopt_t *os,
   else if (print_version)   /* just --version */
     {
       SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer,
-                                          svn_opt__get_version_info(pool),
+                                          svn_opt__get_version_info(verbose,
+                                                                    pool),
                                           quiet, verbose, pool));
     }
   else if (os && !targets->nelts)            /* `-h', `--help', or `help' */

Modified: subversion/trunk/subversion/libsvn_subr/opt.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/opt.h?rev=1382762&r1=1382761&r2=1382762&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/opt.h (original)
+++ subversion/trunk/subversion/libsvn_subr/opt.h Mon Sep 10 11:34:31 2012
@@ -55,12 +55,15 @@ struct svn_opt__version_info_t
 };
 
 
-/* Return version information for the running program, allocated from POOL.
+/* Return version information for the running program, allocated from
+ * POOL.  If VERBOSE is true, collect extra information about the
+ * runtime system. This can be expensive.
  *
  * Use POOL for temporary allocations.
  */
 const svn_opt__version_info_t *
-svn_opt__get_version_info(apr_pool_t *pool);
+svn_opt__get_version_info(svn_boolean_t verbose,
+                          apr_pool_t *pool);
 
 /* Print version version info for PGM_NAME to the console.  If QUIET is
  * true, print in brief.  Else if QUIET is not true, print the version



Mime
View raw message