svnbook 1.4: inconsistent explanation of TTB directories?
Steve Stanley
w3steve at berkeley.edu
Thu Jun 19 11:39:21 CDT 2008
Hello,
John Niven <jniven at bravurasolutions.com> suggested (in response to my
post on the users at subversion list) that I write this list. (The
pertinent part of the users digest follows these notes.)
First of all, thanks for providing the online version of svnbook;
it's insanely great!
Second, I imagine I am stepping on the toes of the author of the
"Recommended repository layout" chunk, but I respectfully submit:
As a new Subversion administrator, I found the svnbook discussion of
the TTB directories confusing.
After reading the helpful replies from the
users at subversion.tigris.org list, I think my problem is that the book
seems to imply (in a few places) that the TTB directories are an
attribute of the repository (and thus *created* by the administrator
with svnadmin commands) whereas (as the replies indicate) the TTB
dirs are *added* to the repository with svn commands (by
administrators or users?).
In this chapter:
http://svnbook.red-bean.com/en/1.4/svn.tour.importing.html
I now suggest changing the heading "Recommended repository layout" to
"Recommended *project* layout" and likewise in the following
paragraph, with the added code examples:
While Subversion's flexibility allows you to layout your *project* in
any way that you choose, we recommend that you create a trunk
directory to hold the “main line” of development, a branches
directory to contain branch copies, and a tags directory to contain
tag copies, for example:
$ mkdir mytree/trunk ; mkdir mytree/tags ; mkdir mytree/branches
$ svn import mytree file:///usr/local/svn/repos # (or svn mkdir ...
svn ci, or svn mkdir URL ...) -ss
$ svn list file:///usr/local/svn/repos
/trunk
/branches
/tags
Other sections where the svnadmin/svn distinction seems muddled:
http://svnbook.red-bean.com/en/1.4/
svn.branchmerge.maint.html#svn.branchmerge.maint.layout
http://svnbook.red-bean.com/en/1.4/
svn.reposadmin.planning.html#svn.reposadmin.projects.chooselayout
Here it's ambiguous:
http://svnbook.red-bean.com/en/1.4/svn.reposadmin.maint.html
http://svnbook.red-bean.com/en/1.4/svn.branchmerge.using.html
http://svnbook.red-bean.com/en/1.4/
svn.reposadmin.maint.html#svn.reposadmin.maint.filtering
Here it's a lot clearer that the TTBs are created in the project:
http://svnbook.red-bean.com/en/1.4/svn.intro.quickstart.html
Respectfully,
Steve Stanley
----
Steve Stanley
Web Developer/Programmer
Technology Transfer Program
Institute of Transportation Studies
University of California Berkeley
tel: 510-540-9789
fax: 510-665-3433
www.techtransfer.berkeley.edu/
Yesterday's users-digest:
From: users-digest-help at subversion.tigris.org
Date: June 18, 2008 7:35:20 AM PDT
To: users at subversion.tigris.org
Subject: users Digest 18 Jun 2008 14:35:20 -0000 Issue 2946
users Digest 18 Jun 2008 14:35:20 -0000 Issue 2946
Topics (messages 78857 through 78886):
8<--snip--
missing from svnbook: syntax for creating the TTB directories?
78867 by: Steve Stanley
78868 by: John Niven
78870 by: Kevin Grover
78871 by: Matt imMute Sickler
78878 by: Lorenz
8<--snip--
From: Steve Stanley <w3steve at berkeley.edu>
Date: June 17, 2008 2:56:11 PM PDT
To: users at subversion.tigris.org
Subject: missing from svnbook: syntax for creating the TTB directories?
I feel like the answer should be there somewhere, but -
What is the syntax for creating the TTB directories that are
mentioned several places in svnbook?
I'm almost certain one doesn't use a shell mkdir command.
I'm almost certain that one creates them using
$ svnadmin create /path/to/repos
$ svnadmin create /path/to/repos/trunk
$ svnadmin create /path/to/repos/tags
$ svnadmin create /path/to/repos/branches
or maybe
$ svn copy file:///home/repos/trunk \
file:///home/repos/branches/bar_branch
creates the branches parent directory as needed (like svn import)?
But the online documentation for svn copy is silent on this.
It would help me (and other brand-new administrators?) to actually
see the commands, perhaps here where the TTB organization in discussed:
http://svnbook.red-bean.com/en/1.4/svn.reposadmin.planning.html
or in a new paragraph here where the svnadmin create command is shown:
http://svnbook.red-bean.com/en/1.4/svn.reposadmin.create.html
my .02
-------
Steve Stanley
Web Developer/Programmer
Technology Transfer Program
Institute of Transportation Studies
University of California Berkeley
http://diaryofawebster.blogspot.com/
From: "John Niven" <jniven at bravurasolutions.com>
Date: June 17, 2008 5:10:51 PM PDT
To: <users at subversion.tigris.org>
Subject: RE: missing from svnbook: syntax for creating the TTB
directories?
> -----Original Message-----
> From: Steve Stanley [mailto:w3steve at berkeley.edu]
> Sent: Wednesday, 18 June 2008 09:56
> To: users at subversion.tigris.org
> Subject: missing from svnbook: syntax for creating the TTB
> directories?
>
>
> I feel like the answer should be there somewhere, but -
>
> What is the syntax for creating the TTB directories that are
> mentioned several places in svnbook?
>
> I'm almost certain one doesn't use a shell mkdir command.
Correct, kind of (see later)
> I'm almost certain that one creates them using
>
> $ svnadmin create /path/to/repos
Correct..., but the TTB directories commands are incorrect...
> $ svnadmin create /path/to/repos/trunk
> $ svnadmin create /path/to/repos/tags
> $ svnadmin create /path/to/repos/branches
Incorrect.
Use "svn mkdir" for these, e.g.
svn mkdir http://servername/svn/repository/trunk -m "Creating trunk"
svn mkdir http://servername/svn/repository/tags -m "Creating tags"
svn mkdir http://servername/svn/repository/branches -m "Creating
branches"
Alternatively, after "svnadmin create" checkout the virgin repository to
a new working copy, use your shell to create the TTB directories, then
commit all in one commit:
svnadmin create /path/to/repos
mkdir WC
svn co http://servername/svn/repository WC
mkdir WC/trunk
mkdir WC/tags
mkdir WC/branches
svn ci WC -m "Cretaing TTB"
(FWIW, I prefer the 2nd method).
Also FWIW, I had a quick peek at the manual and tend to agree with you;
the command given is "svn ls" *after* the TTB directories have been
created. I think it would be more useful to show "svn mkdir" instead,
at least for the trunk directory (tags and branches is probably
overkill, and my preferred TTB creation method is possibly confusing at
that stage). Do you fancy making a suggestion to the manual'l list?!
Cheers
John
8<--snip--
From: "Kevin Grover" <kevin at kevingrover.net>
Date: June 17, 2008 5:59:22 PM PDT
To: "Steve Stanley" <w3steve at berkeley.edu>
Cc: users at subversion.tigris.org
Subject: Re: missing from svnbook: syntax for creating the TTB
directories?
On Tue, Jun 17, 2008 at 2:56 PM, Steve Stanley <w3steve at berkeley.edu>
wrote:
8<--snip--
As pointed out 'svnadmin create' creates repositories. Just remember:
you only use svnadmin to do things to repositories. (Virtually) All
work on working copies happens with 'svn'.
Personally, when I as learning SVN I found this difficult also. In
Windows I create an 'svninit.bat' file to initialize the directories
for me. However, I soon learned quicker ways.
For unix, I use this:
REPOURL is a URL to the root of the repository (should be a newly
created repo, however, it could also be subproject)
For example REPOURL could be
svn://server/repo
http://server/repo
file://path/to/repo
svn mkdir REPOURL/{trunk,tags,branches} -m "Initial Directory Structure"
This uses the brace expansion magic of bash to create all three
directories in one atomic commit.
On windows, I use this:
set r=REPOURL
svn mkdir %r%/trunk %r%/tags %r%/branches -m "Initial Directory
Structure"
To do the same thing.
- Kevin
From: Matt imMute Sickler <immute at msk4.ath.cx>
Date: June 17, 2008 5:03:47 PM PDT
To: Steve Stanley <w3steve at berkeley.edu>
Cc: users at subversion.tigris.org
Subject: Re: missing from svnbook: syntax for creating the TTB
directories?
$ svnadmin create /path/to/repos
$ svn mkdir file:///path/to/repos/trunk
$ svn mkdir file:///path/to/repos/tags
$ svn mkdir file:///path/to/repos/branches
would be more correct but not quite there.
From: Lorenz <lorenznl at yahoo.com>
Date: June 18, 2008 12:31:25 AM PDT
To: users at subversion.tigris.org
Subject: Re: missing from svnbook: syntax for creating the TTB
directories?
Steve Stanley wrote:
> What is the syntax for creating the TTB directories that are
> mentioned several places in svnbook?
> [...]
besides the possibilites mentioned by others you can also create your
directory tree using the normal shell command.
Just build the whole directory structure - including files - then
finally 'svn import' the whole tree in a single revision.
That's mostly identic to the methode described by John, but you don't
need to use the subversion client to create and move around you
directories and files.
--
Lorenz
8<--snip--
More information about the svnbook-dev
mailing list