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 2012/07/07 09:33:41 UTC

svn commit: r1358516 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Author: stefan2
Date: Sat Jul  7 07:33:41 2012
New Revision: 1358516

URL: http://svn.apache.org/viewvc?rev=1358516&view=rev
Log:
Modify the read_config signature such that it can be used without
opening the underlying filesystem, i.e. without a proper svn_fs_t.

* subversion/libsvn_fs_fs/fs_fs.c
  (read_config): change and document signature
  (svn_fs_fs__open, svn_fs_fs__create): adapt callers

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

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1358516&r1=1358515&r2=1358516&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Sat Jul  7 07:33:41 2012
@@ -1089,15 +1089,17 @@ svn_fs_fs__fs_supports_mergeinfo(svn_fs_
   return ffd->format >= SVN_FS_FS__MIN_MERGEINFO_FORMAT;
 }
 
+/* Read the configuration information of the file system at FS_PATH
+ * and set the respective values in FFD.  Use POOL for allocations.
+ */
 static svn_error_t *
-read_config(svn_fs_t *fs,
+read_config(fs_fs_data_t *ffd,
+            const char *fs_path,
             apr_pool_t *pool)
 {
-  fs_fs_data_t *ffd = fs->fsap_data;
-
   SVN_ERR(svn_config_read2(&ffd->config,
-                           svn_dirent_join(fs->path, PATH_CONFIG, pool),
-                           FALSE, FALSE, fs->pool));
+                           svn_dirent_join(fs_path, PATH_CONFIG, pool),
+                           FALSE, FALSE, pool));
 
   /* Initialize ffd->rep_sharing_allowed. */
   if (ffd->format >= SVN_FS_FS__MIN_REP_SHARING_FORMAT)
@@ -1107,7 +1109,7 @@ read_config(svn_fs_t *fs,
   else
     ffd->rep_sharing_allowed = FALSE;
 
-  /* Initialize ffd->deltify_directories. */
+  /* Initialize deltification settings in ffd. */
   if (ffd->format >= SVN_FS_FS__MIN_DELTIFICATION_FORMAT)
     {
       SVN_ERR(svn_config_get_bool(ffd->config, &ffd->deltify_directories,
@@ -1316,7 +1318,7 @@ svn_fs_fs__open(svn_fs_t *fs, const char
     SVN_ERR(update_min_unpacked_rev(fs, pool));
 
   /* Read the configuration file. */
-  SVN_ERR(read_config(fs, pool));
+  SVN_ERR(read_config(ffd, fs->path, pool));
 
   return get_youngest(&(ffd->youngest_rev_cache), path, pool);
 }
@@ -7342,7 +7344,7 @@ svn_fs_fs__create(svn_fs_t *fs,
 
   SVN_ERR(write_config(fs, pool));
 
-  SVN_ERR(read_config(fs, pool));
+  SVN_ERR(read_config(ffd, fs->path, pool));
 
   /* Create the min unpacked rev file. */
   if (ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)



Re: svn commit: r1358516 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On 23 April 2014 14:20, Stefan Fuhrmann <st...@wandisco.com> wrote:
> On Tue, Apr 22, 2014 at 1:58 PM, Ivan Zhakov <iv...@visualsvn.com> wrote:
>>
>> On 7 July 2012 11:33,  <st...@apache.org> wrote:
>> > Author: stefan2
>> > Date: Sat Jul  7 07:33:41 2012
>> > New Revision: 1358516
>> >
>> > URL: http://svn.apache.org/viewvc?rev=1358516&view=rev
>> > Log:
>> > Modify the read_config signature such that it can be used without
>> > opening the underlying filesystem, i.e. without a proper svn_fs_t.
>> >
>> > * subversion/libsvn_fs_fs/fs_fs.c
>> >   (read_config): change and document signature
>> >   (svn_fs_fs__open, svn_fs_fs__create): adapt callers
>> >
>> > Modified:
>> >     subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
>> >
>> > Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
>> > URL:
>> > http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1358516&r1=1358515&r2=1358516&view=diff
>> >
>> > ==============================================================================
>> > --- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
>> > +++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Sat Jul  7 07:33:41
>> > 2012
>> > @@ -1089,15 +1089,17 @@ svn_fs_fs__fs_supports_mergeinfo(svn_fs_
>> >    return ffd->format >= SVN_FS_FS__MIN_MERGEINFO_FORMAT;
>> >  }
>> >
>> > +/* Read the configuration information of the file system at FS_PATH
>> > + * and set the respective values in FFD.  Use POOL for allocations.
>> > + */
>> >  static svn_error_t *
>> > -read_config(svn_fs_t *fs,
>> > +read_config(fs_fs_data_t *ffd,
>> > +            const char *fs_path,
>> >              apr_pool_t *pool)
>> >  {
>> > -  fs_fs_data_t *ffd = fs->fsap_data;
>> > -
>> >    SVN_ERR(svn_config_read2(&ffd->config,
>> > -                           svn_dirent_join(fs->path, PATH_CONFIG,
>> > pool),
>> > -                           FALSE, FALSE, fs->pool));
>> > +                           svn_dirent_join(fs_path, PATH_CONFIG, pool),
>> > +                           FALSE, FALSE, pool));
>> >
>> Hi Stefan,
>>
>> It seems this commit changed pool from which FS->CONFIG is allocated:
>> before commit CONFIG was allocated from FS->POOL, but now it uses
>> scratch_pool argument. I've fixed it in r1589097.
>
>
> Thank you for the fix!
>
No problem.

> In r1589235, I got rid of the FS->FFD->CONFIG struct altogether
> and read_config() actually does *all* the config evaluation.
>
Great! I considered it, but decided do it later but you surpassed me :)

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

Re: svn commit: r1358516 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Tue, Apr 22, 2014 at 1:58 PM, Ivan Zhakov <iv...@visualsvn.com> wrote:

> On 7 July 2012 11:33,  <st...@apache.org> wrote:
> > Author: stefan2
> > Date: Sat Jul  7 07:33:41 2012
> > New Revision: 1358516
> >
> > URL: http://svn.apache.org/viewvc?rev=1358516&view=rev
> > Log:
> > Modify the read_config signature such that it can be used without
> > opening the underlying filesystem, i.e. without a proper svn_fs_t.
> >
> > * subversion/libsvn_fs_fs/fs_fs.c
> >   (read_config): change and document signature
> >   (svn_fs_fs__open, svn_fs_fs__create): adapt callers
> >
> > Modified:
> >     subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
> >
> > Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
> > URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1358516&r1=1358515&r2=1358516&view=diff
> >
> ==============================================================================
> > --- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
> > +++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Sat Jul  7 07:33:41
> 2012
> > @@ -1089,15 +1089,17 @@ svn_fs_fs__fs_supports_mergeinfo(svn_fs_
> >    return ffd->format >= SVN_FS_FS__MIN_MERGEINFO_FORMAT;
> >  }
> >
> > +/* Read the configuration information of the file system at FS_PATH
> > + * and set the respective values in FFD.  Use POOL for allocations.
> > + */
> >  static svn_error_t *
> > -read_config(svn_fs_t *fs,
> > +read_config(fs_fs_data_t *ffd,
> > +            const char *fs_path,
> >              apr_pool_t *pool)
> >  {
> > -  fs_fs_data_t *ffd = fs->fsap_data;
> > -
> >    SVN_ERR(svn_config_read2(&ffd->config,
> > -                           svn_dirent_join(fs->path, PATH_CONFIG, pool),
> > -                           FALSE, FALSE, fs->pool));
> > +                           svn_dirent_join(fs_path, PATH_CONFIG, pool),
> > +                           FALSE, FALSE, pool));
> >
> Hi Stefan,
>
> It seems this commit changed pool from which FS->CONFIG is allocated:
> before commit CONFIG was allocated from FS->POOL, but now it uses
> scratch_pool argument. I've fixed it in r1589097.
>

Thank you for the fix!

In r1589235, I got rid of the FS->FFD->CONFIG struct altogether
and read_config() actually does *all* the config evaluation.

-- Stefan^2.

Re: svn commit: r1358516 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On 7 July 2012 11:33,  <st...@apache.org> wrote:
> Author: stefan2
> Date: Sat Jul  7 07:33:41 2012
> New Revision: 1358516
>
> URL: http://svn.apache.org/viewvc?rev=1358516&view=rev
> Log:
> Modify the read_config signature such that it can be used without
> opening the underlying filesystem, i.e. without a proper svn_fs_t.
>
> * subversion/libsvn_fs_fs/fs_fs.c
>   (read_config): change and document signature
>   (svn_fs_fs__open, svn_fs_fs__create): adapt callers
>
> Modified:
>     subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
>
> Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1358516&r1=1358515&r2=1358516&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Sat Jul  7 07:33:41 2012
> @@ -1089,15 +1089,17 @@ svn_fs_fs__fs_supports_mergeinfo(svn_fs_
>    return ffd->format >= SVN_FS_FS__MIN_MERGEINFO_FORMAT;
>  }
>
> +/* Read the configuration information of the file system at FS_PATH
> + * and set the respective values in FFD.  Use POOL for allocations.
> + */
>  static svn_error_t *
> -read_config(svn_fs_t *fs,
> +read_config(fs_fs_data_t *ffd,
> +            const char *fs_path,
>              apr_pool_t *pool)
>  {
> -  fs_fs_data_t *ffd = fs->fsap_data;
> -
>    SVN_ERR(svn_config_read2(&ffd->config,
> -                           svn_dirent_join(fs->path, PATH_CONFIG, pool),
> -                           FALSE, FALSE, fs->pool));
> +                           svn_dirent_join(fs_path, PATH_CONFIG, pool),
> +                           FALSE, FALSE, pool));
>
Hi Stefan,

It seems this commit changed pool from which FS->CONFIG is allocated:
before commit CONFIG was allocated from FS->POOL, but now it uses
scratch_pool argument. I've fixed it in r1589097.

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