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

Re: svn commit: r1351822 - /subversion/trunk/subversion/libsvn_client/switch.c

From: Greg Stein <gstein_at_gmail.com>
Date: Wed, 20 Jun 2012 01:54:29 -0400

On Jun 19, 2012 9:52 PM, <stsp_at_apache.org> wrote:
>...
> + if (resolve_conflicts_post_switch)
> + {
> + /* Remove the conflict resolution callback from the client context.
> + * We invoke it after of the switch instead of during the switch.
*/
> + conflict_func2 = ctx->conflict_func2;
> + conflict_baton2 = ctx->conflict_baton2;
> + ctx->conflict_func2 = NULL;
> + ctx->conflict_baton2 = NULL;
> + }

This feels like a terrible hack, of the worst kind.

The caller gives you a client context, and you change it on them. It's
theirs. Not yours to redefine.

Even worse, you never restore it! The context is now damaged because you
monkeyed with it. The context is NOT a single-use structure. It can live
for hours, over multiple operations, by design. But the above hack destroys
it.

I think you need to find a new approach.

Cheers,
-g
Received on 2012-06-20 07:55:06 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.