Next: Theory of patches Up: Darcs 0.9.23 David's advanced Previous: Darcs commands Contents

#
Web interface

The `darcs` web interface allows you to conveniently browse the information stored in a repository. You can view the repo by file and see the history of that file as various patches were applied, or you can browse in patch view mode, seeing which files were modified in each patch.

The `darcs_cgi` cgi script allows you to browse changes made in your darcs repository via the web. To use it with apache, you can install it using `make installserver`, and create a cache directory at `/var/cache/darcs`. This cache directory must be writeable by the cgi script, which for me means `chown`ing it to the user and group `www-data`. Finally, you should create a directory named `repos` in `/var/www`, in which you will place symlinks to the repos themselves. Once all this is done, the user can then browse the repos at `http://your.site/cgi-bin/darcs`.

The repos directory is configurable via the configuration file `/etc/darcs/cgi.conf`. This file can contain comments (any line starting with a `#' char) and key value pairs with an equal sign in between. For example:

    # This is an example for cgi.conf

    # reposdir is the directory containing the repositories

    reposdir = /var/www/repos

    # cachedir is a directory writeable by www-data (or whatever user your cgi
    # scripts run as) which is used to cache the web pages.

    cachedir = /var/cache/darcs

    # The following are used by darcs.cgi (not darcs_cgi)
    PATH = /bin:/usr/bin:/usr/local/bin

    # paths to executables, or just the executables if they are in 'PATH'
    #darcs = darcs
    #xsltproc = xsltproc

    # Path to XSLT templates (default is /usr/local/share/darcs/xslt)
    xslt_dir = /usr/local/share/darcs/xslt

    # HTTP request path of the style sheet, the default will magically read
    # /etc/darcs/styles.css
    #stylesheet = /cgi-bin/darcs.cgi/styles.css

The page, `http://your.site/cgi-bin/darcs`, displays a listing of all repos available on the server. From this page, the user can get to any available repository.

Clicking on a given repository will take you to the file view page of that repository, which shows a listing of all the files in the repo. This page also has a link to the patch view page, which is a bit more interesting.

In patch view mode, the web interface displays a listing of all the patches in the repo. Clicking on a patch gives a listing of all files that were in the repo at the time that patch was applied.

Clicking on one of the files shows the file contents, with added lines shown in green, and removed ones in red. To the left of each line is a small `+' and `-'. These are links to the patch which added or removed that line.

Next: Theory of patches Up: Darcs 0.9.23 David's advanced Previous: Darcs commands Contents