[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: Hari Kodungallur <hkodungallur_at_gmail.com>
Date: 2007-06-02 22:33:22 CEST

On 6/2/07, barophobia <barophobia@gmail.com> wrote:
>
> Hello,
>
> 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?

This is only an example, you don't *have* to follow it. Personally, I would
not put my repository anywhere under /usr.

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?

You need to run 'svnadmin create' only once per repository. Unless you want
to create another repository, you will keep checking into (or importing
into) the repository already created.

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

Once the repository is created using 'svnadmin create', the svn repository
is set. Usually we all already have a set of files that we want to import.
You might want to decide the repository layout that you want to have and
then lay your existing files out in that structure. Then import it. That
does not mean to say that you *have* to import it. Once the repository is
created, you can do, for example:

svn mkdir file:///usr/local/svn/projects/trunk -m "my comment"
svn mkdir file:///usr/local/svn/projects/branch -m "my comment"
svn mkdir file:///usr/local/svn/projects/tags -m "my comment"

svn co file:///usr/local/svn/projects/trunk mytrunk

<copy files to mytrunk directory>
svn add mytrunk/*
svn ci mytrunk -m "my comment"

You can certainly do the above set of commands. But import will all that for
you, if you have laid out the initial set of files and you just import it at
once.

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

Depends on what you import. You just have to remember that when you do 'svn
import <directory> <PATH>', the contents of the directory (and not the
<directory> itself) is imported into <PATH>.

That is, say you have:

my-working-dir
  - project
     - trunk
         <files>

If you do 'svn import my-workomg-dir/project <PATH>', then everything from
trunk, including trunk will be imported.
If you do 'svn import my-workomg-dir/project/trunk <PATH>', then everything
under trunk, not including trunk will be imported.

So the answer to your question depends on the local file structure you have
and where exactly in the repository you want those files imported.

Hope it helps.

regards,
-Hari Kodungallur
Received on Sat Jun 2 22:33:41 2007

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