You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "H.S." <hs...@gmail.com> on 2007/05/10 03:37:46 UTC

repository directories layout

Hello,

I have just started to use Subversion (changed over from CVS) and wanted 
some clarifications regarding the directories layout.

I have searched google and it is a common suggestion to have trunk, 
branches and tags directories in the repository:

RepoName
    tags
    trunk
    branches


Now, what I did was, first created the repo RepoName with svnadmin 
command and then made the three directories using svn mkdir commands. I 
then checkout the repo into my local machine, and then copied the source 
code into trunk directory and then added all the files in that directory 
to the repo. Then I committed the repo back. I can then checkout the 
repo and I get the directory with repo name and the three directories 
(where trunk has the source code). Am I doing it right? If yes, then 
other programmers just make their changes in the source files in the 
trunk directory and commit their changes back?

The other method I understand is to create the three directories in a 
local directory. Put all the source files in trunk directory and then 
create the repository with all the three directories in that.

Are both the methods equivalent as far as the directory structure is 
concerned?

If you can give some other pointers regarding creating the new 
repositories (I checked the red book, it talks about the directory 
structure but doesn't give an example showing exactly what to commit 
while creating the repo), that would be an added bonus.

thanks,
->HS


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: repository directories layout

Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 10, 2007, at 07:50, H.S. wrote:

> Ryan Schmidt wrote:
>
>> On May 9, 2007, at 22:37, H.S. wrote:
>>
>>> If you can give some other pointers regarding creating the new  
>>> repositories (I checked the red book, it talks about the  
>>> directory structure but doesn't give an example showing exactly  
>>> what to commit while creating the repo), that would be an added  
>>> bonus.
>>
>> What else would you like to know? I think you've pretty much  
>> covered it here.
>
> Assume a project is underway and a few, say 3, programmers are  
> working on the same set of source code files. (I have used CVS  
> before, but only for myself and only in a very basic manner). Just  
> to clarify what you explained earlier, they do:
> $> svn checkout svn+ssh://svn.server.somewhere/path/to/project/trunk
>
> the above will create a "trunk" directory in the directory they  
> execute the command. They will work on their source code then
> $> svn commit
>
> and write a comment. That will commit their changes to the "trunk"  
> directory in the project tree, right?

Right. So far so good.


> Next, lets say that the project is in a state that the version at  
> the time is a "release", source code to be given to anyone else.  
> That "release" is created by tagging that working version in trunk  
> directory?

Yes, that's the most common use for tags. If you've decided that the  
state of trunk right now is going to be called "version 1.0" of your  
software, then you would copy it to a new tag called 1.0:

$> svn copy \
svn+ssh://svn.server.somewhere/path/to/project/trunk \
svn+ssh://svn.server.somewhere/path/to/project/tags/1.0 \
-m "Tagging trunk as 1.0"

Tags are explained in the book:

http://svnbook.red-bean.com/en/1.2/svn.branchmerge.tags.html


> Finally, lets say two programmers want to work on newly checked out  
> version but each of their changes are some major changes. So they  
> can make a branch from themselves, work on that branch and commit  
> back their changes into their own branches, and then some time  
> later "merge" those branches back into the trunk?

Yes, that's what the book calls a feature branch, one of the common  
uses for branching:

http://svnbook.red-bean.com/en/1.2/ 
svn.branchmerge.commonuses.html#svn.branchmerge.commonuses.patterns.feat 
ure

(That's kind of in the middle of the chapter and it refers to things  
earlier in the chapter, so you may want to start reading at the top  
of the page.)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: repository directories layout

Posted by "H.S." <hs...@gmail.com>.
Ryan Schmidt wrote:
> On May 9, 2007, at 22:37, H.S. wrote:

>> If you can give some other pointers regarding creating the new 
>> repositories (I checked the red book, it talks about the directory 
>> structure but doesn't give an example showing exactly what to commit 
>> while creating the repo), that would be an added bonus.
> 
> What else would you like to know? I think you've pretty much covered it 
> here.

Assume a project is underway and a few, say 3, programmers are working 
on the same set of source code files. (I have used CVS before, but only 
for myself and only in a very basic manner). Just to clarify what you 
explained earlier, they do:
$> svn checkout svn+ssh://svn.server.somewhere/path/to/project/trunk

the above will create a "trunk" directory in the directory they execute 
the command. They will work on their source code then
$> svn commit

and write a comment. That will commit their changes to the "trunk" 
directory in the project tree, right?


Next, lets say that the project is in a state that the version at the 
time is a "release", source code to be given to anyone else. That 
"release" is created by tagging that working version in trunk directory?

Finally, lets say two programmers want to work on newly checked out 
version but each of their changes are some major changes. So they can 
make a branch from themselves, work on that branch and commit back their 
changes into their own branches, and then some time later "merge" those 
branches back into the trunk?

Thanks for your earlier explanations,
->HS


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: repository directories layout

Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 9, 2007, at 22:37, H.S. wrote:

> I have searched google and it is a common suggestion to have trunk,  
> branches and tags directories in the repository:
>
> RepoName
>    tags
>    trunk
>    branches
>
>
> Now, what I did was, first created the repo RepoName with svnadmin  
> command and then made the three directories using svn mkdir  
> commands. I then checkout the repo into my local machine, and then  
> copied the source code into trunk directory and then added all the  
> files in that directory to the repo. Then I committed the repo  
> back. I can then checkout the repo and I get the directory with  
> repo name and the three directories (where trunk has the source  
> code). Am I doing it right? If yes, then other programmers just  
> make their changes in the source files in the trunk directory and  
> commit their changes back?

Yes...ish. In fact, from now on, you will want to have a working copy  
of only the trunk. You do not need to also have all the branches and  
all the tags on your local hard disk; it's generally a waste of  
space. When the time comes that you want to work with a branch, then  
create it in the repository (using URLs), and then check out just  
that branch to a new working copy, or switch your existing trunk  
working copy to the branch.

> The other method I understand is to create the three directories in  
> a local directory. Put all the source files in trunk directory and  
> then create the repository with all the three directories in that.

Well, to clarify, the other method is to create the trunk, branches,  
tags directories in a local directory, put the source into the trunk  
directory, and "svn import" the top local directory into a repository  
that has already been created with "svnadmin create".

> Are both the methods equivalent as far as the directory structure  
> is concerned?

Um, sure. You can use whichever method you prefer. Of course you'll  
only need to do this once to set up a given project.

> If you can give some other pointers regarding creating the new  
> repositories (I checked the red book, it talks about the directory  
> structure but doesn't give an example showing exactly what to  
> commit while creating the repo), that would be an added bonus.

What else would you like to know? I think you've pretty much covered  
it here.

Well, except what someone wrote about how you should decide whether  
you multiple repositories for multiple projects, or all projects in a  
single repository, or some mixture.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: repository directories layout

Posted by Talden <ta...@gmail.com>.
If you only will ever have a single project in the repository this is
probably fine.  If you have more than one and use 3rdparty libraries
and tools you probably want something a little more exotic.

We're still migrating but we'll end up with something like

repo/
    dev/
        3rdparty/
            sun/
                jdk1.4.3_11/
                jdk1.5.0_01/
            sometool/
                sometool_1.0/
        mainproject/
            trunk/
                3rdparty/
                    jdk/    <--- cheap copy from /dev/3rdparty/sun/jdk1.5.0_01
                    sometool/   <--- cheap copy from
/dev/3rdparty/sometool/sometool_1.0
                src/
                    ...
            branches/
            tags/
        olderproject/
            trunk/
                3rdparty/
                    jdk/    <--- cheap copy from /dev/3rdparty/sun/jdk1.4.3_11
                    sometool/   <--- cheap copy from
/dev/3rdparty/sometool/sometool_1.0
                src/
                    ...
            branches/
            tags/


These aren't actually the names of our folders but you get the idea I
hope.  Two projects that can independantly change their required
libraries without affecting each other yet the repository only gets
the library checked in once and then svn-copied to the other
locations.

Initially it's just a dev repository but we're expecting to have a
customer services team in there as well.  I've added the 'dev' folder
level to allow for this distinction.

Of course checkouts will simply do a

svn co svn:.../dev/mainproject/trunk mainproject

so other than the checkout they don't really deal with the extra folder depth.



Of course, I'm still migrating so I'm hardly a subversion authority -
can people 'in the know' yell out if they see any issues with this.

--
Aaron

On 5/10/07, H.S. <hs...@gmail.com> wrote:
>
> Hello,
>
> I have just started to use Subversion (changed over from CVS) and wanted
> some clarifications regarding the directories layout.
>
> I have searched google and it is a common suggestion to have trunk,
> branches and tags directories in the repository:
>
> RepoName
>     tags
>     trunk
>     branches
>
>
> Now, what I did was, first created the repo RepoName with svnadmin
> command and then made the three directories using svn mkdir commands. I
> then checkout the repo into my local machine, and then copied the source
> code into trunk directory and then added all the files in that directory
> to the repo. Then I committed the repo back. I can then checkout the
> repo and I get the directory with repo name and the three directories
> (where trunk has the source code). Am I doing it right? If yes, then
> other programmers just make their changes in the source files in the
> trunk directory and commit their changes back?
>
> The other method I understand is to create the three directories in a
> local directory. Put all the source files in trunk directory and then
> create the repository with all the three directories in that.
>
> Are both the methods equivalent as far as the directory structure is
> concerned?
>
> If you can give some other pointers regarding creating the new
> repositories (I checked the red book, it talks about the directory
> structure but doesn't give an example showing exactly what to commit
> while creating the repo), that would be an added bonus.
>
> thanks,
> ->HS
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org