Previous: ecb-mode-line, Up: Customizable options


7.3.20 Group ecb-version-control

This group contains settings for the version-control-support of ECB:

— User Option: vc-directory-exclude-regexps

Which directories should be excluded from VC-state-check. If a directory matches any of the regexps of this option the VC-state of its sources will not be checked - This option takes only effect if ecb-vc-enable-support is not nil.

— User Option: vc-enable-support

Enable support for version-control (VC) systems. If on then in the directories-buffer (if the value of the option ecb-show-sources-in-directories-buffer is on for current layout), the sources-buffer and the history-buffer all file-items are displayed with an appropriate icon in front of the item-name to indicate the VC-state of this item. If off then no version-control-state checking is done.

Because this check can be take some time if files are managed by a not local Version-control-server ECB performs this check stealthy (see ecb-stealthy-tasks-delay) so normally there should no performance-decrease or additional waiting-time for the user. But to get sure this option offers three choices: t, unless-remote and nil. See the option ecb-prescan-directories-for-emptyness for an explanation for these three choices.

The option ecb-vc-directory-exclude-regexps offers are more fine granularity to exclude the sources of certain directories from the VC-state-check.

See ecb-vc-supported-backends and ecb-vc-state-mapping how to customize the VC-support itself.

— User Option: vc-state-mapping

Mapping between VC-states from the backends and ECB-known VC-states. ECB understands the following state-values:

up-to-date
The working file is unmodified with respect to the latest version on the current branch, and not locked.
edited
The working file has been edited by the user. If locking is used for the file, this state means that the current version is locked by the calling user.
needs-patch
The file has not been edited by the user, but there is a more recent version on the current branch stored in the master file.
needs-merge
The file has been edited by the user, and there is also a more recent version on the current branch stored in the master file. This state can only occur if locking is not used for the file.
added
The working file has already been added/registered to the VC-system but not yet commited.
unlocked-changes
The current version of the working file is not locked, but the working file has been changed with respect to that version. This state can only occur for files with locking; it represents an erroneous condition that should be resolved by the user.
ignored
The version-control-system ignores this file (e.g. because included in a .cvsignore-file in case of CVS).
unknown
The state of the file can not be retrieved; probably the file is not under a version-control-system.

All state-values a check-vc-state-function of ecb-vc-supported-backends can return must have a mapping to one of the ECB-state-values listed above. If for a certain backend-VC-state no mapping can be found then per default 'edited is assumed!

The default value of this option maps already the possible returned state-values of vc-state and vc-recompute-state (both GNU Emacs) and vc-cvs-status (Xemacs) to the ECB-VC-state-values.

— User Option: vc-supported-backends

Define how to to identify the VC-backend and how to check the state. The value of this option is a list containing cons-cells where the car is a function which is called to identify the VC-backend for a DIRECTORY and the cdr is a function which is called to check the VC-state of the FILEs contained in DIRECTORY.

Identify-backend-function: It gets a full directory-name as argument - always without ending slash (rsp. backslash for native Windows-XEmacs) - and has to return a unique symbol for the VC-backend which manages that directory (e.g. 'CVS for the CVS-system or 'RCS for the RCS-system) or nil if the file is not managed by a version-control-system.

Check-vc-state-function: It gets a full filename (ie. incl. the complete directory-part) and has to return a symbol which indicates the VC-state of that file. The possible returned values of such a check-vc-state-function have to be mapped with ecb-vc-state-mapping to the allowed ECB-VC-state values.

ECB runs for a certain DIRECTORY all identify-backend-functions in that order they are listed in this option. For the first which returns a value unequal nil the associated check-state-function is used to retrieve the VC-state of all sourcefiles in that DIRECTORY.

There is no need for the identify-backend-function or the check-vc-state-function to cache any state because ECB automatically caches internally all necessary informations for directories and files for best possible performance.

To prepend ECB from checking the VC-state for any file set ecb-vc-enable-support to nil.

Default value: Support for CVS, RCS, SCCS, Subversion, Git, Bazaar and Monotone. To identify the VC-backend the functions ecb-vc-dir-managed-by-CVS, ecb-vc-dir-managed-by-RCS rsp. ecb-vc-dir-managed-by-SCCS rsp. ecb-vc-dir-managed-by-SVN rsp. ecb-vc--dir-managed-by-GIT rsp. ecb-vc-dir-managed-by-BZR rsp. ecb-vc-dir-managed-by-MTN are used.

For all six backends the function ecb-vc-state of the VC-package is used by default (which uses a heuristic and therefore faster but less accurate approach), but there is also ecb-vc-recompute-state available which is an alias for vc-recompute-state (which returns accurate state-values by calling the backend which can be slow especialy for remote root-repositories!)

Example: If ecb-vc-recompute-state (to get real state-values not only heuristic ones) should be used to check the state for CVS-managed files and ecb-vc-state for all other backends then an element (ecb-vc-dir-managed-by-CVS . ecb-vc-recompute-state) should be added at the beginning of this option.