[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 more consistant (Was Re: making repositories)

From: Brent Burton <brentb_at_io.com>
Date: 2002-10-14 23:33:50 CEST

Hello all,

As a new user of Subversion (just installing it this past
weekend), the first problem I was faced with was the confusing
syntax of the import statement.

What was most confusing about it was the third arg to specify
the NEW_ENTRY_IN_REPOS. While it provides a way of rearranging
or renaming existing hierarchy during importation, it is not
intuitive.

In looking at the Issues DB and past email, this topic has
come up before.

More comments below quote ...

On Mon, 14 Oct 2002, Peter Davis wrote:
> ....
> Right now, we use "svn import" as:
> $ svn import REPOS_URL [PATH] [NEW_ENTRY_IN_REPOS]
> I propose:
> $ svn import REPOS_URL[/NEW_ENTRY] [PATH]
>
> My problems with the current scheme:
>
> (1) AFAIK, import is the only command where REPOS_URL and ENTRY_IN_REPOS are
> separate. This is inconsistant.
> ....
> All of the current use cases could be accounted for by the change. If you
> have a working copy with a single file "foo" in the directory "working-copy":
>
> (1) $ svn import url://repos/new-entry working-copy
> Create directory new-entry/ in repository and copy contents of working-copy
> into that directory. You end up with "url://repos/new-entry/foo".
>
> (2) $ svn import url://repos/ working-copy
> Same thing, but without creating "new-entry/". You end up with
> "url://repos/foo".
>
> (3) $ svn import url://repos/
> Copy contents of current directory into repository root. If the current
> directory contains the working-copy directory, you end up with
> "url://repos/working-copy/foo", along with all the other contents of the
> current directory.
>
> And, the change would provide one additional use case:
>
> (4) $ svn import url://repos/new-entry
> Create directory new-entry/ in repository and copy contents of current
> directory there. You end up with "url://repos/new-entry/working-copy/foo".
>
> which is impossible right now because you can't specify the third argument
> without the second.

So continuing with my learning experience, in my "src" directory, which
corresponds to the root of the new repository, I want to add the contents
of subdirectory graphics/bsp/ so I ran:
  svn import http://srvr/repos graphics/bsp
which was not at all what I wanted.

One could argue this import command has the same semantics as
"cp -r".

But the results I was expecting (for whatever reason) were
along the lines of
  tar cf - some/long/path | (cd ....; tar xf -)
which recreates the some/long/path hierarchy under the .... location.

Of course, that's what was intuitive to me, but I realize not
everybody would expect that.

Sooooo, Peter's suggestion of moving the NEW_ENTRY_IN_REPOS
argument to be concatenated to the repos path makes perfect
sense. It's intuitive, it allows hierarchy renaming/relocating
during importation, and it solves the odd syntax ordering of
PATH and NEW_ENTRY_IN_REPOS.

I'll also say his other usage descriptions on 'svn import' make
total sense, and seem to be the Right Thing To Do.

Just two cents from a newbie.

cheers,
-Brent

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Oct 14 23:36:42 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.