subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1663372 - in /subversion/branches/move-tracking-2/subversion: include/private/svn_debug.h include/private/svn_editor3e.h libsvn_delta/compat3e.c libsvn_delta/compat3p.c libsvn_ra/ra_loader.c libsvn_subr/debug.c svnmover/svnmover.c
Date Mon, 02 Mar 2015 17:35:49 GMT
Author: julianfoad
Date: Mon Mar  2 17:35:48 2015
New Revision: 1663372

URL: http://svn.apache.org/r1663372
Log:
On the 'move-tracking-2' branch: make a central switch for turning off debug
printing at runtime.

* subversion/include/private/svn_debug.h,
  subversion/libsvn_subr/debug.c
  (svn_dbg__preamble,
   debug_vprintf): Track the rename of svn_dbg__quiet_mode.
  (svn_dbg__set_quiet_mode): New function.
  (svn_dbg__quiet_mode): Make public, rename from quiet_mode, and heed the
    _quiet_mode flag as well as the environment variable.
  (_quiet_mode): New static variable.

* subversion/include/private/svn_editor3e.h,
  subversion/libsvn_delta/compat3e.c
  (svn__set_verbose,
   svn__is_verbose): Delete.

* subversion/libsvn_delta/compat3p.c
  (SVN_DBG): Remove local redefinition.

* subversion/svnmover/svnmover.c
  (sub_main): Adjust the initialization code accordingly.

Modified:
    subversion/branches/move-tracking-2/subversion/include/private/svn_debug.h
    subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h
    subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c
    subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c
    subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c
    subversion/branches/move-tracking-2/subversion/libsvn_subr/debug.c
    subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c

Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_debug.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_debug.h?rev=1663372&r1=1663371&r2=1663372&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_debug.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_debug.h Mon Mar  2
17:35:48 2015
@@ -63,6 +63,17 @@ svn_dbg__print_props(apr_hash_t *props,
 #define SVN_DBG_OUTPUT stdout
 
 
+/* If QUIET_MODE is true, switch debug output off; if false, let it be
+ * controlled by the presence of the environment variable SVN_DBG_QUIET.
+ */
+void svn_dbg__set_quiet_mode(svn_boolean_t quiet_mode);
+
+/* Return true iff debug output is turned off, either by a call to
+ * svn_dbg__set_quiet_mode(TRUE) or by the environment variable
+ * SVN_DBG_QUIET being present.
+ */
+svn_boolean_t svn_dbg__quiet_mode(void);
+
 /* Defining this symbol in the source file, BEFORE INCLUDING THIS HEADER,
    will switch off the output. Calls will still be made to svn_dbg__preamble()
    for breakpoints.  */

Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h?rev=1663372&r1=1663371&r2=1663372&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h Mon Mar
 2 17:35:48 2015
@@ -42,9 +42,6 @@ extern "C" {
 #endif /* __cplusplus */
 
 
-void svn__set_verbose(svn_boolean_t);
-svn_boolean_t svn__is_verbose(void);
-
 /*
  * ===================================================================
  * Versioning Model Assumed

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c?rev=1663372&r1=1663371&r2=1663372&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c Mon Mar  2 17:35:48
2015
@@ -40,23 +40,6 @@
 /* Verify EXPR is true; raise an error if not. */
 #define VERIFY(expr) SVN_ERR_ASSERT(expr)
 
-#undef SVN_DBG
-#define SVN_DBG(ARGS) (svn__is_verbose() \
-                       ? (svn_dbg__preamble(__FILE__, __LINE__, SVN_DBG_OUTPUT), \
-                          svn_dbg__printf ARGS) : (void)0)
-
-static svn_boolean_t _verbose = FALSE;
-
-void svn__set_verbose(svn_boolean_t verbose)
-{
-  _verbose = verbose;
-}
-
-svn_boolean_t svn__is_verbose(void)
-{
-  return _verbose;
-}
-
 
 #ifdef SVN_DEBUG
 /* Return a human-readable string representation of LOC. */

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c?rev=1663372&r1=1663371&r2=1663372&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c Mon Mar  2 17:35:48
2015
@@ -41,9 +41,6 @@
 /* Verify EXPR is true; raise an error if not. */
 #define VERIFY(expr) SVN_ERR_ASSERT(expr)
 
-#undef SVN_DBG
-#define SVN_DBG(ARGS)
-
 
 /*
  * ========================================================================

Modified: subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c?rev=1663372&r1=1663371&r2=1663372&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c Mon Mar  2 17:35:48
2015
@@ -999,7 +999,7 @@ svn_ra_get_commit_editor_ev3(svn_ra_sess
     fbb->session_path = base_relpath;
     fbb->repos_root_url = repos_root_url;
 
-    if (svn__is_verbose())
+    if (! svn_dbg__quiet_mode())
       SVN_ERR(svn_delta__get_debug_editor(&deditor, &dedit_baton,
                                           deditor, dedit_baton, "", pool));
     SVN_ERR(svn_delta__ev3_from_delta_for_commit2(

Modified: subversion/branches/move-tracking-2/subversion/libsvn_subr/debug.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_subr/debug.c?rev=1663372&r1=1663371&r2=1663372&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_subr/debug.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_subr/debug.c Mon Mar  2 17:35:48
2015
@@ -46,10 +46,17 @@ static long debug_line = 0;
 static FILE * volatile debug_output = NULL;
 
 
-static svn_boolean_t
-quiet_mode(void)
+static svn_boolean_t _quiet_mode = FALSE;
+
+void svn_dbg__set_quiet_mode(svn_boolean_t quiet_mode)
+{
+  _quiet_mode = quiet_mode;
+}
+
+svn_boolean_t
+svn_dbg__quiet_mode(void)
 {
-  return getenv("SVN_DBG_QUIET") != NULL;
+  return _quiet_mode || getenv("SVN_DBG_QUIET") != NULL;
 }
 
 
@@ -58,7 +65,7 @@ svn_dbg__preamble(const char *file, long
 {
   debug_output = output;
 
-  if (output != NULL && !quiet_mode())
+  if (output != NULL && !svn_dbg__quiet_mode())
     {
       /* Quick and dirty basename() code.  */
       const char *slash = strrchr(file, '/');
@@ -84,7 +91,7 @@ debug_vprintf(const char *fmt, va_list a
   char *s = buffer;
   int n;
 
-  if (output == NULL || quiet_mode())
+  if (output == NULL || svn_dbg__quiet_mode())
     return;
 
   n = apr_snprintf(prefix, sizeof(prefix), DBG_FLAG "%s:%4ld: ",

Modified: subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c?rev=1663372&r1=1663371&r2=1663372&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Mon Mar  2 17:35:48
2015
@@ -2045,6 +2045,9 @@ sub_main(int *exit_code, int argc, const
   /* Check library versions */
   SVN_ERR(check_lib_versions());
 
+  /* Suppress debug message unless '-v' given. */
+  svn_dbg__set_quiet_mode(TRUE);
+
   config_options = apr_array_make(pool, 0,
                                   sizeof(svn_cmdline__config_argument_t*));
 
@@ -2064,7 +2067,7 @@ sub_main(int *exit_code, int argc, const
       switch(opt)
         {
         case 'v':
-          svn__set_verbose(TRUE);
+          svn_dbg__set_quiet_mode(FALSE);
           break;
         case 'q':
           quiet = TRUE;



Mime
View raw message