Sudo from Mercurial

Read-only access to the sudo source tree (from as far back as 1993) is available for checkout using mercurial at http://www.sudo.ws/repos/sudo. Anonymous CVS access is no longer available.

Download a copy of the sudo source repo

First, you must install mercurial. You can then make a copy of the repo by running:
    hg clone http://www.sudo.ws/repos/sudo

This will create a copy of the sudo repo on your local machine in the sudo directory. This step only needs to be done once.

Next, change to the sudo directory that you just created and check out the sudo 1.8 source files.

    cd sudo
    hg update 1.8

This will populate the sudo directory with the sudo source files for the 1.8 branch.

Updating your copy

Once you have a tree checked out, you can update it thusly:
    cd sudo
    hg pull
    hg update

The hg pull will pull in changes from the master repo, the hg update will update the working copy from your local repo.

You can also do standard operations like log, diff, and annotate. While you can check in changes to your local copy of the repo, you will be unable to push the changes directly upstream. Changes may be submitted in the form of patches or change bundles.

If you are new to mercurial, the mercurial guide is a good place to start.

Browse Online

You can also browse the sudo source tree with on the web by clicking on the browse link at http://www.sudo.ws/repos/sudo. This provides a nice interface and can be handy when you don't necessarily want to check out a full copy of the source tree. Note that there are several branches and the default branch (the trunk) may not be the one you want. Stable (released) versions of sudo are built from a named branch with a major and minor number, e.g. 1.8, 1.7 and 1.6. To check out a specific release, use that release's tag, e.g. hg up SUDO_1_8_0.

Caveats

Prior to sudo version 1.5.8, the source tree was stored in RCS without the use of symbolic tags. While there are symbolic tags for versions previous to 1.5.8, not all files included in those distributions have corresponding versions in the source tree.