SourceForge.net Logo

svnpserver: A CVS pserver implementation for Subversion

Author:Ralf Schlatterbeck <rsc@runtux.com>

A CVS pserver implementation that works against an SVN (Subversion) repository. Useful for e.g. old build-scripts or legacy application when migrating from CVS to SVN.

Examples of such applications may be build-scripts on old branches that have been shipped to customers and might get rebuilt in the future, but you don't want to port the build-system on all branches to subversion. Another example is a tool that uses version control but can only work with CVS.

Usage

As a prerequisite, install the python SVN modules from http://pysvn.tigris.org/ -- to develop svnpserver, Version 1.5.0 was used.

Download the source at https://sourceforge.net/projects/svnpserver/ and install svnpserver.py using the standard python setup, e.g.:

python setup.py install --prefix=/usr/local

Put an entry into /etc/inetd.conf similar to the following (the syntax is different for other inet servers like xinetd, in the following example the two lines should be joined into one):

2401 stream tcp nowait nobody /usr/local/bin/svnpserver \
    svnpserver svn+ssh://path/to/svn/repository/

The Server currently supports http and svn+ssh repository access methods. The file method is always accessing the repository as the user configured in the inetd configuration and is not recommended.

  • For the svn+ssh access method, the SSH agent socket (setting of SSH_AUTH_SOCK) is set as the cvs password. To set, run cvs login and paste the contents of the SSH_AUTH_SOCK environment variable as the password.

  • For the http access method, you have to do a blind login, using the command cvs login with the correct username and password to use for the http authentication. Symptom of a wrong password is a message similar to the following:

    SVN: Commit failed (details follow):
    SVN: MKACTIVITY of '...': authorization failed (http://...)
    

    on a cvs command that needs authentication (e.g., a commit) where svnpserver repeatedly tries to authenticate with subversion, always using the same wrong password and svnpserver after some tries decides to signal that we can't authenticate.

  • The CVSROOT is currently ignored by svnpserver but may be used in the future to access different parts of a svn repository with different settings (or different svn repos).

Bugs

Only the following CVS commands are implemented: add, ci, co, diff, remove, tag, update (and for handling the cvs pserver protocol we also implement the pserver-specific commands: Argument, Argumentx, Command-prep, Directory, Entry, Global-option, Is-modified, Modified, Root, Static-directory, Sticky, UseUnchanged, Valid-responses, Unchanged, expand-modules, gzip-file-contents, valid-requests).

When tagging a message similar to:

SVN: MKCOL of '...': 405 Method Not Allowed (http://localhost)

indicates that the directory we're trying to create with our tag already exists in the repository. This should get a more user-friendly error message. But this is a bug of svn -- you get the same error message there.

Changes

Version 0.8: Minor bugfixes

Fix Command-line parsing and help messages. Add syslog facility option.

  • optparse arguments and usage message fixed
  • syslog logfacility option added

Version 0.7: Minor bugfixes

More bugfixed, also implement (non-standard) version command to find out the svnpserver version remotely: Simply telnet to the svnpserver port and type the command "version" (without quotes). Fix bug that prevented checkout of tags and branches.

  • version command implemented
  • fix bug in last version that prevented checkout of tags and branches

Version 0.6: Minor bugfixes

More bugfixes for interacting with other cvs clients: HEAD-Tag is now recognized, syslog logging works as advertised.

  • Special handling of "HEAD" tag -- use trunk in svn
  • Fix syslog handler
  • Debug output now uses repr instead of str -- will work with non-ascii charsets in filenames
  • Do a normpath on svn path components -- fixes double-slashes in filenames that could lead to assertions
  • handling of unicode in filenames: for now encode as latin1

Version 0.5: Major bugfixes

Several bugfixes for interacting with other cvs clients (not cvs)

  • If there are no arguments to expand-modules we answer "ok"
  • python setup.py should work now, there is now a separate script svnpserver (without .py extension) that calls the real thing and has a --version command-line option
  • fix infinite hang when using http access method with wrong password, use a simple counter for failed logins.
  • add checking of svnpath, if given directory is '.' we dont append '/.'
  • add Command-prep
  • Do URL-quoting on repository URLs (spaces in filenames!)
  • allow rn for line-end

Version 0.4: Major bugfixes

Several bugfixes for tagging and committing.

  • fix tagging with tag-targets on the command-line, fixes error ERROR: Arguments unsupported for tag
  • fix tagging when tags/branches directories are in root of repository, fixes error-message: cvs tag: No tags/branches found
  • fix commit with several commit-targets on the command-line
  • sometimes complex paths were wrong (missing first character in filename), now handle other possible cases of trailing slash where we remove too much.
  • add self.svncommitdir for first committable directory (otherwise we may get SVN: '/tmp/svnpsrv9FkVar.d' is not a working copy or similar error message.

Version 0.3: Major feature enhancements

Implement cvs tag command. Bug-fixes of Static directory handling: A static directory in CVS doesn't change the set of files. Implement merging of changed files when doing a cvs update (fixes a known bug in earlier versions).

  • Implement cvs tag
  • Implement Static-directory command
  • Remove unneeded files in svn checkout
  • Implement merging of changed files (let svn do the merging)
  • Remove temporary svn checkout directories

Version 0.2: Major bugfixes

Small fixes concerning README and project web-page. Several Bug-Fixes concerning checkout and update. Implement -d option for cvs update.

  • Sourceforge Logo added to README for SF Homepage
  • Use correct stylesheet for HTML
  • Link to Download page in documentation
  • Fix leading "./" in sandbox name
  • Bug-fix: Distinguish update/checkout, don't check out too much
  • Create intermediate directories on checkout (fix cvs warning "server is not creating directories one at a time")
  • Implement -d option for cvs update
  • Allow checkout of single file with -d option of cvs checkout

Version 0.1: Initial freshmeat announcement

A CVS pserver implementation that works against an SVN (Subversion) repository. Useful for e.g. old build-scripts or legacy application when migrating from CVS to SVN.

  • Simple first version
  • Implement the following CVS commands: co, update, ci, diff, add, remove