You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Arkadiusz Miskiewicz <ar...@pld-linux.org> on 2004/07/24 13:28:36 UTC

BDB vs FSFS API weirdness

Hi,

I noticed that mailer.py uses svn.fs.open_berkeley() that will not work with 
FSFS (if BDB+FSFS is compiled).

svn.fs.open(self.fs_ptr, db_path, 'fsfs', pool) won't work here because types 
for open vs open_berkeley are different: _p_svn_fs_t, expected _p_p_svn_fs_t

W hile looking into it I noticed:
svn_error_t *
svn_fs_open_berkeley (svn_fs_t *fs, const char *path)
{
  fs_library_vtable_t *vtable;
  SVN_ERR (get_library_vtable (&vtable, DEFAULT_FS_TYPE, fs->pool));
  return vtable->open (fs, path, fs->pool);
}

Since now  DEFAULT_FS_TYPE is compile time option this will work differently 
depending on these options.

The name of funcion suggest that it opens berkeley DB only but it will open 
FSFS if compiled without BDB, too.

IMO it should open BDB always and don't depend on compile options.
-- 
Arkadiusz Miśkiewicz     CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org, 1024/3DB19BBD, JID: arekm.jabber.org, PLD/Linux

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: [PATCH] Re: BDB vs FSFS API weirdness

Posted by "C. Michael Pilato" <cm...@collab.net>.
Michael W Thelen <th...@cs.utah.edu> writes:

> * kfogel@collab.net <kf...@collab.net> [2004-07-26 09:52]:
> > I'm just reposting this with "[PATCH]" in the Subject line, so our
> > patch manager sees it.  (I'm not able to apply the patch right now,
> > sorry.)
> 
> Thanks!  I've filed this patch as issue #1984:
> http://subversion.tigris.org/issues/show_bug.cgi?id=1984

And since I fixed this yesterday without realizing there was an
outstanding patch for it, I've closed said issue. :-)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Re: BDB vs FSFS API weirdness

Posted by Michael W Thelen <th...@cs.utah.edu>.
* kfogel@collab.net <kf...@collab.net> [2004-07-26 09:52]:
> I'm just reposting this with "[PATCH]" in the Subject line, so our
> patch manager sees it.  (I'm not able to apply the patch right now,
> sorry.)

Thanks!  I've filed this patch as issue #1984:
http://subversion.tigris.org/issues/show_bug.cgi?id=1984

-- Mike

-- 
Michael W. Thelen
Thanks to the Interstate Highway System, it is now possible to travel from
coast to coast without seeing anything.
                -- Charles Kuralt

[PATCH] Re: BDB vs FSFS API weirdness

Posted by kf...@collab.net.
I'm just reposting this with "[PATCH]" in the Subject line, so our
patch manager sees it.  (I'm not able to apply the patch right now,
sorry.)

-Karl

Arkadiusz Miskiewicz <ar...@pld-linux.org> writes:
> On Saturday 24 of July 2004 15:28, Arkadiusz Miskiewicz wrote:
> > Hi,
> >
> > I noticed that mailer.py uses svn.fs.open_berkeley() that will not work
> > with FSFS (if BDB+FSFS is compiled).
> >
> > svn.fs.open(self.fs_ptr, db_path, 'fsfs', pool) won't work here because
> > types for open vs open_berkeley are different: _p_svn_fs_t, expected
> > _p_p_svn_fs_t
> 
> This works fine. Tested.
> 
> Index: mailer.py
> ===================================================================
> --- mailer.py   (revision 4394)
> +++ mailer.py   (kopia robocza)
> @@ -465,13 +465,12 @@
>      self.rev = rev
>      self.pool = pool
> 
> -    db_path = os.path.join(repos_dir, 'db')
> -    if not os.path.exists(db_path):
> +    db_path = svn.repos.svn_repos_find_root_path(repos_dir, pool)
> +    if not db_path:
>        db_path = repos_dir
> 
> -    self.fs_ptr = svn.fs.new(None, pool)
> -    svn.fs.open_berkeley(self.fs_ptr, db_path)
> -
> +    self.fs_ptr = svn.repos.svn_repos_fs(svn.repos.svn_repos_open(db_path, pool))
> +
>      self.roots = { }
> 
>      self.root_this = self.get_root(rev)
> 
> -- 
> Arkadiusz Miśkiewicz     CS at FoE, Wroclaw University of Technology
> arekm.pld-linux.org, 1024/3DB19BBD, JID: arekm.jabber.org, PLD/Linux
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: BDB vs FSFS API weirdness

Posted by Arkadiusz Miskiewicz <ar...@pld-linux.org>.
On Saturday 24 of July 2004 15:28, Arkadiusz Miskiewicz wrote:
> Hi,
>
> I noticed that mailer.py uses svn.fs.open_berkeley() that will not work
> with FSFS (if BDB+FSFS is compiled).
>
> svn.fs.open(self.fs_ptr, db_path, 'fsfs', pool) won't work here because
> types for open vs open_berkeley are different: _p_svn_fs_t, expected
> _p_p_svn_fs_t

This works fine. Tested.

Index: mailer.py
===================================================================
--- mailer.py   (revision 4394)
+++ mailer.py   (kopia robocza)
@@ -465,13 +465,12 @@
     self.rev = rev
     self.pool = pool

-    db_path = os.path.join(repos_dir, 'db')
-    if not os.path.exists(db_path):
+    db_path = svn.repos.svn_repos_find_root_path(repos_dir, pool)
+    if not db_path:
       db_path = repos_dir

-    self.fs_ptr = svn.fs.new(None, pool)
-    svn.fs.open_berkeley(self.fs_ptr, db_path)
-
+    self.fs_ptr = svn.repos.svn_repos_fs(svn.repos.svn_repos_open(db_path, pool))
+
     self.roots = { }

     self.root_this = self.get_root(rev)

-- 
Arkadiusz Miśkiewicz     CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org, 1024/3DB19BBD, JID: arekm.jabber.org, PLD/Linux

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org