Njudge CVS
Howto
This HowTo
explains how to access the CVS repository
for Njudge in a variety of forms, either
using Windows or Unix/Linux clients
CVS General Principles
To use CVS, each
user works on a local copy of files. Whenever a certain point is reached on
these files (such as they compile and build correctly) they are checked into
the repository. Files are not locked exclusively by users who wish to change
them: instead, at commit time, CVS verifies if the someone has checked in a new
version since the user’s copy. If so, an error message is generated and the
user has to decide what to do next (discard changes and start again, or try to
merge in with new checked in version).
CVS itself is an
old product, with a simple organization. Despite its limitations, it has become
the de-facto standard free version control system.
Initial Setup
To use the CVS
repository for njudge, you need to firstly get an account from the machine
SysAdmin, David Kovar. Make sure that you indicate that you wish to work with
CVS for the njudge project. On being given your preference for a username, he
will then create an account for you on the machine, for you to work on the code
with.
Pre-setup on devel.diplom.org
Almost all the setup required should automatically be performed (correct
paths for command tools, environment settings etc.) The only thing to verify is
that the environment variable for CVS is correctly setup.
You should check the file ".cshrc" in your home directory for
the line:
setenv CVSROOT
/usr/local/cvs
If not found, this should be added to the file.
Remote sandbox on devel.diplom.org
The first,
classic way to work with CVS is directly on the development machine. In this
mode, you use the tools that are supplied (mainly the command-line ‘cvs’ and
‘vi) to work with the repository and change files. There is also all the tools
installed to build the njudge software already installed on the machine.
Here are listed
some of the more useful commands of CVS which can be used directly on
devel.diplom.org. (Click here
for complete CVS manual):
cvs co –R njudge To
create the whole njudge structure in current directory, using latest files in
repository (useful to create a new sandbox in an empty directory)
cvs commit
<files> To commit changed files to
repository
cvs update To
update sandbox with latest files in repository
cvs diff <files> To compare files in sandbox with latest version in repository
cvs add <files> To
add files to repository
csv remove <files> To remove files from repository (*Caution, this is not undo-able
*)
Remote client access
Though you can
work on the devel.diplom.org machine, the delay (for expecially non-US users)
and the lack of a graphical interface can become significant limitations. To
combat this, it is possible to work on a remote copy of the source on your
local mchine, and then remotely update the CVS repository.
Depending on the
client you are using, different options exist, as detailed below.
Linux/Unix client access
A Linux/Unix
client can be used to work remotely. In general, you are not limited to what
version of Linux/Unix you can use, as they should, with standard software, be
able to work ‘out-of-the-box’ for remote CVS operation.
Flavours that are
known to work are:
The SSH client, OpenSSH
Most Linux/Unix
systems now come with OpenSSH installed. This will permit you to make a secure
link to the devel.diplom.org machine, both for logins and for file copying (via
sftp or scp). In this mode, you can use the remote mode of CVS to create a
local sandbox copy, and use your local client tools (graphical editor, debugger
etc.) to work with the code.
To remove the
requirement to always specify your password, as well as simplify the
requirements for other front-ends you may wish to use, it would be useful to
generate your own SSH key.
You can do this
via the ssh-keygen
program. Invoke it via “ssh-keygen –t rsa”. Accept normally the default path
suggested, and supply no password. The public key that is then generated should
be appended to the files ~/.ssh/authorized_keys and ~/.ssh/authorized_keys2 in
your account on the devel.diplom.org machine.
Once this is
done, you should be able to logon via ssh to devel.diplom.org, without having
to supply a password.
If you have
problems, you can try the link here, or look
on the web for ‘ssh’ or other key words.
Graphical Interface for local sandbox, using Cervisia
To avoid having
to directly manipulate CVS commands, as well as having a pretty GUI, you can
use the Cervisia program to interface with CVS. It is a simple program which,
once set up, is reasonably easy to use.
To set it up with
your account details, you should do the following:
<to be
done>
Windows client access
Any version of
Windows PC can connect to the devel.diplom.org sstem, via command line. Windows
itself does not come with a secure access program, but a bastardized ‘telnet’
which provides poor functionality, especially in terms of screen handling.
However, it will work if you are in a tight spot or on a borrowed PC without
any thing else installed.
using an SSH client, PuTTY
It is preferable
to use a secure client to access the devel.diplom.org machine, with improved
functionality as well. The PuTTY client seems to fit the bill, as it works for
most Windows variants and provides a simple yet effective suite of programs.
To remove the need to specify your password each time you login, as well
as enable a graphical interface (see later) it is useful to generate a key on
your PC. Run up PuTTYgen
to generate a key. Choose an SSH2 (RSA) key (leave at 1024 bits) and press the
'generate' button. After waving the mouse around aimlessly for a while to
generate the key, choose a comment (usually with your name, if not your email).
Leave the password blank (otherwise you'll have to supply it every time you
boot up your PC).
Select (using the cursor) all that is in the grey "Public key for
pasting..." section, and paste that into a file that you save.
Also Save both the public and the private keys into known files.
Then set up pageant (also
part of putty) to run on boot up on your PC, passing it the name of the private
key file.
Now, on devel.diplom.org, go to the .ssh directory in your home (create
it if not there) and create two files, authorized_keys and authorized_keys2. In
each of these files, place the content of the file which has the pasted
information.
Having done this, you should now be able to logon to devel.diplom.org
without supplying a password, using putty (ssh).
Graphical Interface for local sandbox, using WinCVS
You should be able to install WinCVS and use it to access the repository
via a local copy on your PC.
To do this, you need to take the following steps:
-
Install SSH client (PuTTY) as
described above, including key generation.
-
Install WinCVS
-
In the Admin->Login, set in “Login
Settings” tab the “CVSROOT –d” option
-
In the Admin-Login, General, set
the following:
o mode to ‘ssh’ (check the settings and, if PuTTY is not in your path, add
its path)
o Unix path to ‘/usr/local/cvs’
o Host Address to ‘devel.diplom.org’
o User name to your user name previously assigned
o CVSROOT to ‘[email protected]:/usr/local/cvs’ (using above
username)
Now, to create your local sandbox copy, use the ‘Create->Checkout Module’
option, specifying in the ‘Checkout Settings’ tab the following:
o Module name and path on server as ‘njudge’
o Local folder to checkout to as whatever local path you wish.
This action will then create the local copy of the repository on your
machine, using you SSH Client settings to connect remotely to the machine. The main
window will then show the local folder selected (make sure your local path is
specified at the window top) and, with standard mouse operations, you can then start
to work on the repository.
Millis
Miller
7th
March 2003