You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David Kimdon <dw...@debian.org> on 2002/05/03 07:23:06 UTC

RFC: import create parent directories

Hi,

I'm writing some scripts that use Subversion and I'd like 'svn import'
to be able to create parents.  That is I'd like :

   $ svn import file:///var/svn/hello/trunk

to work even if file:///var/svn/hello doesn't already exist. (CVS does
this by default, FWIW)

If this sounds agreable to you all I'll create a patch that does this
(or at least try :-) ).

- Should this be optional behaviour?  (--force, I'd say to make it the
  default)

- Should I file a feature-request issue?

- any thoughts on why this is a bad idea or just won't work?

Thanks,

David

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

Re: RFC: import create parent directories

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Ben Collins-Sussman <su...@collab.net> writes:
> > As is, you can have just "trunk" on the end there, but if we allow
> > that final (optional) thing to have path separators, we can simply
> > build out the necessary dirs.  This way, we don't have to do network
> > turnarounds to try to figure out just how much of that path is already
> > in existence.
> 
> Mmmmm, yeah, I like that better.

+1 here too

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

Re: RFC: import create parent directories

Posted by Ben Collins-Sussman <su...@collab.net>.
cmpilato@collab.net writes:

> David Kimdon <dw...@debian.org> writes:
> 
> > I'm writing some scripts that use Subversion and I'd like 'svn import'
> > to be able to create parents.  That is I'd like :
> > 
> >    $ svn import file:///var/svn/hello/trunk
> > 
> > to work even if file:///var/svn/hello doesn't already exist. (CVS does
> > this by default, FWIW)
> 
> Let's assume for the sake of discussion that you have file://var/svn,
> but *not* hello.  Perhaps we could change our import driver so that
> the following syntax is allowed:
> 
>    svn import file:///var/svn what_to_import hello/trunk
> 
> As is, you can have just "trunk" on the end there, but if we allow
> that final (optional) thing to have path separators, we can simply
> build out the necessary dirs.  This way, we don't have to do network
> turnarounds to try to figure out just how much of that path is already
> in existence.

Mmmmm, yeah, I like that better.

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

Re: RFC: import create parent directories

Posted by cm...@collab.net.
David Kimdon <dw...@debian.org> writes:

> I'm writing some scripts that use Subversion and I'd like 'svn import'
> to be able to create parents.  That is I'd like :
> 
>    $ svn import file:///var/svn/hello/trunk
> 
> to work even if file:///var/svn/hello doesn't already exist. (CVS does
> this by default, FWIW)

Let's assume for the sake of discussion that you have file://var/svn,
but *not* hello.  Perhaps we could change our import driver so that
the following syntax is allowed:

   svn import file:///var/svn what_to_import hello/trunk

As is, you can have just "trunk" on the end there, but if we allow
that final (optional) thing to have path separators, we can simply
build out the necessary dirs.  This way, we don't have to do network
turnarounds to try to figure out just how much of that path is already
in existence.

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

Re: RFC: import create parent directories

Posted by David Kimdon <dw...@debian.org>.
Fri, May 03, 2002 at 08:59:06AM -0500 wrote:
> David Kimdon <dw...@debian.org> writes:
> 
> > I'm writing some scripts that use Subversion and I'd like 'svn import'
> > to be able to create parents.  That is I'd like :
> > 
> >    $ svn import file:///var/svn/hello/trunk
> > 
> > to work even if file:///var/svn/hello doesn't already exist. (CVS does
> > this by default, FWIW)
> 
> You're aware that 'svn import' already has the ability to create a
> single directory that doesn't yet exist, if you give it a 3rd arg?
> Obviously, though, this isn't the 'mkdir -p' behavior you're talking
> about.   I guess right now you just have to do a lot of 'svn mkdir
> URL' commands before importing.

right.  Knowing which directories have to be created is difficult as
well.  At present I can do some mkdir's and ignore errors (as long as
the errors are 'directory already exists'), or else do some sort of
'svn co -n' on the directories to see if they exist, or even some
svnadmin commands to see inside the repository.

> If CVS does this by default, then I guess maybe we should too....?

It would be nice since it makes it easier to control the structure of
the repository.

-David

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

Re: RFC: import create parent directories

Posted by Ben Collins-Sussman <su...@collab.net>.
David Kimdon <dw...@debian.org> writes:

> I'm writing some scripts that use Subversion and I'd like 'svn import'
> to be able to create parents.  That is I'd like :
> 
>    $ svn import file:///var/svn/hello/trunk
> 
> to work even if file:///var/svn/hello doesn't already exist. (CVS does
> this by default, FWIW)

You're aware that 'svn import' already has the ability to create a
single directory that doesn't yet exist, if you give it a 3rd arg?
Obviously, though, this isn't the 'mkdir -p' behavior you're talking
about.   I guess right now you just have to do a lot of 'svn mkdir
URL' commands before importing.

If CVS does this by default, then I guess maybe we should too....?

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