You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/10/11 19:11:28 UTC

svn commit: r1708003 - in /subversion/trunk/subversion/libsvn_repos: commit.c fs-wrap.c load-fs-vtable.c rev_hunt.c

Author: stefan2
Date: Sun Oct 11 17:11:27 2015
New Revision: 1708003

URL: http://svn.apache.org/viewvc?rev=1708003&view=rev
Log:
Switch the remaining FS API calls in lib_repos to the latest FS API.

* subversion/libsvn_repos/commit.c
  (invoke_commit_cb): There is no point enabling revprop caching here
                      because it could only speed up a 3rd access while
                      we have only two.

* subversion/libsvn_repos/fs-wrap.c
  (svn_repos_fs_change_rev_prop4,
   svn_repos_fs_revision_prop,
   svn_repos_fs_revision_proplist): These queries perform only a single
                                    revprop read and that needs to return
                                    the latest data.

* subversion/libsvn_repos/rev_hunt.c
  (svn_repos_get_committed_info): Same.

* subversion/libsvn_repos/load-fs-vtable.c
  (close_revision): Same.
  (revprops_close_revision): This one needs to read the latest data.

Modified:
    subversion/trunk/subversion/libsvn_repos/commit.c
    subversion/trunk/subversion/libsvn_repos/fs-wrap.c
    subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c
    subversion/trunk/subversion/libsvn_repos/rev_hunt.c

Modified: subversion/trunk/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/commit.c?rev=1708003&r1=1708002&r2=1708003&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/commit.c (original)
+++ subversion/trunk/subversion/libsvn_repos/commit.c Sun Oct 11 17:11:27 2015
@@ -214,11 +214,11 @@ invoke_commit_cb(svn_commit_callback2_t
   if (commit_cb == NULL)
     return SVN_NO_ERROR;
 
-  SVN_ERR(svn_fs_revision_prop(&date, fs, revision, SVN_PROP_REVISION_DATE,
-                               scratch_pool));
-  SVN_ERR(svn_fs_revision_prop(&author, fs, revision,
-                               SVN_PROP_REVISION_AUTHOR,
-                               scratch_pool));
+  SVN_ERR(svn_fs_revision_prop2(&date, fs, revision, SVN_PROP_REVISION_DATE,
+                                TRUE, scratch_pool, scratch_pool));
+  SVN_ERR(svn_fs_revision_prop2(&author, fs, revision,
+                                SVN_PROP_REVISION_AUTHOR,
+                                TRUE, scratch_pool, scratch_pool));
 
   commit_info = svn_create_commit_info(scratch_pool);
 

Modified: subversion/trunk/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/fs-wrap.c?rev=1708003&r1=1708002&r2=1708003&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/trunk/subversion/libsvn_repos/fs-wrap.c Sun Oct 11 17:11:27 2015
@@ -378,7 +378,8 @@ svn_repos_fs_change_rev_prop4(svn_repos_
            * to the hooks to be accurate. */
           svn_string_t *old_value2;
 
-          SVN_ERR(svn_fs_revision_prop(&old_value2, repos->fs, rev, name, pool));
+          SVN_ERR(svn_fs_revision_prop2(&old_value2, repos->fs, rev, name,
+                                        FALSE, pool, pool));
           old_value = old_value2;
         }
 
@@ -448,12 +449,13 @@ svn_repos_fs_revision_prop(svn_string_t
         *value_p = NULL;
 
       else
-        SVN_ERR(svn_fs_revision_prop(value_p, repos->fs,
-                                     rev, propname, pool));
+        SVN_ERR(svn_fs_revision_prop2(value_p, repos->fs,
+                                      rev, propname, FALSE, pool, pool));
     }
   else /* wholly readable revision */
     {
-      SVN_ERR(svn_fs_revision_prop(value_p, repos->fs, rev, propname, pool));
+      SVN_ERR(svn_fs_revision_prop2(value_p, repos->fs, rev, propname, FALSE,
+                                    pool, pool));
     }
 
   return SVN_NO_ERROR;
@@ -486,7 +488,8 @@ svn_repos_fs_revision_proplist(apr_hash_
       svn_string_t *value;
 
       /* Produce two property hashtables, both in POOL. */
-      SVN_ERR(svn_fs_revision_proplist(&tmphash, repos->fs, rev, pool));
+      SVN_ERR(svn_fs_revision_proplist2(&tmphash, repos->fs, rev, FALSE,
+                                        pool, pool));
       *table_p = apr_hash_make(pool);
 
       /* If they exist, we only copy svn:author and svn:date into the
@@ -501,7 +504,8 @@ svn_repos_fs_revision_proplist(apr_hash_
     }
   else /* wholly readable revision */
     {
-      SVN_ERR(svn_fs_revision_proplist(table_p, repos->fs, rev, pool));
+      SVN_ERR(svn_fs_revision_proplist2(table_p, repos->fs, rev, FALSE,
+                                        pool, pool));
     }
 
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c?rev=1708003&r1=1708002&r2=1708003&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c Sun Oct 11 17:11:27 2015
@@ -1014,7 +1014,8 @@ close_revision(void *baton)
           apr_array_header_t *diff;
           int i;
 
-          SVN_ERR(svn_fs_revision_proplist(&orig_props, pb->fs, 0, rb->pool));
+          SVN_ERR(svn_fs_revision_proplist2(&orig_props, pb->fs, 0, FALSE,
+                                            rb->pool, rb->pool));
           new_props = svn_prop_array_to_hash(rb->revprops, rb->pool);
           SVN_ERR(svn_prop_diffs(&diff, new_props, orig_props, rb->pool));
 
@@ -1334,7 +1335,8 @@ revprops_close_revision(void *baton)
       prop->value = NULL;
     }
 
-  SVN_ERR(svn_fs_revision_proplist(&orig_props, pb->fs, rb->rev, rb->pool));
+  SVN_ERR(svn_fs_revision_proplist2(&orig_props, pb->fs, rb->rev, FALSE,
+                                    rb->pool, rb->pool));
   new_props = svn_prop_array_to_hash(rb->revprops, rb->pool);
   SVN_ERR(svn_prop_diffs(&diff, new_props, orig_props, rb->pool));
 

Modified: subversion/trunk/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/rev_hunt.c?rev=1708003&r1=1708002&r2=1708003&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/trunk/subversion/libsvn_repos/rev_hunt.c Sun Oct 11 17:11:27 2015
@@ -171,7 +171,8 @@ svn_repos_get_committed_info(svn_revnum_
   SVN_ERR(svn_fs_node_created_rev(committed_rev, root, path, pool));
 
   /* Get the revision properties of this revision. */
-  SVN_ERR(svn_fs_revision_proplist(&revprops, fs, *committed_rev, pool));
+  SVN_ERR(svn_fs_revision_proplist2(&revprops, fs, *committed_rev, FALSE,
+                                    pool, pool));
 
   /* Extract date and author from these revprops. */
   committed_date_s = svn_hash_gets(revprops, SVN_PROP_REVISION_DATE);



Re: svn commit: r1708003 - in /subversion/trunk/subversion/libsvn_repos: commit.c fs-wrap.c load-fs-vtable.c rev_hunt.c

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Mon, Oct 12, 2015 at 12:05 AM, Bert Huijben <be...@qqmail.nl> wrote:

>
>
> > -----Original Message-----
> > From: stefan2@apache.org [mailto:stefan2@apache.org]
> > Sent: zondag 11 oktober 2015 19:11
> > To: commits@subversion.apache.org
> > Subject: svn commit: r1708003 - in
> > /subversion/trunk/subversion/libsvn_repos: commit.c fs-wrap.c load-fs-
> > vtable.c rev_hunt.c
> >
> > Author: stefan2
> > Date: Sun Oct 11 17:11:27 2015
> > New Revision: 1708003
> >
> > URL: http://svn.apache.org/viewvc?rev=1708003&view=rev
> > Log:
> > Switch the remaining FS API calls in lib_repos to the latest FS API.
> >
> > * subversion/libsvn_repos/commit.c
> >   (invoke_commit_cb): There is no point enabling revprop caching here
> >                       because it could only speed up a 3rd access while
> >                       we have only two.
> >
> > * subversion/libsvn_repos/fs-wrap.c
> >   (svn_repos_fs_change_rev_prop4,
> >    svn_repos_fs_revision_prop,
> >    svn_repos_fs_revision_proplist): These queries perform only a single
> >                                     revprop read and that needs to return
> >                                     the latest data.
> >
> > * subversion/libsvn_repos/rev_hunt.c
> >   (svn_repos_get_committed_info): Same.
> >
> > * subversion/libsvn_repos/load-fs-vtable.c
> >   (close_revision): Same.
> >   (revprops_close_revision): This one needs to read the latest data.
> >
> > Modified:
> >     subversion/trunk/subversion/libsvn_repos/commit.c
> >     subversion/trunk/subversion/libsvn_repos/fs-wrap.c
> >     subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c
> >     subversion/trunk/subversion/libsvn_repos/rev_hunt.c
>
> <snip>
> > Modified: subversion/trunk/subversion/libsvn_repos/fs-wrap.c
> > URL:
> > http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/fs
> > -wrap.c?rev=1708003&r1=1708002&r2=1708003&view=diff
> > ==========================================================
> > ====================
> > --- subversion/trunk/subversion/libsvn_repos/fs-wrap.c (original)
> > +++ subversion/trunk/subversion/libsvn_repos/fs-wrap.c Sun Oct 11
> > 17:11:27 2015
> > @@ -378,7 +378,8 @@ svn_repos_fs_change_rev_prop4(svn_repos_
> >             * to the hooks to be accurate. */
> >            svn_string_t *old_value2;
> >
> > -          SVN_ERR(svn_fs_revision_prop(&old_value2, repos->fs, rev,
> name,
> > pool));
> > +          SVN_ERR(svn_fs_revision_prop2(&old_value2, repos->fs, rev,
> name,
> > +                                        FALSE, pool, pool));
> >            old_value = old_value2;
> >          }
> >
> > @@ -448,12 +449,13 @@ svn_repos_fs_revision_prop(svn_string_t
> >          *value_p = NULL;
> >
> >        else
> > -        SVN_ERR(svn_fs_revision_prop(value_p, repos->fs,
> > -                                     rev, propname, pool));
> > +        SVN_ERR(svn_fs_revision_prop2(value_p, repos->fs,
> > +                                      rev, propname, FALSE, pool,
> pool));
> >      }
> >    else /* wholly readable revision */
> >      {
> > -      SVN_ERR(svn_fs_revision_prop(value_p, repos->fs, rev, propname,
> > pool));
> > +      SVN_ERR(svn_fs_revision_prop2(value_p, repos->fs, rev, propname,
> > FALSE,
> > +                                    pool, pool));
> >      }
> >
> >    return SVN_NO_ERROR;
> > @@ -486,7 +488,8 @@ svn_repos_fs_revision_proplist(apr_hash_
> >        svn_string_t *value;
> >
> >        /* Produce two property hashtables, both in POOL. */
> > -      SVN_ERR(svn_fs_revision_proplist(&tmphash, repos->fs, rev, pool));
> > +      SVN_ERR(svn_fs_revision_proplist2(&tmphash, repos->fs, rev, FALSE,
> > +                                        pool, pool));
> >        *table_p = apr_hash_make(pool);
> >
> >        /* If they exist, we only copy svn:author and svn:date into the
> > @@ -501,7 +504,8 @@ svn_repos_fs_revision_proplist(apr_hash_
> >      }
> >    else /* wholly readable revision */
> >      {
> > -      SVN_ERR(svn_fs_revision_proplist(table_p, repos->fs, rev, pool));
> > +      SVN_ERR(svn_fs_revision_proplist2(table_p, repos->fs, rev, FALSE,
> > +                                        pool, pool));
>
> From your log message:
> [[
> >   (svn_repos_fs_change_rev_prop4,
> >    svn_repos_fs_revision_prop,
> >    svn_repos_fs_revision_proplist): These queries perform only a single
> >                                     revprop read and that needs to return
> >                                     the latest data.
> ]]
>
> Shouldn't these 3 functions pass TRUE then?
>
> I would say that passing FALSE uses the cached and not the latest data?
>

You are absolutely right. This happened because
the original patch set had the inverse semantics
for this parameter.


>
> <snip>
>
> > Modified: subversion/trunk/subversion/libsvn_repos/rev_hunt.c
> > URL:
> > http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/r
> > ev_hunt.c?rev=1708003&r1=1708002&r2=1708003&view=diff
> > ==========================================================
> > ====================
> > --- subversion/trunk/subversion/libsvn_repos/rev_hunt.c (original)
> > +++ subversion/trunk/subversion/libsvn_repos/rev_hunt.c Sun Oct 11
> > 17:11:27 2015
> > @@ -171,7 +171,8 @@ svn_repos_get_committed_info(svn_revnum_
> >    SVN_ERR(svn_fs_node_created_rev(committed_rev, root, path, pool));
> >
> >    /* Get the revision properties of this revision. */
> > -  SVN_ERR(svn_fs_revision_proplist(&revprops, fs, *committed_rev,
> pool));
> > +  SVN_ERR(svn_fs_revision_proplist2(&revprops, fs, *committed_rev,
> > FALSE,
> > +                                    pool, pool));
>
> Same here... also documented in your log message to use latest, while it
> now uses cached.
>

I just went through yesterday's patch set, checked the
parameter values and found a few more instances.
Bad commit day, apparently.

Thanks for reviewing!

-- Stefan^2.

RE: svn commit: r1708003 - in /subversion/trunk/subversion/libsvn_repos: commit.c fs-wrap.c load-fs-vtable.c rev_hunt.c

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

> -----Original Message-----
> From: stefan2@apache.org [mailto:stefan2@apache.org]
> Sent: zondag 11 oktober 2015 19:11
> To: commits@subversion.apache.org
> Subject: svn commit: r1708003 - in
> /subversion/trunk/subversion/libsvn_repos: commit.c fs-wrap.c load-fs-
> vtable.c rev_hunt.c
> 
> Author: stefan2
> Date: Sun Oct 11 17:11:27 2015
> New Revision: 1708003
> 
> URL: http://svn.apache.org/viewvc?rev=1708003&view=rev
> Log:
> Switch the remaining FS API calls in lib_repos to the latest FS API.
> 
> * subversion/libsvn_repos/commit.c
>   (invoke_commit_cb): There is no point enabling revprop caching here
>                       because it could only speed up a 3rd access while
>                       we have only two.
> 
> * subversion/libsvn_repos/fs-wrap.c
>   (svn_repos_fs_change_rev_prop4,
>    svn_repos_fs_revision_prop,
>    svn_repos_fs_revision_proplist): These queries perform only a single
>                                     revprop read and that needs to return
>                                     the latest data.
> 
> * subversion/libsvn_repos/rev_hunt.c
>   (svn_repos_get_committed_info): Same.
> 
> * subversion/libsvn_repos/load-fs-vtable.c
>   (close_revision): Same.
>   (revprops_close_revision): This one needs to read the latest data.
> 
> Modified:
>     subversion/trunk/subversion/libsvn_repos/commit.c
>     subversion/trunk/subversion/libsvn_repos/fs-wrap.c
>     subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c
>     subversion/trunk/subversion/libsvn_repos/rev_hunt.c

<snip>
> Modified: subversion/trunk/subversion/libsvn_repos/fs-wrap.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/fs
> -wrap.c?rev=1708003&r1=1708002&r2=1708003&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/libsvn_repos/fs-wrap.c (original)
> +++ subversion/trunk/subversion/libsvn_repos/fs-wrap.c Sun Oct 11
> 17:11:27 2015
> @@ -378,7 +378,8 @@ svn_repos_fs_change_rev_prop4(svn_repos_
>             * to the hooks to be accurate. */
>            svn_string_t *old_value2;
> 
> -          SVN_ERR(svn_fs_revision_prop(&old_value2, repos->fs, rev, name,
> pool));
> +          SVN_ERR(svn_fs_revision_prop2(&old_value2, repos->fs, rev, name,
> +                                        FALSE, pool, pool));
>            old_value = old_value2;
>          }
> 
> @@ -448,12 +449,13 @@ svn_repos_fs_revision_prop(svn_string_t
>          *value_p = NULL;
> 
>        else
> -        SVN_ERR(svn_fs_revision_prop(value_p, repos->fs,
> -                                     rev, propname, pool));
> +        SVN_ERR(svn_fs_revision_prop2(value_p, repos->fs,
> +                                      rev, propname, FALSE, pool, pool));
>      }
>    else /* wholly readable revision */
>      {
> -      SVN_ERR(svn_fs_revision_prop(value_p, repos->fs, rev, propname,
> pool));
> +      SVN_ERR(svn_fs_revision_prop2(value_p, repos->fs, rev, propname,
> FALSE,
> +                                    pool, pool));
>      }
> 
>    return SVN_NO_ERROR;
> @@ -486,7 +488,8 @@ svn_repos_fs_revision_proplist(apr_hash_
>        svn_string_t *value;
> 
>        /* Produce two property hashtables, both in POOL. */
> -      SVN_ERR(svn_fs_revision_proplist(&tmphash, repos->fs, rev, pool));
> +      SVN_ERR(svn_fs_revision_proplist2(&tmphash, repos->fs, rev, FALSE,
> +                                        pool, pool));
>        *table_p = apr_hash_make(pool);
> 
>        /* If they exist, we only copy svn:author and svn:date into the
> @@ -501,7 +504,8 @@ svn_repos_fs_revision_proplist(apr_hash_
>      }
>    else /* wholly readable revision */
>      {
> -      SVN_ERR(svn_fs_revision_proplist(table_p, repos->fs, rev, pool));
> +      SVN_ERR(svn_fs_revision_proplist2(table_p, repos->fs, rev, FALSE,
> +                                        pool, pool));

>From your log message:
[[
>   (svn_repos_fs_change_rev_prop4,
>    svn_repos_fs_revision_prop,
>    svn_repos_fs_revision_proplist): These queries perform only a single
>                                     revprop read and that needs to return
>                                     the latest data.
]]

Shouldn't these 3 functions pass TRUE then?

I would say that passing FALSE uses the cached and not the latest data?

<snip>

> Modified: subversion/trunk/subversion/libsvn_repos/rev_hunt.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/r
> ev_hunt.c?rev=1708003&r1=1708002&r2=1708003&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/libsvn_repos/rev_hunt.c (original)
> +++ subversion/trunk/subversion/libsvn_repos/rev_hunt.c Sun Oct 11
> 17:11:27 2015
> @@ -171,7 +171,8 @@ svn_repos_get_committed_info(svn_revnum_
>    SVN_ERR(svn_fs_node_created_rev(committed_rev, root, path, pool));
> 
>    /* Get the revision properties of this revision. */
> -  SVN_ERR(svn_fs_revision_proplist(&revprops, fs, *committed_rev, pool));
> +  SVN_ERR(svn_fs_revision_proplist2(&revprops, fs, *committed_rev,
> FALSE,
> +                                    pool, pool));

Same here... also documented in your log message to use latest, while it now uses cached.

	Bert