Link to home
Start Free TrialLog in
Avatar of nick_2007
nick_2007

asked on

Setting up a Repository

I have setup a subversion server (v1.5), that is running correctly I can commit and update using cmd line or tortoise SVN. That has been working without a problem for months.

What I am after doing though is changing the structure of the repository.

Currently everything sits in:

c:/repos/project_1/

I would like to use the concept of branches, tags and trunk.

How do I do this?

I have looked at countless webpages for the answer but so far haven't been able to get it working.

The structure of project_1 is as follows:
16/10/2008  15:14    <DIR>          .
16/10/2008  15:14    <DIR>          ..
16/10/2008  12:59    <DIR>          conf
16/10/2008  14:40    <DIR>          dav
16/10/2008  14:47    <DIR>          db
16/10/2008  12:59                 2 format
16/10/2008  12:59    <DIR>          hooks
16/10/2008  12:59    <DIR>          locks
16/10/2008  12:59               234 README.txt

Open in new window

Avatar of sunnycoder
sunnycoder
Flag of India image

Typically you would have a folder named tags and another one named branches at the same level as the trunk

Assuming project_1 is your trunk

c:/repos/project_1/
c:/repos/tags/
c:/repos/branches

Tags and branches are essentially copies - the only difference being that you dont checkin to a tag (this is again developer discipline and not enforced by SVN - unless you want to take the trouble of removing write permissions from every tag that you create)

you can create tags such as
svn copy C:/repos/project_1  c:/repos/tags/release_1_0/

creating branches is identical
svn copy C:/repos/project_1  c:/repos/branches/feature_1

Of course you need to create the release_1_0 and feature_1 folders before issuing the above copy commands

Avatar of nick_2007
nick_2007

ASKER

I would like to end up with the structure:

project_1/trunk/
project_1/branches/
project_1/tags/

Can I just move the contents of project_1 to project_1/trunk?

Or do I just place the directory trunk in project_1?

Thanks for the quick reply.
you can move the contents using svn move command
http://svnbook.red-bean.com/en/1.1/re18.html
>Can I just move the contents of project_1 to project_1/trunk?
>Or do I just place the directory trunk in project_1?
create directory trunk in project_1 and move the contents to this directory. Note that since trunk is itself in project_1 you cant move project_1/*.
If I do svn move project_1 project_1/trunk  

I get a message can not copy path - own child.
How do I go about move the directory then?

I tried creating a temp directory at the same level as project_1 to move to first but that doesn't work.
svn move C:\repos\project_1\config  C:\repos\project_1\trunk
Give me exact commands you used and exact error messages
I do not have a config directory but do you mean move each one in turn: conf, dav, db, format, hooks, locks

e.g.

svn move project_1/conf project_1/trunk/conf etc...
current directory is C:/repos/

svn move project_1 temp
svn: '.' is not a working copy
svn: Can't open file '.svn\entries': The system cannot find the path specified.

Open in new window

try using absolute paths as I had shown in my example above.
>I do not have a config directory but do you mean move each one in turn
Yes

Alternate method is to copy all to a different directory and then copy it back to the trunk. Something like

svn copy repos\project_1  repos\temp\
svn delete repos\project_1
svn copy repos\temp\ repos\project_1\trunk

Do not use delete command on a real repository until you have tried out the commands on a test setup.
Using fulls paths I get the following, could I not just move them under windows explorer?
C:\>svn move c:\repos\jdi\ c:\repos\temp\
svn: 'C:\repos' is not a working copy
svn: Can't open file 'C:\repos\.svn\entries': The system cannot find th
e path specified.
 
 
 
C:\>svn move c:\repos\project_1\conf\ c:\repos\project\trunk\conf
svn: 'C:\repos\project_!' is not a working copy
svn: Can't open file 'C:\repos\project\.svn\entries': The system cannot fin
d the path specified.

Open in new window

SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I get temp is not a working copy.

Just to clarify something, at this stage I am only trying to setup the repository correctly with branches, trunk and tags. I am not working with a checked out version of the repository.
you need to work with a checked out version otherwise none of the svn commands would work
Doing it via the checked out version I now get:
C:\svntest>svn copy project_1 http://devsever:14200/svn/project_1/trunk
svn: This client is too old to work with working copy 'C:\svntest\project_1'; please g
et a newer Subversion client

Open in new window

You can see this message if you used different clients for checking out and copying. How did you check out and which client are you using for copying?
Ohh just noticed ...

>svn copy project_1 http://devsever:14200/svn/project_1/trunk

specify a path in your local repository and not on the web
The client being used is the one that checked out the repository.

TortoiseSVN 1.5.4, Build 14259 - 32 Bit , 2008/10/11 08:23:13
Subversion 1.5.3,
apr 1.2.12
apr-utils 1.2.12
berkeley db 4.4.20
neon 0.28.3
OpenSSL 0.9.8i 15 Sep 2008
zlib 1.2.3

If I try it using local paths on the checked out version I get the following:
C:\svntest>svn copy c:\svntest\project_1 c:\svntest\project_1\trunk
svn: Cannot copy path 'C:\svntest\project_1' into its own child 'C:\svntest\project_1\trunk'

Open in new window

>C:\svntest>svn copy c:\svntest\project_1 c:\svntest\project_1\trunk
>svn: Cannot copy path 'C:\svntest\project_1' into its own child 'C:\svntest\project_1\trunk'

http:#22731444
I have installed the latest version of Tortoise, what am I doing wrong?
C:\svntest\project_1>svn mkdir trunk
svn: This client is too old to work with working copy '.'; please get a newer Su
bversion client

Open in new window

Did you checkout using the same client version?

clear out the repository from  the disk and do a clean checkout using your upgraded tortoise svn client.
It turned out I hadn't updated the command line client, command line client, tortoise and the repository are now all the same version.

However the problem still continues, I changed project_1 to p1 when I rechecked in, to save a little on typing.
C:\svntest>svn copy p1 p1/trunk
svn: Cannot copy path 'p1' into its own child 'p1\trunk'
 
C:\svntest>cd\
 
C:\>svn copy svntest\p1 svntest\temp
svn: 'svntest\temp' is not a working copy
svn: Can't open file 'svntest\temp\.svn\entries': The system cannot find the pat
h specified.
 
C:\>svn copy svntest\p1 svntest\temp\
svn: 'svntest\temp' is not a working copy
svn: Can't open file 'svntest\temp\.svn\entries': The system cannot find the pat
h specified.
 
C:\>svn copy svntest\p1\ svntest\temp\
svn: 'svntest\temp' is not a working copy
svn: Can't open file 'svntest\temp\.svn\entries': The system cannot find the pat
h specified.

Open in new window

you cant create temp in windows explorer and svncopy to it .. you need to create temp in svn and then copy to it.

>svn copy p1 p1/trunk
http:#22731444
I have moved the contents of p1 one file at a time to p1/trunk.

I have also created folders for branches and tags.

Where do I go from here?

I don't want to have all branches and tags checked out as well as the trunk in my local copy.

I have gone tortoiseSVN right click branch/tags and set the to URL inside my new branches folders.

I then updated my local copy and the new branch appeared in the folder with the files.

Do I delete my local copy and checkout just my branch or trunk?
C:\svntest>svn mkdir p1/trunk
A         p1\trunk
 
C:\svntest>svn commit
svn: 'C:\svntest' is not a working copy
 
C:\svntest>svn commit p1 -m test
Adding         p1\trunk
 
Committed revision 2.
 
C:\svntest>svn move "p1/hello world" p1/trunk
A         p1\trunk\hello world
D         p1\hello world
 
C:\svntest>svn move "p1/hello world 2" p1/trunk
A         p1\trunk\hello world 2
D         p1\hello world 2
 
C:\svntest>svn commit p1 -m trunk
Deleting       p1\hello world
Deleting       p1\hello world 2
Adding         p1\trunk\hello world
Adding         p1\trunk\hello world 2
 
Committed revision 3.
 
C:\svntest>svn mkdir p1/branches
A         p1\branches
 
C:\svntest>svn mkdir p1/tags
A         p1\tags
 
C:\svntest>svn commit p1 -m branches
Adding         p1\branches
Adding         p1\tags
 
Committed revision 4.

Open in new window

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial