Меню:


Microsoft Visual SourceSafe is often used as a version control system in projects, developed under Microsoft Windows. Besides implementation for MS Windows, there are also implementations for other operating systems — you can read about them on the Microsoft's site.

We can work with Visual SourceSafe from Emacs by using the source-safe.el package. It implements all necessary commands, that could be performed without switching out of Emacs.

Installation of source-safe.el package

Installation of package is very simple — you need to download it from author's page, unpack and put it to place, where Emacs could find it. To use it, add following commands to initialization file:

(setq ss-program "S:\\WinNT\\SS.exe"
      ss-project-dirs '(("^D:\\\\OCI\\\\" . "$/PurifyW/")))
(require 'source-safe)

First two lines specify place of Visual SourceSafe executable and paths to the projects directories. And third line loads the package.

Work with package

Retrieving of data from repository could be performed by several functions. The ss-get function retrieve latest version of current file from repository. If you'll run this function from Dired, it updates all files in current directory and its sub-directories. You can also use ss-checkout function to retrieve current file from repository. With ss-lock function you can lock current file in repository, doesn't changing its content.

User can view list of changes with ss-diff function. To produce list of changes this function uses command, specified by ss-diff-program variable. If this function gets non-interactive-p parameter, then all changes are displayed in new buffer. But without this parameter, work with changes is performed with Ediff. User can commit changes with ss-checkin function.

To create a new branch user can use the ss-branch function. There is also opposite function — ss-unbranch, that could be used to delete concrete branch and drop all made changes. If user wants to put changes from concrete branch to main development tree, he can use ss-merge function, that performs three-way merge of changes from given branch.

The package defines several functions, that could be used to retrieve information about files — ss-history function displays change log for current file, ss-status function displays information about status of current file in Visual SourceSafe's repository, and ss-locate function shows location of current file in Visual SourceSafe's repository.

Other functions, defined by package are: ss-help function, that displays short list of available functions and their descriptions, and ss-submit-bug-report function, that could be used to send bug report to developers.

Customization

User can customize behaviour of package by defining number of variables. Most important among them are:

ss-program
specify path to the Visual SourceSafe's executable;
ss-project-dirs
defines mapping between directories on disk and names of the projects.

There are also other variables, that could be customized by user:

ss-username
specify user's name. If this variable is not set, then name of the current user is used;
ss-password
specify user's password. If this variable is not set, then password is asked on first access to repository;
ss-database-alist
defines map of file names and Visual SourceSafe's databases. This variable is used when user works with several repositories;
ss-update-email-to, ss-update-email-subject and ss-update-email-body
specify e-mail address, subject & body of e-mail message, that will send when user commits changes to repository;
ss-multiple-checkouts-enabled
defines, can user perform several checkout commands at once, or no;
ss-confirm-updates
defines, should we ask confirmation when executing UPDATE command, or no.

There is also two hooks — ss-before-update-hooks and ss-after-update-hooks, that always will called before and after UPDATE command.

Last change: 05.03.2013 16:54

blog comments powered by Disqus