Ruby on Rails
How To Use Darcs with a Rails Project (Version #6)

How to keep your project in a Darcs source repository.

1. First if you don’t have Darcs installed, here are the instructions to get Darcs: Installing Darcs

2. Create the Darcs repository. Suppose your project is going to be called “depot”.

cd /my/homedir rails depot cd depot darcs init

This will create the rails files and special directory called _darcs.

3. Ignore boring files. These are files you do not want keep track of; files like ones contained in the /tmp and /log directories are boring.

Open the ./_darcs/prefs/boring file in your favorite text editor
Append the following lines at the end of the file

^\tmp/cache($|/)
^\tmp/pids($|/)
^\tmp/sessions($|/)
^\tmp/sockets($|/)
^\log/development.log$
^\log/server.log$
^\log/test.log$
^\log/production.log$


It is a good idea to also append the following line:

^\config/database.yml$

This will keep darcs from looking at your database file. You will want to do this if your project is public or developed on seperate computers since database access is often differant for each location. You should include a example copy of your database.yml file if you do this so people can easily create their own.

cp config/database.yml config/database.yml.example

4. If you want to use Edge Rails you should execute the following command:

rake rails:freeze:edge

5. Tell darcs to keep track of the files and create the initial project patch:

darcs add ./* -r darcs record -am “Initial Project Layout”

You will be asked some simple questions.

6. You repository is now up and running. You should check out The Darcs Manual to learn more about using Darcs.

How to keep your project in a Darcs source repository.

1. First if you don’t have Darcs installed, here are the instructions to get Darcs: Installing Darcs

2. Create the Darcs repository. Suppose your project is going to be called “depot”.

cd /my/homedir rails depot cd depot darcs init

This will create the rails files and special directory called _darcs.

3. Ignore boring files. These are files you do not want keep track of; files like ones contained in the /tmp and /log directories are boring.

Open the ./_darcs/prefs/boring file in your favorite text editor
Append the following lines at the end of the file

^\tmp/cache($|/)
^\tmp/pids($|/)
^\tmp/sessions($|/)
^\tmp/sockets($|/)
^\log/development.log$
^\log/server.log$
^\log/test.log$
^\log/production.log$


It is a good idea to also append the following line:

^\config/database.yml$

This will keep darcs from looking at your database file. You will want to do this if your project is public or developed on seperate computers since database access is often differant for each location. You should include a example copy of your database.yml file if you do this so people can easily create their own.

cp config/database.yml config/database.yml.example

4. If you want to use Edge Rails you should execute the following command:

rake rails:freeze:edge

5. Tell darcs to keep track of the files and create the initial project patch:

darcs add ./* -r darcs record -am “Initial Project Layout”

You will be asked some simple questions.

6. You repository is now up and running. You should check out The Darcs Manual to learn more about using Darcs.