Solved

Setting up a Repository

Posted on 2008-10-16
26
881 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
Comment Utility
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
Comment Utility
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
Comment Utility
you can move the contents using svn move command
http://svnbook.red-bean.com/en/1.1/re18.html
0
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
>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
Comment Utility
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
Comment Utility
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
Comment Utility
svn move C:\repos\project_1\config  C:\repos\project_1\trunk
0
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
Give me exact commands you used and exact error messages
0
 

Author Comment

by:nick_2007
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:nick_2007
Comment Utility
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
Comment Utility
you need to work with a checked out version otherwise none of the svn commands would work
0
 

Author Comment

by:nick_2007
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Today companies are subjected to more-and-more data, and it won't stop any time soon.  But there are obvious opportunities for reducing data, particularly data duplicated among companies.
Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
This video demonstrates basic masking and how to edit the mask to reveal the desired image.
The viewer will learn common shortcuts with easy ways to remember them. The viewer will then learn where to find all of the keyboard shortcuts, how to create/change them, and how to speed up their workflow.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now