Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 906
  • Last Modified:

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

0
nick_2007
Asked:
nick_2007
  • 14
  • 12
2 Solutions
 
sunnycoderCommented:
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
 
nick_2007Author Commented:
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
 
sunnycoderCommented:
you can move the contents using svn move command
http://svnbook.red-bean.com/en/1.1/re18.html
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
sunnycoderCommented:
>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
 
nick_2007Author Commented:
If I do svn move project_1 project_1/trunk  

I get a message can not copy path - own child.
0
 
nick_2007Author Commented:
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
 
sunnycoderCommented:
svn move C:\repos\project_1\config  C:\repos\project_1\trunk
0
 
sunnycoderCommented:
Give me exact commands you used and exact error messages
0
 
nick_2007Author Commented:
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
 
nick_2007Author Commented:
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
 
sunnycoderCommented:
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
 
nick_2007Author Commented:
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
 
sunnycoderCommented:
>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
 
nick_2007Author Commented:
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
 
sunnycoderCommented:
you need to work with a checked out version otherwise none of the svn commands would work
0
 
nick_2007Author Commented:
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
 
sunnycoderCommented:
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
 
sunnycoderCommented:
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
 
nick_2007Author Commented:
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
 
sunnycoderCommented:
>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
 
nick_2007Author Commented:
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
 
sunnycoderCommented:
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
 
nick_2007Author Commented:
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
 
sunnycoderCommented:
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
 
nick_2007Author Commented:
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
 
sunnycoderCommented:
>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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 14
  • 12
Tackle projects and never again get stuck behind a technical roadblock.
Join Now