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

Re: Probably bug with svn copy

From: Robert S. Sfeir <yosemitesam_at_gmail.com>
Date: 2005-04-12 20:37:02 CEST

On Apr 12, 2005, at 11:49 AM, kfogel@collab.net wrote:

> "Robert S. Sfeir" <yosemitesam@gmail.com> writes:
>> While teaching a subversion class yesterday, we came across an
>> interesting anomaly with svn copy which I believe is a bug.
>> Here is how to set it up and reproduce the behavior.
>> a new repository with the following structure is needed for testing:
>> myProject
>> myProject/tags
>> myProject/trunk
>> myProject/trunk/Dir1
>> myProject/trunk/Dir1/SubDir1
>> myProject/trunk/Dir1/SubDir1/file1.txt
>> myProject/trunk/Dir2
>> myProject/trunk/Dir2/SubDir1
>> myProject/trunk/Dir2/SubDir1/file2.txt
>> myProject/trunk/Dir3
>> myProject/trunk/Dir3/SubDir1
>> myProject/trunk/Dir3/SubDir1/file3.txt
>> Once you have the repository buit with this structure, create a tag
>> of each SubDir1 into tags1 in the tags directory and watch what
>> happens:
> Thanks for the report. You were teaching a class on Subversion? Wow,
> now we are truly The Establishment. :-)
>> svn copy myProject/trunk/Dir1/SubDir1 myProject/tags/tag1
>> A tags/tag1 (I see that file1.txt is in this directory, which is
>> what I expect)
>> svn copy myProject/trunk/Dir2/SubDir1 myProject/tags/tag1
>> A tags/tag1/SubDir1 (for some reason in this case it creates
>> SubDir1 with file2.txt in it)
> Well, sure. trunk/Dir2/SubDir1 contains file2.txt, so why wouldn't
> that be inside the tag created here?
>> svn copy myProject/trunk/Dir3/SubDir1 myProject/tags/tag1
>> Fails because SubDir1 already exists.
> This is expected. It tries to create 'tag1', but 'tag1' already
> exists. Fine: it falls back to creating 'tag1/SubDir1', but *that*
> already exists as well. So it must error.
> The 'fileN.txt's have nothing to do with it, AFAICT.
>> However as you can see by testing it is that the behavior is
>> different for the first 2 copy commands and the third behaves like
>> the second. Why is subversion changing its behavior on copy? Should
>> it not provide some kind of consistency and not take a guess on how
>> to best copy a directory or directory content?
> It shouldn't guess, it should behave according to predictable rules,
> which it is doing.
> Does this explanation make sense?
> -Karl

Hum no it doesn't follow the cp rules, if it did, then the FIRST copy
would have created the SubDir1 directory and it didn't, it did on the
SECOND copy. I think that's a bug. If you go to unix and copy a
directory, or its content, you get the contents or directory the
first time you copy, but if you noticed from my result paste the
first copy copies file1.txt to the root of tag1, not tag1/SubDir1,
the second copy which uses the same location, creates the SubDir1 and
copies the file in it... so you end up with


That should NOT be happening, what SHOULD be happening is either:




Not a mix and then fail on the third copy completely!

The third copy should have known that SubDir1 already existed and
just put file3.txt in it.

Am I mistaken here?


Robert S. Sfeir

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Apr 12 20:41:59 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.