You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/04/10 01:54:31 UTC

svn commit: r1090715 - /subversion/trunk/subversion/libsvn_client/commit_util.c

Author: rhuijben
Date: Sat Apr  9 23:54:31 2011
New Revision: 1090715

URL: http://svn.apache.org/viewvc?rev=1090715&view=rev
Log:
Two small optimizations in the commit handler: Assume absolute paths are
already absolute and only send fulltexts for local additions, instead of
for additions and copies.

* subversion/libsvn_client/commit_util.c
  (svn_client__do_commit): Don't make path absolute. Use one for for calling
    callbacks. Extend fulltext check.

Modified:
    subversion/trunk/subversion/libsvn_client/commit_util.c

Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=1090715&r1=1090714&r2=1090715&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Sat Apr  9 23:54:31 2011
@@ -1576,13 +1576,10 @@ svn_client__do_commit(const char *base_u
       const svn_checksum_t *new_text_base_md5_checksum;
       const svn_checksum_t *new_text_base_sha1_checksum;
       svn_boolean_t fulltext = FALSE;
-      const char *item_abspath;
 
       svn_pool_clear(iterpool);
 
       /* Transmit the entry. */
-      SVN_ERR(svn_dirent_get_absolute(&item_abspath, item->path, iterpool));
-
       if (ctx->cancel_func)
         SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
 
@@ -1594,15 +1591,17 @@ svn_client__do_commit(const char *base_u
                                         iterpool);
           notify->kind = svn_node_file;
           notify->path_prefix = notify_path_prefix;
-          (*ctx->notify_func2)(ctx->notify_baton2, notify, iterpool);
+          ctx->notify_func2(ctx->notify_baton2, notify, iterpool);
         }
 
-      if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD)
+      /* If the node has no history, transmit full text */
+      if ((item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD)
+          && ! (item->state_flags & SVN_CLIENT_COMMIT_ITEM_IS_COPY))
         fulltext = TRUE;
 
       SVN_ERR(svn_wc_transmit_text_deltas3(&new_text_base_md5_checksum,
                                            &new_text_base_sha1_checksum,
-                                           ctx->wc_ctx, item_abspath,
+                                           ctx->wc_ctx, item->path,
                                            fulltext, editor, mod->file_baton,
                                            pool, iterpool));
       if (md5_checksums)



RE: svn commit: r1090715 - /subversion/trunk/subversion/libsvn_client/commit_util.c

Posted by Greg Stein <gs...@gmail.com>.
On Apr 10, 2011 3:26 PM, "Bert Huijben" <be...@qqmail.nl> wrote:
>
>
>
> > -----Original Message-----
> > From: Greg Stein [mailto:gstein@gmail.com]
> > Sent: zondag 10 april 2011 7:26
> > To: dev@subversion.apache.org
> > Subject: Re: svn commit: r1090715 -
> > /subversion/trunk/subversion/libsvn_client/commit_util.c
> >
> > On Apr 9, 2011 7:54 PM, <rh...@apache.org> wrote:
> > >
> > > Author: rhuijben
> > > Date: Sat Apr  9 23:54:31 2011
> > > New Revision: 1090715
> > >
> > > URL: http://svn.apache.org/viewvc?rev=1090715&view=rev
> > > Log:
> > > Two small optimizations in the commit handler: Assume absolute paths
are
> > > already absolute and only send fulltexts for local additions, instead
of
> > > for additions and copies.
> >
> > It is unclear that item->path is absolute. Ideally, renaming the field
> would
> > be best. At a minimum, add a comment here.
>
> This field in commit_item3_t and its older cousins *2_t and *_t are
> documented to be absolute paths since the early days (r841696, or r1622),
> when the log message editor api was introduced.

Ah. Thanks. IOW, it just hasn't caught up to our recent naming scheme. ...
Fair enuf!

Cheers,
-g

RE: svn commit: r1090715 - /subversion/trunk/subversion/libsvn_client/commit_util.c

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Greg Stein [mailto:gstein@gmail.com]
> Sent: zondag 10 april 2011 7:26
> To: dev@subversion.apache.org
> Subject: Re: svn commit: r1090715 -
> /subversion/trunk/subversion/libsvn_client/commit_util.c
> 
> On Apr 9, 2011 7:54 PM, <rh...@apache.org> wrote:
> >
> > Author: rhuijben
> > Date: Sat Apr  9 23:54:31 2011
> > New Revision: 1090715
> >
> > URL: http://svn.apache.org/viewvc?rev=1090715&view=rev
> > Log:
> > Two small optimizations in the commit handler: Assume absolute paths are
> > already absolute and only send fulltexts for local additions, instead of
> > for additions and copies.
> 
> It is unclear that item->path is absolute. Ideally, renaming the field
would
> be best. At a minimum, add a comment here.

This field in commit_item3_t and its older cousins *2_t and *_t are
documented to be absolute paths since the early days (r841696, or r1622),
when the log message editor api was introduced.

	Bert


Re: svn commit: r1090715 - /subversion/trunk/subversion/libsvn_client/commit_util.c

Posted by Greg Stein <gs...@gmail.com>.
On Apr 9, 2011 7:54 PM, <rh...@apache.org> wrote:
>
> Author: rhuijben
> Date: Sat Apr  9 23:54:31 2011
> New Revision: 1090715
>
> URL: http://svn.apache.org/viewvc?rev=1090715&view=rev
> Log:
> Two small optimizations in the commit handler: Assume absolute paths are
> already absolute and only send fulltexts for local additions, instead of
> for additions and copies.

It is unclear that item->path is absolute. Ideally, renaming the field would
be best. At a minimm, add a comment here.

>...

Cheers,
-g