What the heck is Trac?

Trac is a web based software management tool written in Python (it is open source). As near as I can tell at this stage, it is some kind of hybrid based on SVN and a wiki, with a web based source browser and some kind of "ticket based" bug reporting system also rolled in. I view it as a web based front end for a SVN repository. See my notes on SVN use.

TRAC at the mmt

Web access at: MMT trac.
Our svn repositories are at hacksaw:/mmt/REPOS.

Each project is a directory within the svn repository (and we have one "big muthah" repository).

Here is how I add a project to the repository:

svn mkdir svn+ssh://hacksaw/mmt/REPOS/new_project
(or: ) svn mkdir -m "blah" --non-interative svn+ssh://hacksaw/mmt/REPOS/new_project

Once this has been done, you may or may not want to create the 3 "traditional" svn directories branches, tags, and trunk. I still create them, even though I have found them of limited use in my way of doing things:

svn checkout svn+ssh://hacksaw/mmt/REPOS/new_project
cd new_project
mkdir branches tags trunk
svn add branches tags trunk
svn commit
cd ..
rm -rf new_project
svn checkout svn+ssh://hacksaw/mmt/REPOS/new_project/trunk new_project
cd new_project
-- populate the trunk with the project files
-- and svn add them all
svn commit
cd ..
By doing things as described above your working copy will have no trace of the trunk business and the trunk, branches, tags structure will exist in the repository in case you ultimately decide to do things the way the big boys do.

There are many ways with svn to skin the proverbial cat. Some people might prefer to use svn import to load a project into the repository. I do not favor this because I like to contemplate each file as I add them. It seems that when I have done an import, there ends up being some trash files or a bunch of object files in a subdirectory that I did not want in the repository and I have to go find and remove all of these, leaving cruft in the repository history. You may be sharp enough not to do such things.

If you did choose to use import, you might do it like this:

svn checkout svn+ssh://hacksaw/mmt/REPOS/project localdir
cd localdir
mkdir branches tags trunk
cd trunk
tar xvf /home/joe/bigproject.tar .
svn import . svn+ssh://hacksaw/mmt/REPOS/project/trunk
Using import is just a fast and convenient way to do a bunch of svn add and commit commands. It basically does just that, a recursive add and commit of some directory tree, so you could use it to add a big chunk of stuff to a project. However, doing things in this way does not leave you with a working copy! You still need to ditch this template that you just checked in and then checkout a working copy. Usually I use this as an opportunity to hide the trunk directory, in the following way:
cd localdir
cd ..
rm -rf localdir
svn checkout svn+ssh://hacksaw/mmt/REPOS/project/trunk localdir

To get rid of an entire project, this seems to do the job:

svn rm svn+ssh://hacksaw/mmt/REPOS/project

Note that svn does not have a rmdir command, you just use the rm command for either directories or files. It would seem that the rm does just fine for removing a directory full of files.