Working with config files

SQL Source Control has full integration with , SVN, TFS and Vault. If you want to customize how SQL Source Control works with these systems, or if you want to use a different source control system (eg ), you can use a config file.

A config file is an XML file that contains command line hooks to automate source control operations (add, edit, delete etc). SQL Source Control can use config files to automate source control operations for any source control system with a command line interface. Preset config files are provided for:

Git Mercurial Plastic SCM

You can modify the preset files or create your own.

Commands in the config files

The preset config files include the following commands:

Get latest Updates the local working folder with latest version in source control.

Commit Commits all changes in the local working folder to source control.

Add Adds new files to the local working copy. Changes can then be committed to source control using the command.

Edit Makes the local working copy of the files available for editing. Changes can then be committed to source control using the Commit command.

Delete Deletes the files from the local working copy. Changes can then be committed to source control using the Commit command.

Revert Undoes changes if an error occurs during a commit.

Creating a custom config file

To create a custom config file for your source control system:

1. On the Link to Source Control dialog box, on the left, select Custom. 2. Click Manage config files. The CommandLineHooks folder opens. 3. Open Template.xml in a text editor and specify commands and verification codes for the source control actions you want to automate. Help is provided inside Template.xml.

Make sure you specify the name you want to use for the config file in the tag. For example:

Darcs

To include multiple operations in a single command, separate them with &&. For example:

accurev add -c -d ($Files) && accurev keep -m && accurev promote -k

4. Save your changes as a new XML file in the default config files folder: %USERPROFILE%\AppData\Local\Red Gate\SQL Source Control 4\CommandLineHooks

You can select the config file in the Custom tab in the Link to source control dialog box.