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

Re: svn commit: r1357313 - in /subversion/trunk/subversion/svn: cl.h notify.c update-cmd.c

From: Stefan Sperling <stsp_at_apache.org>
Date: Wed, 5 Sep 2012 14:36:52 +0200

On Tue, Sep 04, 2012 at 03:01:22PM -0400, Paul Burba wrote:
> I just noticed that this causes a segfault when updating with the quiet option:
>
> [[[
>
> C:\SVN\src-trunk>svn up
> Updating '.':
> At revision 1380738.
>
> C:\SVN\src-trunk>svn up -q
> This application has halted due to an unexpected error.

Thanks for digging into this and explaining the problem, Paul.

I cannot think of a better way to fix this than recording in
opt_state whether the notifier is being used. That way we
have a way of telling whether it is safe to ask the notifier
for a list of conflicted paths.

What you do think?

Index: subversion/svn/cl.h
===================================================================
--- subversion/svn/cl.h (revision 1381156)
+++ subversion/svn/cl.h (working copy)
@@ -238,6 +238,8 @@ typedef struct svn_cl__opt_state_t
   svn_boolean_t include_externals; /* Recurses (in)to file & dir externals */
   const char *search_pattern; /* pattern argument for --search */
   svn_boolean_t case_insensitive_search; /* perform case-insensitive search */
+ svn_boolean_t use_notifier; /* notifier is being used (depends on --quiet,
+ --xml, and subcommand being run) */
 
   svn_wc_conflict_resolver_func2_t conflict_func;
   void *conflict_baton;
Index: subversion/svn/main.c
===================================================================
--- subversion/svn/main.c (revision 1381156)
+++ subversion/svn/main.c (working copy)
@@ -2578,6 +2578,7 @@ sub_main(int argc, const char *argv[], apr_pool_t
       SVN_INT_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
                                        pool));
     }
+ opt_state.use_notifier = use_notifier;
 
   /* Set up our cancellation support. */
   ctx->cancel_func = svn_cl__check_cancel;
Index: subversion/svn/merge-cmd.c
===================================================================
--- subversion/svn/merge-cmd.c (revision 1381156)
+++ subversion/svn/merge-cmd.c (working copy)
@@ -525,7 +525,7 @@ svn_cl__merge(apr_getopt_t *os,
     err = svn_cl__print_conflict_stats(ctx->notify_baton2, pool);
 
   if (!err
- && opt_state->conflict_func
+ && opt_state->conflict_func && opt_state->use_notifier
       && svn_cl__notifier_check_conflicts(ctx->notify_baton2))
     {
       err = svn_cl__resolve_conflicts(
Index: subversion/svn/switch-cmd.c
===================================================================
--- subversion/svn/switch-cmd.c (revision 1381156)
+++ subversion/svn/switch-cmd.c (working copy)
@@ -192,7 +192,7 @@ svn_cl__switch(apr_getopt_t *os,
         return svn_error_compose_create(externals_err, err);
     }
 
- if (opt_state->conflict_func
+ if (opt_state->conflict_func && opt_state->use_notifier
       && svn_cl__notifier_check_conflicts(nwb.wrapped_baton))
     {
       err = svn_cl__resolve_conflicts(
Index: subversion/svn/update-cmd.c
===================================================================
--- subversion/svn/update-cmd.c (revision 1381156)
+++ subversion/svn/update-cmd.c (working copy)
@@ -189,7 +189,7 @@ svn_cl__update(apr_getopt_t *os,
         return svn_error_compose_create(externals_err, err);
     }
 
- if (opt_state->conflict_func
+ if (opt_state->conflict_func && opt_state->use_notifier
       && svn_cl__notifier_check_conflicts(nwb.wrapped_baton))
     {
       ctx->conflict_func2 = conflict_func2;
Received on 2012-09-05 14:37:35 CEST

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.