[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Making import syntax consistant with mv, cp, export

From: Brent Burton <brentb_at_io.com>
Date: 2002-10-16 18:33:32 CEST

On Wed, 16 Oct 2002, Peter Davis wrote:
> [...]
> Hmm, I hadn't thought of it like that. Yes, cp, mv, etc. do treat the last
> path element as the target, even if that element is a directory.

That's right, we overlooked that (or, at least I know I did in my
past message).

> That makes me think, should import work more like cp and mv? Right now I
> can't even really summarize how to think of import, even with the new syntax
> proposal; something like, "take this URL and copy all of the files under the
> source into it". Should we think of it more simply as "copy this local
> directory into the repository"?

I believe so. Making the usage similar to well-known tools
isn't a liability. Let's think about 'cp -r target [target ...] dest'.
That really is what the import statement is doing, is essentially
copying a nonversioned source hierarchy into the repository.

> In that case, it should really be:
> $ svn import SOURCE REPOS-URL/[NEW-ENTRY]
> SOURCE could actually be multiple arguments, so
> $ svn import ./graphics/bsp/* REPOS-URL
>
> work work essentially the same as
> $ cd ./graphics/bsp
> $ svn import . REPOS-URL
>
> If you type the following:
> $ svn import ./graphics/bsp REPOS-URL
> then you will actually end up with a new directory "bsp/" under REPOS-URL,
> since bsp/ and its contents are the target of the operation.

> So, what does everyone else think of this? Now that Benjamin has
> pointed it out, this new style actually makes more sense to me.

The new proposed usage above really nails it I think. One has
target files and directories they want tracked by SVN, and so
they import those targets into the repository. Stating "the obvious"
just makes clear the thinking, and the syntax.

On a related note...
In past messages we discussed making new parent/extra directories in the
repository with 'svn import' by simply naming them in the repository path.

I.e., if an empty repository dir looks like:
  $URL/repos/
and we run 'svn import graphics/bsp $URL/repos' then we get:
  $URL/repos/bsp

If we want to preserve the graphics directory, would we then
specify 'svn import graphics/bsp $URL/repos/graphics' to get:
  /repos/graphics/bsp ,
or just rely on 'svn mkdir'. How much congruency is desired between 'svn
import' and cp(1), mv(1), etc, will dictate whether this naming shortcut
is warranted.

Is this shortcut something you want to worry with right now?

-Brent

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 16 18:35:16 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.