You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Hyrum K. Wright" <hy...@mail.utexas.edu> on 2010/03/28 01:46:48 UTC

Re: svn commit: r928299 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

On Mar 27, 2010, at 6:04 PM, gstein@apache.org wrote:

> Author: gstein
> Date: Sat Mar 27 23:04:28 2010
> New Revision: 928299
> 
> URL: http://svn.apache.org/viewvc?rev=928299&view=rev
> Log:
> Simplify the multitude of notification calls.
> 
> * subversion/libsvn_wc/update_editor.c:
>  (do_notification): new helper function to do a notification call
>  (complete_directory, open_root, do_entry_deletion, add_directory,
>      open_directory, add_file, open_file): use new helper
> 
> Modified:
>    subversion/trunk/subversion/libsvn_wc/update_editor.c
> 
> Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=928299&r1=928298&r2=928299&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Sat Mar 27 23:04:28 2010
> @@ -694,6 +694,25 @@ already_in_a_tree_conflict(svn_boolean_t
>                            apr_pool_t *scratch_pool);
> 
> 
> +static void
> +do_notification(const struct edit_baton *eb,

Why pass the entire edit baton here?  You're only using the notify_func and notify_baton.

> +                const char *local_abspath,
> +                svn_node_kind_t kind,
> +                svn_wc_notify_action_t action,
> +                apr_pool_t *scratch_pool)
> +{
> +  svn_wc_notify_t *notify;
> +
> +  if (eb->notify_func == NULL)
> +    return;
> +
> +  notify = svn_wc_create_notify(local_abspath, action, scratch_pool);
> +  notify->kind = kind;
> +
> +  (*eb->notify_func)(eb->notify_baton, notify, scratch_pool);
> +}
> +
> +
> /* Helper for maybe_bump_dir_info():
> 
>    In a single atomic action, (1) remove any 'deleted' entries from a
...

-Hyrum

Re: svn commit: r928299 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
Well, I know that you've expressed consternation at all the passing of the client context within libsvn_client.  I'm just wondering if that same sentiment extends to libsvn_wc as well. :)

-Hyrum


On Mar 28, 2010, at 8:30 AM, Greg Stein wrote:

> Simplify the call sites (the entire point!). eb is way shorter than the two
> de-refs. I did think about it tho, and settled with constifying eb.
> 
> I wouldn't be strongly opposed to changing it, but it would be significantly
> longer.
> 
> On Mar 27, 2010 9:46 PM, "Hyrum K. Wright" <hy...@mail.utexas.edu>
> wrote:
> 
> 
> On Mar 27, 2010, at 6:04 PM, gstein@apache.org wrote:
> 
>> Author: gstein
>> Date: Sat Mar 27 23:04:28...
> Why pass the entire edit baton here?  You're only using the notify_func and
> notify_baton.
> 
> 
>> + const char *local_abspath,
>> + svn_node_kind_t kind,
>> + ...
> ...
> 
> -Hyrum

Re: svn commit: r928299 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

Posted by Greg Stein <gs...@gmail.com>.
Simplify the call sites (the entire point!). eb is way shorter than the two
de-refs. I did think about it tho, and settled with constifying eb.

I wouldn't be strongly opposed to changing it, but it would be significantly
longer.

On Mar 27, 2010 9:46 PM, "Hyrum K. Wright" <hy...@mail.utexas.edu>
wrote:


On Mar 27, 2010, at 6:04 PM, gstein@apache.org wrote:

> Author: gstein
> Date: Sat Mar 27 23:04:28...
Why pass the entire edit baton here?  You're only using the notify_func and
notify_baton.


> + const char *local_abspath,
> + svn_node_kind_t kind,
> + ...
...

-Hyrum