[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Beginner questions: repository versus project, import command, and others

From: Thomas Harold <tgh_at_tgharold.com>
Date: 2007-06-02 22:28:49 CEST

barophobia wrote:
> I'm really confused by Subversion.
>
> The Subversion documentation says:
>
> $ svnadmin create /usr/local/svn/newrepos
> $ svn import mytree file:///usr/local/svn/newrepos/some/project \
> -m "Initial import"
>
> 1. Why would someone put their repository under ./svn ? e.g. (as
> above) /usr/local/svn/newrepos. Why not make the repository simply
> /usr/local/svn?

There are (2) major pieces to the SVN system:

a) The repository. Which is either a BerkleyDB or a FSFS storage area
that holds all of the revisions for all of the files checked into the
SVN system. This location is typically access via either directly
(file: URLs) or through other methods (svn+ssh: or http: or https: or
svn: URLs). If it is located on the local filesystem (i.e. in
/usr/local/svn/repositoryname or /var/svn/repositoryname or
~/svn/repositoryname or C:\SVN\MyRepository) then you'll use the file://
URL to talk to it.

b) The working copy. This is where you do your development work. It is
typically some location under your home directory (i.e. ~/myproject or
C:\Dev\MyProject). You will edit files here, make changes, compile
stuff, then check it into the repository. Working copy folders will be
peppered with .svn or _svn hidden sub-folders that keep track of
information that SVN needs to know in order to match up the working copy
with the repository.

So in the documentation:

/usr/local/svn/newrepos - this is the repository location. Anything
below this path is a project within the "newrepos" repository.

file:///usr/local/svn/newrepos/some/project - this is a project folder
within the SVN repository that is 2 levels deep in the repository
(some/project)

mytree - this is your local working area where you were doing
development work prior to SVN, it is also the directory that you are
loading into the repository so that it will be under version control

/usr/local/svn - while you could make the repository in this directory,
it's better to create a sub-directory (newrepos) so that you can create
other repositories down the road.

> 2. Do I need to execute the 'svnadmin create' command each time I
> start a new development project? OR do I just need to execute the 'svn
> import' command and put that new project under my first repository?

Well, that depends on whether you want a new repository for each
project, or if you want to have multiple projects in the same repository.

It's important to keep track of what part of the URL denotes the
location of the repository and what part of the URL denotes a location
within the repository.

/usr/local/svn/newrepos/ -- the repository base URL

     projectA/ -- a top level project (directory) within the repository
         trunk/
         branches/
         releases/

     projectB/ -- also a top level directory within the repository
         trunk/
         branches/
         releases/

Anything past /usr/local/svn/newrepos/ is a folder within the repository.

> 3. Before I perform the import am I supposed to manually create the
> project directory and the trunk, branches, and tags directories?

AFAIK, yes... we did in-place importing

> 4. When I do the import do I import into /usr/local/svn/project/trunk?
> OR just /usr/local/svn/project?

Let's say you're going to have multiple projects in the same repository.
  Your import location would probably be:

/usr/local/svn/newrepos/ProjectA/trunk/

When you start up the second project and import in existing code it
would go under:

/usr/local/svn/newrepos/ProjectB/trunk/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Jun 2 22:29:20 2007

This is an archived mail posted to the Subversion Users mailing list.