On Apr 12, 2005, at 12:25 PM, Patrick Burleson wrote:
> On 12 Apr 2005 10:49:53 -0500, firstname.lastname@example.org
> <email@example.com> wrote:
>> "Robert S. Sfeir" <firstname.lastname@example.org> 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:
>>> Once you have the repository buit with this structure, create a tag
>>> of each SubDir1 into tags1 in the tags directory and watch what
>> Thanks for the report. You were teaching a class on Subversion?
>> 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?
>>> 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?
> It would appear svn copy follows the basic rules of UNIX cp. Except
> that on the last one, cp gladly copies in file3.txt into
> tags1/SubDir1/ . Maybe SVN should follow that sort of rule? Something
> along the lines of , if all the directories exist, just copy in the
> files that don't collide.
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: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Tue Apr 12 20:28:36 2005