wiki.webgear.co.nz Logo
RSS

Navigation





Quick Search
»
Advanced Search »

PoweredBy

Table of Contents [Hide/Show]


   About
   Usage
   Configuration
      Config Attributes
      Item Attributes
      Validation Types
   Download
   Licensing
   Resources

About

Svn Pre-Commit Validator tool (SvnPCV) is a configurable file validation utility for Subversion (svn) pre-commit hook. It's a console application written in .NET 2.

Usage

  1. Download SvnPCV, extract to a folder. I use my repository's hooks folder (c:\svn\repository\hooks)
  2. Create a config file. Use SampleConfig.xml included with the tool as a starting point. Look at Configuration section for more info.
  3. Create a pre-commit.bat file in your SVN repository's hooks folder. Use the following a command example:

    cd c:\svn\repository\hooks
    SvnPCV.exe %2 %1 config.xml
    if errorlevel=0 EXIT 0
    EXIT 1


That's it! Now every time you commit changes to your repository, SvnPCV will be called validating changes.

Configuration

Configuration scripts are xml file with the following format:

Config Attributes

  • SvnLookPath - full path to svnlook.exe. Required.

Item Attributes

  • Path - file mask (relative to repository root) used to match files to apply validation to. By default it's wildcards.
  • RegExPath - if true, the Path attribute is treated as regular expressions pattern.
  • ValidatorType - see [#Validation%20Types|Validation Types for more information.
  • ValidatorParams - validator parameters, specific to ValidatorType.

Validation Types

The following validation types are supported:
  • NonEmpty - rejects empty files
  • RegEx - allows to test file contents against regular expression. ValidatorType - regex pattern.
  • Xml - validates xml syntax.
  • Cmd - validate using external program. ValidatorType - path to executable (with optional parameters). The executable must return exit code of 0 is file is ok, and non-0 otherwise. The contents of the file are passed to the executable via standard input. Executable's standard error is captured to return as error message is validation fails. To use executable's standard output as to capture error message, use the following option:




Download

Current version is 1.0.1. Download now (with the source code - VS 2005 project)

Licensing

This is an Open Source project provided under the GNU General Public License (GPL)

The GNU General Public License can be viewed at http://www.opensource.org/licenses/gpl-license.php

If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html

Resources

© webgear.co.nz 2007-2010

Powered by ScrewTurn Wiki version 3.0.4.560. Some of the icons created by FamFamFam.