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

Making import syntax consistant with mv, cp, export

From: Peter Davis <peter_at_pdavis.cx>
Date: 2002-10-16 11:31:36 CEST

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> I would expect this to import ./graphics/bsp into the repository root,
> -> file://path/to/repos/bsp/readme.txt
>
> I think my expectation is due to cp, mv, rsync, etc. which AFAIK all
> work on the named directory if the target is an existing directory and
> I think about the repos path as a directory.

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 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"? 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. This is as
opposed to the way import works now and the way it would work under my last
proposal, where the "bsp/" directory would *not* be created under REPOS-URL;
only its contents would be copied.

This would make it work exactly the same as "svn copy", only it works with
non-versioned files/directories. In fact, maybe import should be revamped to
support files as arguments as well.

This would make cp/import a nice complement to checkout/export. With export,
it's just reversed: "Copy the contents of this URL into this local
directory". Export's arguments represent that thought: "svn export
REPOS-URL/PATH LOCAL-DESTINATION".

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

- --
Peter Davis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9rTH7hDAgUT1yirARAq7ZAKCJOstvraeYqJzwMlSaZpZNoEoHRQCeNlay
TWpZe8oicLYy//tks4TDBgk=
=kjVf
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 16 11:32:28 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.