Central Revision Control System Subversion

As a central version control system we are running a subversion server subversion.gsi.de.

Repository service policy

Repositories on the central server can be created on request. Access will be available via WebDAV (https://subversion.gsi.de/repository/).
Send your requests to subversion-service@gsi.de.

In general GSI IT recommends the use of git and https://git.gsi.de.

Access Control

User management is handeled on a per-repository basis. We offer authentication via the LinuxFarm's UserAccounts, "GSI web login" Oracle accounts and "roll-your-own" plain Apache username-password-files (htpasswd). Anyhow the latter is not recommended as we cannot provide a convenient solution for the management of disjoint accounts by now.

There's also the possibility of unauthenticated (ie. anonymous) read access for the repository, anyhow this does not mix well with read-restricted subtrees.

Per-repository access control

Additional access control on a fine-grained (per-file and per-directory) basis is possible using a so called AuthzSVNAccessFile. Management of this file is at your disposal.

Access control is managed via a separate repository access. Beneath https://subversion.gsi.de/access/repo resides a file called authz. This file is the access rules for the repository repo. The format of the authz file is documented here: http://svnbook.red-bean.com/nightly/en/svn.serverconfig.pathbasedauthz.html

As repository admin you can
  1. checkout that file (svn co https://subversion.gsi.de/access/repo, authenticate with your GsiLinuxAccount),
  2. modify it and
  3. check it in again.
The changes will be activated immediately after commit. Additional admins for the access rule management can only be added by HPC department staff.

Hooks

Hook-scripts can be defined for the repositories. These scripts will be executed when a specific repository action occurs, i. e. a post-commit hook may send an email to the interested parties whenever changes have been committed.

The hooks are also managed via the access repository (see above).

Backup

All repositories are backed up to the TapeStorage daily including the full revision history. Additionally incremental backups are performed on each commit by default (using a hook).

Web frontend

We offer Trac as a web-based subversion browser, see https://subversion.gsi.de/trac. Using Trac's additional features (wiki, tickets) is possible but not well supported by us.

Private subversion repository howto

Instead of using the central server you can also create and use private subversion repositories. Before creating private subversion repositories you should take a look at http://git-scm.com/ git or http://mercurial.selenic.com/ mercurial (hg) that are probably more suited for this purpose.

Anyway here's a small howto for creating and using a personal subversion repository:
  1. Create the repository with svnadmin create /path/to/the/repository
  2. Checkout a working copy: svn co file:///path/to/the/repository [/path/to/the/working_copy]
    (If you omit the working copy path, a now directory named like the repository will be created inside the current directory).
    • Access from outside the GSI LinuxFarm is possible via svn co svn+ssh://lx-pool.gsi.de/path/to/the/repository [/path/to/the/working_copy]

Clients for repository access

Linux

svn command line client

Access is currently mainly availabe through the svn command line tool (try svn help for more info).

Basic Commands

svn co repository-URL
create a fresh working copy of the given repository (sub-)tree.
svn update [file]
sync a local working copy with the newest repository changes. File or directory names may be given on the command line to sync these files/dirs only.
svn add file
register a new file as part of the current working copy. This is a mandatory step before the file can be commited.
svn status
List files with local changes, and files not in version control yet.
svn diff [file]
View the changes made to your working copy.
svn ci [file]
upload local edits to the repository (check-in / commit). A comment has to be given (either interactively or using -m "comment" on the command line).

Additional hints

  • For repository authentication the normal UserID is taken by default. A different UserID may be given using the --username _userid_ switch of the svn command.

Setting the executable bit of a file after import

The special property svn:executable controls if a files executable bits are set on checkout. It is automatically set if the executable bit is already set on svn import/svn add.

If it's set in a working copy only after import, it will be reset on each svn update, unless the property has been set manually.

It can be manually (re)set by the following commands:
svn propset svn:executable '' file and
svn propdel svn:executable file

Activating keywords

Subversion can replace certain keywords in your files on checkin (i. e. $Id$ etc.). To activate this, you have to add the keywords to be replaced to the svn:keywords property:
svn propset svn:keywords "Id LastChangedBy HeadURL" file.

The available properties are LastChangedDate, LastChangedRevision, LastChangedBy, HeadURL and Id. They have to be parenthesized with Dollar signs in the source files.

One can also use wildcards (*) for file.

Ignoring whitespace changes on diff

You can specify the diff command and its options when calling svn diff:
» svn diff --diff-cmd diff -x -uw [file ..]

Convert working copies to work with older clients

See http://subversion.apache.org/faq.html#working-copy-format-change. change-svn-wc-format.py is installed in /usr/local/bin/.

Editor integration

Emacs

psvn.el is included in the standard subversion Debian packagedebian. To enable it, append (require 'psvn) to your ~/.emacs. After emacs has been restarted the subversion mode can be enabled with M^x svn-status.

Windows

TortoiseSVN
Windows Shell Extension for Subversion. Very nice graphical interface, completely integrated in the Windows explorer, http://tortoisesvn.tigris.org/ $ PushOK svn SCC Proxy : MS SCC API compliant client, suitable for MS IDEs and e.g.

More information

-- Christo, MichaelDahlinger - 2005 - 2021
Topic revision: r23 - 2022-03-30, ChristopherHuhn - This page was cached on 2024-12-05 - 18:34.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Legal notice | Privacy Policy (german)