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

Re: Export behaving badly

From: Daniel Berlin <dberlin_at_dberlin.org>
Date: 2005-10-17 14:13:43 CEST

On Mon, 2005-10-17 at 03:52 -0400, Greg Hudson wrote:
> On Sun, 2005-10-16 at 20:30 -0400, Daniel Berlin wrote:
> > svn export svn://gcc.gnu.org/svn/trunk/gcc/doc/install.texi gcc
> >
> > It creates a file named "gcc" in the current directory, containing the
> > contents of install.texi
> Seems reasonable: take this file and put it there.

> > -bash-3.00$ mkdir gcc
> > -bash-3.00$ svn export file:///svn/gcc/trunk/gcc/doc/install.texi gcc
> > svn: Can't move 'gcc.2.tmp' to 'gcc': Is a directory
> >
> > I *know* it's a directory.
> > That's why i gave it to you. To put the file in.
> >
> > IMHO, export's extra argument should behave exactly like the one to
> > checkout, and effectively copy the file into that path.
> Arguing from consistency with checkout is weird, since you can't check
> out an indidivual file. You seem to be going from "checking out a
> directory would put the directory contents into the specified directory"
> to "exporting a file should put the file into the specified directory".

Well, yes.
And what exactly is wrong with that?
Why do you think the case for a single file should be different than the
case for a directory when it comes to where we place them?

Do you honestly believe a user expects the cases to behave differently?
As a user, it certainly surprised the heck out of me.

I'd argue from docs, but you'll note that export's docs doesn't talk
about exporting single files at all.

It does say
  1. Exports a clean directory tree from the repository specified by
     URL, at revision REV if it is given, otherwise at HEAD, into
     PATH. If PATH is omitted, the last component of the URL is used
     for the local directory name.

"into PATH"
"as PATH"

I would expect the single file case to put it *into* PATH if PATH is a
directory, and into PATH as a file otherwise.

> What you're really arguing from, I think, is cp, which special-cases "cp
> file dir" for convenience, treating dir/file as the target path rather
> than dir itself. I agree that we should probably do the same thing, but
> we're hardly being unreasonable or inconsistent.

IMHO, we are.
I can't actually tell if you are arguing because you want to argue, or
because you actually like the current behavior.

If the latter, i'd actually argue that it surprises all users who have
come across it, or at least all from CVS. Having talked with other
people who have converted from CVS to SVN, all those who had automated
scripts that did exports discovered this issue, and worked around it by
*checking out the entire copy of the tree instead of single files*, just
so they could get it to do what they want.

> "svn cat
> file://.../install.texi > gcc" would fail similarly, because the shell
> has no special case like cp does.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Oct 17 14:17:04 2005

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.