Solved

Setting up a Repository

Posted on 2008-10-16
26
885 Views
Last Modified: 2013-12-12
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

0
Comment
Question by:nick_2007
  • 14
  • 12
26 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22731286
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

0
 

Author Comment

by:nick_2007
ID: 22731382
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.
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22731404
you can move the contents using svn move command
http://svnbook.red-bean.com/en/1.1/re18.html
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 45

Expert Comment

by:sunnycoder
ID: 22731444
>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/*.
0
 

Author Comment

by:nick_2007
ID: 22731469
If I do svn move project_1 project_1/trunk  

I get a message can not copy path - own child.
0
 

Author Comment

by:nick_2007
ID: 22731529
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.
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22731549
svn move C:\repos\project_1\config  C:\repos\project_1\trunk
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22731587
Give me exact commands you used and exact error messages
0
 

Author Comment

by:nick_2007
ID: 22731651
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...
0
 

Author Comment

by:nick_2007
ID: 22731690
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

0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22731788
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.
0
 

Author Comment

by:nick_2007
ID: 22738438
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

0
 
LVL 45

Assisted Solution

by:sunnycoder
sunnycoder earned 125 total points
ID: 22738585
>could I not just move them under windows explorer?
You could but then you would lose all history. This would be local cop movement - not on the server

Let us try
svn copy repos\project_1  repos\temp\
svn delete repos\project_1
svn copy repos\temp\ repos\project_1\trunk
svn delete repos\temp

>svn move project_1 temp
>svn: '.' is not a working copy
Is this an svn checkout? If yes then have you switched copies?
0
 

Author Comment

by:nick_2007
ID: 22738646
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.
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22738808
you need to work with a checked out version otherwise none of the svn commands would work
0
 

Author Comment

by:nick_2007
ID: 22739085
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

0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22739121
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?
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22739124
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
0
 

Author Comment

by:nick_2007
ID: 22739145
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

0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22739738
>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
0
 

Author Comment

by:nick_2007
ID: 22755675
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

0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22757150
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.
0
 

Author Comment

by:nick_2007
ID: 22757341
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

0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22757477
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
0
 

Author Comment

by:nick_2007
ID: 22758164
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

0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 125 total points
ID: 22764707
>I don't want to have all branches and tags checked out as well as the trunk in my local copy.
>Do I delete my local copy and checkout just my branch or trunk?
That would work.  Also look at svn switch
http://svnbook.red-bean.com/en/1.1/ch04s05.html
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
This video will demonstrate how to find the puppet warp tool from the edit menu and where to put the points to edit.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question