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 2014/09/07 00:01:09 UTC

svn commit: r1622946 - /subversion/trunk/subversion/libsvn_fs_fs/rev_file.c

Author: stefan2
Date: Sat Sep  6 22:01:09 2014
New Revision: 1622946

URL: http://svn.apache.org/r1622946
Log:
Plug a hole in the svn_fs_fs__revision_file_t open logic.

* subversion/libsvn_fs_fs/rev_file.c
  (open_pack_or_rev_file): If we retry due to a potential background
                           pack, we should update the rev / pack file
                           base revision as well.

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

Modified: subversion/trunk/subversion/libsvn_fs_fs/rev_file.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/rev_file.c?rev=1622946&r1=1622945&r2=1622946&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/rev_file.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/rev_file.c Sat Sep  6 22:01:09 2014
@@ -176,6 +176,9 @@ open_pack_or_rev_file(svn_fs_fs__revisio
 
               /* We failed for the first time. Refresh cache & retry. */
               SVN_ERR(svn_fs_fs__update_min_unpacked_rev(fs, scratch_pool));
+              file->start_revision = rev < ffd->min_unpacked_rev
+                                    ? rev - (rev % ffd->max_files_per_dir)
+                                    : rev;
 
               retry = TRUE;
             }



Re: svn commit: r1622946 - /subversion/trunk/subversion/libsvn_fs_fs/rev_file.c

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Sun, Sep 7, 2014 at 10:30 AM, Branko Čibej <br...@wandisco.com> wrote:

> On 07.09.2014 00:01, stefan2@apache.org wrote:
> > --- subversion/trunk/subversion/libsvn_fs_fs/rev_file.c (original)
> > +++ subversion/trunk/subversion/libsvn_fs_fs/rev_file.c Sat Sep  6
> 22:01:09 2014
> > @@ -176,6 +176,9 @@ open_pack_or_rev_file(svn_fs_fs__revisio
> >
> >                /* We failed for the first time. Refresh cache & retry. */
> >                SVN_ERR(svn_fs_fs__update_min_unpacked_rev(fs,
> scratch_pool));
> > +              file->start_revision = rev < ffd->min_unpacked_rev
> > +                                    ? rev - (rev %
> ffd->max_files_per_dir)
> > +                                    : rev;
>
> Even though the precedence rules make this assignment behave as
> intended, I would really, really prefer to have parentheses around the
> ternary expression.
>

Done in combination with some code de-duplication in r1623368.

-- Stefan^2.

Re: svn commit: r1622946 - /subversion/trunk/subversion/libsvn_fs_fs/rev_file.c

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Sun, Sep 7, 2014 at 10:30 AM, Branko Čibej <br...@wandisco.com> wrote:

> On 07.09.2014 00:01, stefan2@apache.org wrote:
> > --- subversion/trunk/subversion/libsvn_fs_fs/rev_file.c (original)
> > +++ subversion/trunk/subversion/libsvn_fs_fs/rev_file.c Sat Sep  6
> 22:01:09 2014
> > @@ -176,6 +176,9 @@ open_pack_or_rev_file(svn_fs_fs__revisio
> >
> >                /* We failed for the first time. Refresh cache & retry. */
> >                SVN_ERR(svn_fs_fs__update_min_unpacked_rev(fs,
> scratch_pool));
> > +              file->start_revision = rev < ffd->min_unpacked_rev
> > +                                    ? rev - (rev %
> ffd->max_files_per_dir)
> > +                                    : rev;
>
> Even though the precedence rules make this assignment behave as
> intended, I would really, really prefer to have parentheses around the
> ternary expression.
>

Done in combination with some code de-duplication in r1623368.

-- Stefan^2.

Re: svn commit: r1622946 - /subversion/trunk/subversion/libsvn_fs_fs/rev_file.c

Posted by Branko Čibej <br...@wandisco.com>.
On 07.09.2014 00:01, stefan2@apache.org wrote:
> --- subversion/trunk/subversion/libsvn_fs_fs/rev_file.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_fs/rev_file.c Sat Sep  6 22:01:09 2014
> @@ -176,6 +176,9 @@ open_pack_or_rev_file(svn_fs_fs__revisio
>  
>                /* We failed for the first time. Refresh cache & retry. */
>                SVN_ERR(svn_fs_fs__update_min_unpacked_rev(fs, scratch_pool));
> +              file->start_revision = rev < ffd->min_unpacked_rev
> +                                    ? rev - (rev % ffd->max_files_per_dir)
> +                                    : rev;

Even though the precedence rules make this assignment behave as
intended, I would really, really prefer to have parentheses around the
ternary expression.

-- Brane


Re: svn commit: r1622946 - /subversion/trunk/subversion/libsvn_fs_fs/rev_file.c

Posted by Branko Čibej <br...@wandisco.com>.
On 07.09.2014 00:01, stefan2@apache.org wrote:
> --- subversion/trunk/subversion/libsvn_fs_fs/rev_file.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_fs/rev_file.c Sat Sep  6 22:01:09 2014
> @@ -176,6 +176,9 @@ open_pack_or_rev_file(svn_fs_fs__revisio
>  
>                /* We failed for the first time. Refresh cache & retry. */
>                SVN_ERR(svn_fs_fs__update_min_unpacked_rev(fs, scratch_pool));
> +              file->start_revision = rev < ffd->min_unpacked_rev
> +                                    ? rev - (rev % ffd->max_files_per_dir)
> +                                    : rev;

Even though the precedence rules make this assignment behave as
intended, I would really, really prefer to have parentheses around the
ternary expression.

-- Brane