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

Re: [PATCH] make svnmucc consistently overwrite copy targets

From: Philip Martin <philip_at_codematters.co.uk>
Date: Fri, 07 Nov 2008 15:45:31 +0000

kmradke_at_rockwellcollins.com writes:

> Philip Martin <philip_at_codematters.co.uk> wrote on 11/07/2008 06:57:25 AM:
>> Consider:
>> svn cp URL/foo URL/bar
>> if this command works a new revision is created but the user won't
>> know what that revison contains. The only way to determine which of
>> URL/bar or URL/bar/foo got created is to examine the repository after
>> the commit. Without exclusive access to the repository it is
>> impossible to predict the outcome of the copy. That's a terrible
>> interface for anyone building tools on top of Subversion.
> If you are concerned about the source revision, you can specify
> it with both "svn cp -r REV URL1 URL2" or "svnmucc cp REV URL1 URL2"
> In this case I know exactly what I copied... I'm still confused
> how you can get unexpected behavior if you specify these...

It's not the source of the copy that is the problem, it's the

  svnadmin create repo
  svn mkdir file://`pwd`/repo/foo
  svn cp -mm file://`pwd`/repo/foo file://`pwd`/repo/bar

What does the copy command do? It creates directory /bar as a copy of
directory /foo, yes? No! It created /bar/foo:
  svn log -rHEAD -qv file://`pwd`/repo
  r3 | pm | 2008-11-07 15:28:56 +0000 (Fri, 07 Nov 2008)
  Changed paths:
     A /bar/foo (from /foo:2)

I didn't have exclusive access to the repository and somebody else
created the directory /bar before I could make my copy. I did check
before issuing the copy command, but it was a race and the other
person's commit just sneaked in before my copy commit. Without
exclusive access to the repository there is no way I can know what the
copy command is going to do.

To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-11-07 16:45:50 CET

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.