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 2013/09/28 21:11:23 UTC

svn commit: r1527217 - /subversion/trunk/subversion/libsvn_fs_fs/transaction.c

Author: stefan2
Date: Sat Sep 28 19:11:23 2013
New Revision: 1527217

URL: http://svn.apache.org/r1527217
Log:
Skip move-related checks and updates in FSFS if moves are not supported.
This minimizes the overhead for existing repositories.

* subversion/libsvn_fs_fs/transaction.c
  (write_final_changed_path_info,
   commit_body): execute fs_move related code only if moves are supported
                 by the current FSFS format

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/transaction.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1527217&r1=1527216&r2=1527217&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Sat Sep 28 19:11:23 2013
@@ -2706,15 +2706,16 @@ write_final_changed_path_info(apr_off_t 
   SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, pool));
 
   /* all moves specify the "copy-from-rev" as REV-1 */
-  for (hi = apr_hash_first(pool, changed_paths); hi; hi = apr_hash_next(hi))
-    {
-      svn_fs_path_change2_t *change;
-      apr_hash_this(hi, NULL, NULL, (void **)&change);
+  if (svn_fs_fs__supports_move(fs))
+    for (hi = apr_hash_first(pool, changed_paths); hi; hi = apr_hash_next(hi))
+      {
+        svn_fs_path_change2_t *change;
+        apr_hash_this(hi, NULL, NULL, (void **)&change);
 
-      if (   (change->change_kind == svn_fs_path_change_move)
-          || (change->change_kind == svn_fs_path_change_movereplace))
-        change->copyfrom_rev = new_rev - 1;
-    }
+        if (   (change->change_kind == svn_fs_path_change_move)
+            || (change->change_kind == svn_fs_path_change_movereplace))
+          change->copyfrom_rev = new_rev - 1;
+      }
 
   SVN_ERR(svn_fs_fs__write_changes(svn_stream_from_aprfile2(file, TRUE, pool),
                                    fs, changed_paths, TRUE, pool));
@@ -3091,7 +3092,10 @@ commit_body(void *baton, apr_pool_t *poo
   SVN_ERR(svn_fs_fs__txn_changes_fetch(&changed_paths, cb->fs, txn_id,
                                        pool));
 
-  SVN_ERR(verify_moves(cb->fs, txn_id, old_rev, changed_paths, pool));
+  /* ensure that no change in this txn or any txn committed since the start
+   * of this txn violates our move semantics */
+  if (svn_fs_fs__supports_move(cb->fs))
+    SVN_ERR(verify_moves(cb->fs, txn_id, old_rev, changed_paths, pool));
 
   /* Get the next node_id and copy_id to use. */
   if (ffd->format < SVN_FS_FS__MIN_NO_GLOBAL_IDS_FORMAT)



Re: svn commit: r1527217 - /subversion/trunk/subversion/libsvn_fs_fs/transaction.c

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Sat, Sep 28, 2013 at 9:22 PM, Ivan Zhakov <iv...@visualsvn.com> wrote:

> On 28 September 2013 23:11,  <st...@apache.org> wrote:
> > Author: stefan2
> > Date: Sat Sep 28 19:11:23 2013
> > New Revision: 1527217
> >
> > URL: http://svn.apache.org/r1527217
> > Log:
> > Skip move-related checks and updates in FSFS if moves are not supported.
> > This minimizes the overhead for existing repositories.
> >
> > * subversion/libsvn_fs_fs/transaction.c
> >   (write_final_changed_path_info,
> >    commit_body): execute fs_move related code only if moves are supported
> >                  by the current FSFS format
> >
> > Modified:
> >     subversion/trunk/subversion/libsvn_fs_fs/transaction.c
> >
> > Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
> > URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1527217&r1=1527216&r2=1527217&view=diff
> >
> ==============================================================================
> > --- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
> > +++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Sat Sep 28
> 19:11:23 2013
> > @@ -2706,15 +2706,16 @@ write_final_changed_path_info(apr_off_t
> >    SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, pool));
> >
> >    /* all moves specify the "copy-from-rev" as REV-1 */
> > -  for (hi = apr_hash_first(pool, changed_paths); hi; hi =
> apr_hash_next(hi))
> > -    {
> > -      svn_fs_path_change2_t *change;
> > -      apr_hash_this(hi, NULL, NULL, (void **)&change);
> > +  if (svn_fs_fs__supports_move(fs))
> Minor nit: explicit statement block ({}) will make code more readable.
>
> > +    for (hi = apr_hash_first(pool, changed_paths); hi; hi =
> apr_hash_next(hi))
> > +      {
> > +        svn_fs_path_change2_t *change;
> > +        apr_hash_this(hi, NULL, NULL, (void **)&change);
> "change = svn__apr_hash_index_key(hi);" ?
>

Committed as r1532893.
Thanks for the review!

-- Stefan^2.

Re: svn commit: r1527217 - /subversion/trunk/subversion/libsvn_fs_fs/transaction.c

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On 28 September 2013 23:11,  <st...@apache.org> wrote:
> Author: stefan2
> Date: Sat Sep 28 19:11:23 2013
> New Revision: 1527217
>
> URL: http://svn.apache.org/r1527217
> Log:
> Skip move-related checks and updates in FSFS if moves are not supported.
> This minimizes the overhead for existing repositories.
>
> * subversion/libsvn_fs_fs/transaction.c
>   (write_final_changed_path_info,
>    commit_body): execute fs_move related code only if moves are supported
>                  by the current FSFS format
>
> Modified:
>     subversion/trunk/subversion/libsvn_fs_fs/transaction.c
>
> Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1527217&r1=1527216&r2=1527217&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Sat Sep 28 19:11:23 2013
> @@ -2706,15 +2706,16 @@ write_final_changed_path_info(apr_off_t
>    SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, pool));
>
>    /* all moves specify the "copy-from-rev" as REV-1 */
> -  for (hi = apr_hash_first(pool, changed_paths); hi; hi = apr_hash_next(hi))
> -    {
> -      svn_fs_path_change2_t *change;
> -      apr_hash_this(hi, NULL, NULL, (void **)&change);
> +  if (svn_fs_fs__supports_move(fs))
Minor nit: explicit statement block ({}) will make code more readable.

> +    for (hi = apr_hash_first(pool, changed_paths); hi; hi = apr_hash_next(hi))
> +      {
> +        svn_fs_path_change2_t *change;
> +        apr_hash_this(hi, NULL, NULL, (void **)&change);
"change = svn__apr_hash_index_key(hi);" ?


-- 
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com