You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kevin Pilch-Bisson <ke...@pilch-bisson.net> on 2002/05/10 03:14:15 UTC

Re: svn commit: rev 1923 - trunk/subversion trunk/subversion/libsvn_ra_pipe

On Thu, May 09, 2002 at 10:03:58PM -0500, kevin@tigris.org wrote:
> Author: kevin
> Date: 2002-05-10 03:03 GMT
> New Revision: 1923
> 
> Added:
>    trunk/subversion/libsvn_ra_pipe/
>    trunk/subversion/libsvn_ra_pipe/ra_pipe.c
> Log:
> A rough start at an implementation of ra_pipe.  Note that this is not added
> to the build yet, since it isn't even close to working :)  Added to the repos
> right now, since some others said they might be able to work on it over the 
> weekend.
> 
> Watch the dev list for details of using this, and how well it works at
> present.

Okay here's the deal.  I can check out a greek tree by running 
svn co pipe://anything < subversion/tests/xml/co1-inline.xml

Nothing else will work yet, since most of the other vtable routines aren't
filled in yet, but hey, it's a start.

As well, you'll need to apply the following patch to make the rest of svn
aware of ra_pipe's existence.

Have Fun:)


Index: ./build.conf
===================================================================
--- ./build.conf
+++ ./build.conf	Thu Apr 25 08:52:55 2002
@@ -128,6 +128,13 @@
 install = base-lib
 libs = libsvn_subr $(SVN_APRUTIL_LIBS) $(SVN_APR_LIBS) $(NEON_LIBS)
 
+# Accessing repositories via stdin/stdout
+[libsvn_ra_pipe]
+type = lib
+path = subversion/libsvn_ra_pipe
+install = base-lib
+libs = libsvn_delta libsvn_subr $(SVN_APRUTIL_LIBS) $(SVN_APR_LIBS)
+
 # Accessing repositories via direct libsvn_fs
 [libsvn_ra_local]
 type = lib
Index: ./configure.in
===================================================================
--- ./configure.in
+++ ./configure.in	Mon May  6 20:35:02 2002
@@ -322,8 +322,13 @@
 if test "$enable_shared" = "no" -o "$enable_dso" != "yes"; then
   AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_DAV, 1,
         [Defined if libsvn_client should link against libsvn_ra_dav])
-  SVN_RA_LIB_DEPS="subversion/libsvn_ra_dav/libsvn_ra_dav.la"
-  SVN_RA_LIB_LINK="\$(abs_builddir)/subversion/libsvn_ra_dav/libsvn_ra_dav.la"
+  AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_PIPE, 1,
+        [Defined if libsvn_client should link against libsvn_ra_pipe])
+  SVN_RA_LIB_DEPS="subversion/libsvn_ra_pipe/libsvn_ra_pipe.la \
+                   subversion/libsvn_ra_dav/libsvn_ra_dav.la"
+  
+  SVN_RA_LIB_LINK="\$(abs_builddir)/subversion/libsvn_ra_dav/libsvn_ra_pipe.a \
+                   \$(abs_builddir)/subversion/libsvn_ra_pipe/libsvn_ra_dav.la"
 
   if test "$svn_lib_berkeley_db" = "yes"; then
     AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL, 1,
@@ -331,6 +336,7 @@
     SVN_RA_LIB_DEPS="subversion/libsvn_ra_local/libsvn_ra_local.la \
 	subversion/libsvn_repos/libsvn_repos.la \
 	subversion/libsvn_fs/libsvn_fs.la \
+    subversion/libsvn_ra_pipe/libsvn_ra_pipe.la \
 	subversion/libsvn_ra_dav/libsvn_ra_dav.la"
 
     ### We can't just append to SVN_RA_LIB_LINK because of the following
@@ -341,6 +347,7 @@
     SVN_RA_LIB_LINK="\$(abs_builddir)/subversion/libsvn_ra_local/libsvn_ra_local.la \
 	\$(abs_builddir)/subversion/libsvn_repos/libsvn_repos.la \
 	\$(abs_builddir)/subversion/libsvn_fs/libsvn_fs.la \
+    \$(abs_builddir)/subversion/libsvn_ra_pipe/libsvn_ra_pipe.la \
 	\$(abs_builddir)/subversion/libsvn_ra_dav/libsvn_ra_dav.la"
   fi
 
Index: subversion/include/svn_ra.h
===================================================================
--- subversion/include/svn_ra.h
+++ subversion/include/svn_ra.h	Thu May  9 22:51:48 2002
@@ -595,6 +595,9 @@
 svn_error_t * svn_ra_local_init (int abi_version,
                                  apr_pool_t *pool,
                                  apr_hash_t *hash);
+svn_error_t * svn_ra_pipe_init (int abi_version,
+                                apr_pool_t *pool,
+                                apr_hash_t *hash);
 
 
 /*----------------------------------------------------------------------*/
Index: subversion/libsvn_ra/ra_loader.c
===================================================================
--- subversion/libsvn_ra/ra_loader.c
+++ subversion/libsvn_ra/ra_loader.c	Wed Apr 24 22:54:28 2002
@@ -67,6 +67,13 @@
 #endif
   },
 
+  {
+    "pipe",
+#ifdef SVN_LIBSVN_CLIENT_LINKS_RA_PIPE
+    svn_ra_pipe_init
+#endif
+  },
+
   /* ADD NEW RA IMPLEMENTATIONS HERE (as they're written) */
 
   /* sentinel */

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: svn commit: rev 1923 - trunk/subversion trunk/subversion/libsvn_ra_pipe

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Mark Benedetto King <bk...@answerfriend.com> writes:
> He only committed it because I asked him to, so that I could add those
> very things. :-)

Good idea in such cases to say "... passing off to MBK for the blah
blah blah code..." or somesuch in the log message.  That lets everyone
know to expect another commit, and from whom.

-K

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

Re: svn commit: rev 1923 - trunk/subversion trunk/subversion/libsvn_ra_pipe

Posted by Greg Stein <gs...@lyra.org>.
On Fri, May 10, 2002 at 09:53:02AM -0400, Mark Benedetto King wrote:
> On Fri, May 10, 2002 at 02:07:36AM -0700, Greg Stein wrote:
>...
> > Per my short review of the existing code, you've got a good chunk more to do
> > than this. ra_pipe is going to need to spawn a subprogram and communicate
> > with it via a pipe so that it can read/write to perform requests. (APR has
> > everything needed to do this)
> 
> He only committed it because I asked him to, so that I could add those
> very things. :-)

I was there [on IRC], remember? :-)  And if this was already in the plan,
then great! I just didn't know if that problem had been recognized.

>...
> Yes.  I was planning on using APR's mechanisms for doing this (exactly
> how apache's mod_cgi works; I'll probably use mod_cgi as a guide).  There

Cool. mod_cgi is Goodness, but avoid mod_cgid -- the latter talks to a
persistent daemon which is maintained using the "other child" stuff. That
doesn't apply to what we're doing.

> are two things to know: what program to run locally (rsh/ssh/etc), and
> what arguments to pass it.   This second thing is where CVS really falls
> down; it presumes that your program acts exactly like rsh.

Yup.

> For example, something like:
> 
> # ~/.subversion/ra_pipe
> 
> 
> [ra_pipes]
>...

I'd suggest some tweaks to your suggested format, but the general approach
looks good. You might want to consider a way that a person can easily set up
a general pipe description. In CVS land, I just set CVS_RSH=ssh and it all
works fine. I don't have to edit a config file for each and every pipe that
I'll be setting up.

[ I believe that might mean that the pipe: URL syntax would provide for a
  "standard" piping setup ]

>...
> Not that there's no attempt at a rich URL syntax.
> I figure this syntax will be compatible with any
> URL validators that are already in place.
> 
> How does this look?

Good, overall. Like I said: if you'd like some real review, then just let us
know! :-)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

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

Re: svn commit: rev 1923 - trunk/subversion trunk/subversion/libsvn_ra_pipe

Posted by Mark Benedetto King <bk...@answerfriend.com>.
On Fri, May 10, 2002 at 02:07:36AM -0700, Greg Stein wrote:
> On Thu, May 09, 2002 at 11:14:15PM -0400, Kevin Pilch-Bisson wrote:
> >...
> > Okay here's the deal.  I can check out a greek tree by running 
> > svn co pipe://anything < subversion/tests/xml/co1-inline.xml
> 
> Per my short review of the existing code, you've got a good chunk more to do
> than this. ra_pipe is going to need to spawn a subprogram and communicate
> with it via a pipe so that it can read/write to perform requests. (APR has
> everything needed to do this)
> 

He only committed it because I asked him to, so that I could add those
very things. :-)

> In the CVS space, that subprogram is specified using CVS_RSH (although CVS
> assumes it is an rsh/ssh-like program and supplies arguments upon that
> presumption). We may want to review how to specify that subprogram and how
> and what to pass arguments.

Yes.  I was planning on using APR's mechanisms for doing this (exactly
how apache's mod_cgi works; I'll probably use mod_cgi as a guide).  There
are two things to know: what program to run locally (rsh/ssh/etc), and
what arguments to pass it.   This second thing is where CVS really falls
down; it presumes that your program acts exactly like rsh.

For example, something like:

# ~/.subversion/ra_pipe


[ra_pipes]
pipe1 = mypipe
pipe2 = myotherpipe

[pipe1]
command: /usr/local/bin/ssh2 user@firewall.foo.com "/opt/svn/bin/svn --server"
repository: http://internal.host.foo.com/repos

[pipe2]
command: /usr/bin/nc 127.0.0.1 1234
repository: http://internal.host.foo.com/repos

	


then, one would 

svn co pipe://mypipe/trunk -d monkey

   or

svn co pipe://myotherpipe/tag/release-1 -d banana



Not that there's no attempt at a rich URL syntax.
I figure this syntax will be compatible with any
URL validators that are already in place.


How does this look?

--ben


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

Re: svn commit: rev 1923 - trunk/subversion trunk/subversion/libsvn_ra_pipe

Posted by Greg Stein <gs...@lyra.org>.
On Thu, May 09, 2002 at 11:14:15PM -0400, Kevin Pilch-Bisson wrote:
>...
> Okay here's the deal.  I can check out a greek tree by running 
> svn co pipe://anything < subversion/tests/xml/co1-inline.xml

Per my short review of the existing code, you've got a good chunk more to do
than this. ra_pipe is going to need to spawn a subprogram and communicate
with it via a pipe so that it can read/write to perform requests. (APR has
everything needed to do this)

In the CVS space, that subprogram is specified using CVS_RSH (although CVS
assumes it is an rsh/ssh-like program and supplies arguments upon that
presumption). We may want to review how to specify that subprogram and how
and what to pass arguments.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

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