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

Re: [Issue 4154] New - svn add foo foo complains

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 29 Mar 2012 13:30:55 +0200

Philip Martin wrote on Thu, Mar 29, 2012 at 10:32:42 +0100:
> danielsh_at_tigris.org writes:
>
> > http://subversion.tigris.org/issues/show_bug.cgi?id=4154
>
> > % ls
> > A foo iota
> > % $svn add f* *o
> > A foo
> > svn: warning: W150002: '/tmp/svn/wc1/trunk/foo' is already under version control
> > subversion/svn/add-cmd.c:108: (apr_err=200009)
> > subversion/svn/add-cmd.c:103: (apr_err=200009)
> > svn: E200009: Could not add all targets because some targets are already versioned
> > subversion/svn/add-cmd.c:94: (apr_err=200009)
> > svn: E200009: Illegal target for the requested operation
> > zsh: exit 1 $SVN add f* *o
> > %
> >
> > svn should be smart enough to uniq() the targets, rather than error out on me
> > because I tried to add it twice.
>
> This issue is "svn add foo foo" complaining that foo is already
> versioned. Is add the only command that is wrong?

As you point out, 'add' and 'mkdir' are similar. 'revert' even today
doesn't error out in the idempotency scenario ('svn $subc foo && svn
$subc foo'; the second invocation errors out for $subc =~ /add|mkdir/.)

> Should we eliminate duplicates in all commands?

I think we shouldn't eliminate duplicates in, for example, 'cat'.

> Silently?
>
> $ svn add foo foo # foo unversioned
> "already versioned" error
>
> $ svn mkdir X X # no X
> "file exists" error
>
> $ svn rm foo foo # foo versioned
> no error
>
> $ svn rm --force foo foo # foo added
> "does not exist" error
>
> $ svn rm foo foo # foo versioned and deleted
> no error
>
> $ svn revert foo foo # foo versioned
> no error
>
> $ svn revert foo foo # foo added
> "Skipped foo" notification
>
> --
> Philip
Received on 2012-03-29 13:31:38 CEST

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.