[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: Saulius Grazulis <grazulis_at_akl.lt>
Date: 2005-04-13 08:57:12 CEST

On Tuesday 12 April 2005 19:57, Robert S. Sfeir wrote:

(First copy:)

> >>> 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)

(Second copy:)
> >>> 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)

> 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.  

FIRST copy would have created 'SubDir1' if 'myProject/tags/tag1' already
existed :). However, for your repository dump, it seems that
'myProject/tags/tag1'.

> 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,

So does the cp:

saulius@kolibris: copies/ > mkdir -p myProject/tags
saulius@kolibris: copies/ > mkdir -p myProject/trunk/Dir{1,2,3}
saulius@kolibris: copies/ > mkdir myProject/trunk/Dir1/SubDir1
saulius@kolibris: copies/ > touch myProject/trunk/Dir1/SubDir1/file1.txt
saulius@kolibris: copies/ > mkdir myProject/trunk/Dir2/SubDir1/
saulius@kolibris: copies/ > touch myProject/trunk/Dir2/SubDir1/file2.txt
saulius@kolibris: copies/ > mkdir myProject/trunk/Dir3/SubDir1
saulius@kolibris: copies/ > touch myProject/trunk/Dir3/SubDir1/file3.txt

## directories recreated like in your repository

saulius@kolibris: copies/ > cp -a myProject/trunk/Dir1/SubDir1
myProject/tags/tag1
saulius@kolibris: copies/ > ls -l myProject/tags/tag1
total 0
-rw-r--r-- 1 saulius 0 Apr 13 09:50 file1.txt
saulius@kolibris: copies/ > cp -a myProject/trunk/Dir2/SubDir1
myProject/tags/tag1
saulius@kolibris: copies/ > ls -l myProject/tags/tag1
total 4
drwxr-xr-x 2 saulius 4096 Apr 13 09:50 SubDir1/
-rw-r--r-- 1 saulius 0 Apr 13 09:50 file1.txt

## So, the result seems the same as Subversion does...

Admitedly, on the third copy 'cp' behaves differently from svn:

saulius@kolibris: copies/ > cp -a myProject/trunk/Dir3/SubDir1
myProject/tags/tag1

saulius@kolibris: copies/ > ls -l myProject/tags/tag1
total 4
drwxr-xr-x 2 saulius 4096 Apr 13 09:51 SubDir1/
-rw-r--r-- 1 saulius 0 Apr 13 09:50 file1.txt

saulius@kolibris: copies/ > ls -l myProject/tags/tag1/SubDir1/
total 0
-rw-r--r-- 1 saulius 0 Apr 13 09:50 file2.txt
-rw-r--r-- 1 saulius 0 Apr 13 09:51 file3.txt

Thus, there was no error message, and file 'file3.txt' ended up in
myProject/tags/tag1/SubDir1/. Well, I would say this is a bug in 'cp', not in
Subversion ;)...

-- 
Saulius Gražulis
Visuomeninė organizacija "Atviras Kodas Lietuvai"
P.Vileišio g. 18
LT-10306 Vilnius
Lietuva (Lithuania)
tel/fax:      (+370-5)-210 40 05
mobilus:      (+370-684)-49802, (+370-614)-36366

  • application/pgp-signature attachment: stored
Received on Wed Apr 13 08:58:22 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.