Trac usage: Creating and accessing projects

The below usage notes are dependent on trac-initproject.
The exemplary project name is called foobar.
 

git

To initialize the project, log into the Trac server and execute:

trac-initproject git foobar

Developers can then upload their local master branch using the following methods:

If public push access is enabled:

git-push git://appliance_ip/git/foobar master 

Or, over an SSH connection:

git-push ssh://root@appliance_ip/srv/repos/git/public/foobar.git master

Optionally, the developer can configure the remote repository for simpler future updates:

git-config remote.turnkey-trac.url ssh://root@appliance_ip/srv/repos/git/public/foobar.git
git-config remote.turnkey-trac.push +master:refs/heads/master
git-push turnkey-trac

Users can then clone the remote repository using the following methods:

Anonymously:

git-clone git://appliance_ip/git/foobar

Or, over an SSH connection:

git-clone ssh://root@appliance_ip/srv/repos/git/foobar

 

As of v14.0, Bazaar is no longer supported.

Bazaar (bzr)

To initialize the project, log into the Trac server and execute:

trac-initproject bzr foobar

Developers can then upload their local branch:

Over an SFTP connection (depends on python-paramiko)

bzr push sftp://root@1.0.0.94/srv/repos/bzr/foobar

If there is no default push location set, the first push will set it. After that, the location can be omitted and the default will be used:

bzr push

Users can then clone the remote repository:

bzr clone bzr://appliance_ip/bzr/foobar

 

Mercurial (hg)

To initialize the project, log into the Trac server and execute:

trac-initproject hg foobar

Developers can then upload their local branch using the following methods:

Note the extra slash. Mercurial assumes paths are relative to the users home directory over SSH connections:

hg push ssh://root@appliance_ip//srv/repos/hg/foobar

Optionally, the developer can configure the remote repository for simpler future updates, by adding the following to foobar/.hg/hgrc

[paths]
default-push = ssh://root@appliance_ip//srv/repos/hg/foobar

Future pushes can then be performed as follows:

hg push

Users can then clone the remote repository:

hg clone http://appliance_ip:8080/foobar

 

Subversion (svn)

To initialize the project, log into the Trac server and execute:

trac-initproject svn foobar

Developers can then checkout the remote repository, make changes, then commit back to the remote repository:

Checkout over SSH:

svn co svn+ssh://root@appliance_ip/srv/repos/svn/foobar

After making local changes, they can be commited to the remote repository:

svn commit

Users can then checkout the remote repository using the following methods:

Anonymously:

svn co svn://appliance_ip/svn/foobar

Or, over an SSH connection:

svn co svn+ssh://root@appliance_ip/srv/repos/svn/foobar

 

Comments

Leandro's picture

My thanks to both René and "Guest" for their responses. I decided to go along with the latter's, as it's less "intrusive" and my repository isn't especially sensitive (so no need for SSH).


Ryan's picture

Hello,

I am trying to use the helper script to create a new GIT project.  When executing from the command line:

 

/usr/local/bin/trac-initproject git foobar
 
I am getting the following error:
 
/usr/local/bin/trac-initproject: line 75: git-init: command not found
 
Looking at the script, I see line 75 is:
 
git-init
 
I try to locate the git-init script on my Trac appliance by running:
 
find / | grep git-init and I find it in /usr/lib/git-core/git-init
 
So I modified the trac-initproject script line 75 to include /usr/lib/git-core/git-init and re-run the command trac-initproject git foobar and that seems to work
 
Did I do something along the way to break the ability to locat the git-init command, or is this a known issue?
 
 
 
Manoj Pooleery's picture

Hi,

Unfortunately, the appliance we installed was the Revision Control one for SVN.  I am trying to add Trac on the same machine.  Here are the commands that I ran:

1. sudo apt-get install trac : It appeared to install Trac and I could see it as installed from the Webmin UI)

2. Created the script - http://www.turnkeylinux.org/docs/trac/trac-initproject

3. Ran sudo trac-initproject svn TestRepo (TestRepo was already existing and it complained that svnadmin: '/srv/repos/svn/TestRepo' is a subdirectory of an existing repository rooted at '/srv/repos/svn/TestRepo'

4. Ran it again on a repo that didn't exist

sudo trac-initproject svn testtickets

initializing trac project: svn
Creating and Initializing Project
Initenv for '/var/local/lib/trac/svn-testtickets' failed. 
 Failed to create environment.
[Errno 2] No such file or directory: '/var/local/lib/trac/svn-testtickets'
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/trac/admin/console.py", line 583, in do_initenv
    options=options)
  File "/usr/lib/python2.6/dist-packages/trac/env.py", line 207, in __init__
    self.create(options)
  File "/usr/lib/python2.6/dist-packages/trac/env.py", line 316, in create
    os.mkdir(self.path)
OSError: [Errno 2] No such file or directory: '/var/local/lib/trac/svn-testtickets'
 
What am I doing wrong?  Can't a trac system be installed as an addition to another appliance?  Any help would be really appreciated.
 
Thanks
-Manoj.