You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Russell Steicke <r-...@adelie.ath.cx> on 2002/07/26 07:28:25 UTC

svn paths and the handbook

Hi,

I've been reading the svn handbook and experimenting with local svn
repositories, and I've been a bit confused by the handling of repository
paths by svn.  My viewpoint is as a reasonably experienced cvs user, and
svn newbie.  My comments here are intended as constructive, I hope they
come across that way. Please correct any of this if I'm wrong...

In a repository path such as

  http://svn.collab.net/repos/svn/trunk/subversion/

there are several different names, in several namespaces.

1. the repository access method, "http", meaning dav.

2. the hostname

With the rise of the web, people are used to seeing these two, no
problems there.

3. the path to the repository, that the web server sees.  In the svn url
above, I assume this is "/repos".

4. the path to the revision inside the repository, I assume this is
"/svn/trunk/subversion/".

The distinction between 3 and 4 confused me at the start.  3 is part of
a path in a conventional filesystem that either the web server (for dav
access) or me (for local access) can "see", and 4 is entirely within the
db files, and accessed by libsvn (?).  If I use the local access method,
eg

  $ svnadmin create /var/local/svn/repos
  $ svn import file:///var/local/svn/russells/repos proj1 proj1

then I can "see" everything up to ".../repos/", but not "proj1" in the
repository.

I don't think that the handbook is very clear on this distinction, and
it will confuse a lot of people like it has confused me.  Once I work
all this out in my head I'll be happy to submit patches for the handbook
that may clear this up a bit.


A related question:  Why does this fail?

$ svnadmin create /var/local/svn/russells/repos
$ mkdir a
$ echo hello > a/hello.txt
$ svn import file:///var/local/svn/russells/repos a a/trunk -m 'test a'
svn_error: #21069 : <Filesystem has no item>
  file not found: transaction `1', path `a/trunk'
$

The handbook has a suggested layout for multiple projects in one
repository:

  /projectA/trunk
  /projectA/branches
  ...
  /projectB/trunk
  ...

etc.  How do you achieve this in practice?  It seems I need the
equivalent of "svn mkdir". :)


TIA
Russell

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

[PATCH] for client.texi WAS: Re: svn paths and the handbook

Posted by Russell Steicke <r-...@adelie.ath.cx>.
Thanks to Julian, Nuutti and Alexis for clearing up "svn mkdir" etc for
me.

I think some examples of how to create the repository structure
(project/trunk, project/branches etc) would be good in the handbook, so
here's a patch for client.texi to add that (thanks to Alexis for the
commands). There may be a better place for it, perhaps the "Creating a
repository" section in repos_admin.texi, but this is where I was looking
for the info (as a newbie user) so this is where I put it.


Re: svn paths and the handbook

Posted by Alexis Huxley <ah...@gmx.net>.
Hi Russell,

I'm a svn newbie too, but I think I can answer some of your questions
- it'll be good to answer some - hopefully correctly ;-) instead of always 
asking :-)))

> 3. the path to the repository, that the web server sees.  In the svn url
> above, I assume this is "/repos".

Where the repository is on the disk, we have no idea; the remote web
server's config file hides that from us, and presents it as /repos/svn
(not /repos); that is the *top* of the respoitory (whereever it is).

This confused me a bit too 'cos I thought they have a repository
(presented as /repos) hosting several projects one of which is svn 
(.../svn). But it is not done that way on their site; the repository
is presented as /repos/svn.

On mine (http://dione.no-ip.org/svnXXXX) I present the repository as 
/svn and then put projects under that.

(Remove the XXXX; I've seen Google probing URLs I've put in mails to
this list so the XXXX is to stop it.)

> 4. the path to the revision inside the repository, I assume this is
> "/svn/trunk/subversion/".

No, the 'svn' is part of the presentation of the repository; you broke
the URL in the wrong place :-)

> a path in a conventional filesystem that either the web server (for dav
> access) or me (for local access) can "see", and 4 is entirely within the
> db files, and accessed by libsvn (?).  If I use the local access method,
> eg
> 
>   $ svnadmin create /var/local/svn/repos
>   $ svn import file:///var/local/svn/russells/repos proj1 proj1

Err ... what happened to 'russells' in the svnadmin? 

> A related question:  Why does this fail?
> 
> $ svnadmin create /var/local/svn/russells/repos
> $ mkdir a
> $ echo hello > a/hello.txt
> $ svn import file:///var/local/svn/russells/repos a a/trunk -m 'test a'
> svn_error: #21069 : <Filesystem has no item>
>   file not found: transaction `1', path `a/trunk'
> $

Because you create 'a' into which it will create 'trunk'.

I've found it less confusing to create the layout - with trunk and stuff
on your directory-to-be-imported - rather than doing it all through svn:

	$ mkdir a 
        $ mkdir a/branches a/tags
	$ mv <path_to_what_you_want_to_import> a/trunk

Then you have everything set up, and you can do:

	$ svn import <repos_url> a a      

- or something like that. This also has a cosmetic advantage that
you have construct and insert the module in just one transaction,
so you don't wind up with a stack of log messages:

	123: made project dir
	124: made project subdirs
	125: did project import

you just get:

	123: imported new project with dirs and subdirs

> The handbook has a suggested layout for multiple projects in one
> repository:
> 
>   /projectA/trunk
>   /projectA/branches
>   ...
>   /projectB/trunk
>   ...
> 
> etc.  How do you achieve this in practice?  It seems I need the
> equivalent of "svn mkdir". :)

Exactly; one disadvantage which I saw Justin sort of point out is
that this means if you checkout the trunk then you get a directory
called 'trunk' and not called 'projectA', which is probably what 
you want; to do that you need to specify an alternative name on 
the command line; so instead of:

	svn co <repos_url>/projectA/trunk

you do:

	svn co <repos_url>/projectA/trunk projectA

The alternative - as someone else suggested - is arrange things like
this:

	/trunks/projectA
	/trunks/projectB
	...
	/branches/projectA
	/branches/projectB
	...

But I don't think that is as modular.

Alexis

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

Re: svn paths and the handbook

Posted by Russell Steicke <r-...@adelie.ath.cx>.
On Fri, Jul 26, 2002 at 01:44:27AM -0700, Julian Fitzell wrote:
> Russell Steicke wrote:
> [...]
> >etc.  How do you achieve this in practice?  It seems I need the
> >equivalent of "svn mkdir". :)
> 
> C:\Documents and Settings\Administrator\Desktop\test>svn mkdir --help
> mkdir: Create a new directory under revision control.
> usage: mkdir [NEW_DIR | REPOS_URL].

Oh dear, how embarrassment.  How did I miss that?  Thanks.

I hope someone will still read my comments about paths etc after that...
:)



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

Re: svn paths and the handbook

Posted by Julian Fitzell <ju...@beta4.com>.
Russell Steicke wrote:
[...]
> etc.  How do you achieve this in practice?  It seems I need the
> equivalent of "svn mkdir". :)

C:\Documents and Settings\Administrator\Desktop\test>svn mkdir --help
mkdir: Create a new directory under revision control.
usage: mkdir [NEW_DIR | REPOS_URL].

     Either create NEW_DIR in working copy scheduled for addition,
     or create REPOS_URL via immediate commit.

Valid options:
   -m [--message] arg       : specify commit message "ARG"
   -F [--file] arg          : read data from file ARG
   --username arg           : specify a username ARG
   --password arg           : specify a password ARG
   --message-encoding arg   : take log message in charset encoding ARG



There ya go... the equivalent of svn mkdir... :D

Cheers,

Julian
-- 
julian@beta4.com
Beta4 Productions (http://www.beta4.com)


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

Re: svn paths and the handbook

Posted by Nuutti Kotivuori <na...@iki.fi>.
Russell Steicke wrote:
> In a repository path such as
> 
>   http://svn.collab.net/repos/svn/trunk/subversion/
> 
> there are several different names, in several namespaces.
> 
> 1. the repository access method, "http", meaning dav.
> 
> 2. the hostname
> 
> With the rise of the web, people are used to seeing these two, no
> problems there.
> 
> 3. the path to the repository, that the web server sees.  In the svn
> url above, I assume this is "/repos".

Actually, it is "/repos/svn"

> 4. the path to the revision inside the repository, I assume this is
> "/svn/trunk/subversion/".

And this is "/trunk"

[...]

> I don't think that the handbook is very clear on this distinction,
> and it will confuse a lot of people like it has confused me.  Once I
> work all this out in my head I'll be happy to submit patches for the
> handbook that may clear this up a bit.

Yes, I agree, it _is_ confusing at start. :-)

-- Naked

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