Node:Identifying backends, Next:Checking the state, Previous:Version-control support, Up:Version-control support
ECB tries all functions added as identify-backend-funtions to the
option ecb-vc-supported-backends
until one of them returns not
nil
but a symbol which identifies the backend (e.g.
CVS
). After this check ECB stores the result of this check
(i.e. either the identified backend or the fact that the directory is
not managed by a VC-system) for that directory in a special cache, so
the identify-backend-process will be performed only once per
directory. If for a directory a VC-backend could be identified ECB
stores not only the backend itself for that directory but also the
associated check-state-function defined in
ecb-vc-supported-backends
(see Checking the state).
You can add arbitrary functions to this options as long as they get one directory-argument and return either nil or a backend-symbol. Per default ECB offers the following functions to identify the VC-backend CVS, RCS, SCCS or Subversion1:
ecb-vc-dir-managed-by-CVS DIRECTORY
CVS
if DIRECTORY is managed by CVS. nil if not.
This function tries to be as smart as possible: First it checks if
DIRECTORY is managed by CVS by checking if there is a subdir
CVS
. If no then nil is returned. If yes then for GNU Emacs it
takes into account the value of vc-cvs-stay-local
: If t then
just return CVS
. Otherwise ECB checks the root repository if it
is a remote repository. If not just CVS
is returned. If a
remote repository it checks if the value of vc-cvs-stay-local
is a string and matches the host of that repository. If yes then just
CVS
is returned. If not then ECB checks if that host is
currently accessible by performing a ping. If accessible CVS
is
returned otherwise nil. This has the advantage that ECB will not be
blocked by trying to get the state from a remote repository while the
host is not accessible (e.g. because the user works offline).
Special remark for XEmacs: XEmacs has a quite outdated VC-package
which has no option vc-cvs-stay-local
so the user can not work
with remote CVS-repositories if working offline for example. So if
there is no option vc-cvs-stay-local
then ECB performs always
the repository check mentioned above.
ecb-vc-dir-managed-by-RCS DIRECTORY
RCS
if DIRECTORY is managed by RCS. nil if not.
ecb-vc-dir-managed-by-SCCS DIRECTORY
SCCS
if DIRECTORY is managed by SCCS. nil if not.
ecb-vc-dir-managed-by-SVN DIRECTORY
SVN
if DIRECTORY is managed by Subversion. nil if not.
Returns always nil if the library vc-svn.el can not be found.
If ECB should support another VC-backend than CVS, RCS, SCCS or Subversion you have to write your own identify-backend-funtion for the used VC-backend (e.g. Clearcase)!
XEmacs contains only a quite outdated VC-package, especially there is
no backend-independent check-vc-state-function available (like
vc-state
for GNU Emacs). Only for CVS a check-vc-state-function
is available: vc-cvs-status
. Therefore ECB adds per default
only support for CVS and uses ecb-vc-managed-by-CVS
rsp.
vc-cvs-status
. See also Known VC-problems!
For this the most recent version of the VC-package (incl. the library vc-svn.el) is needed - as contained in CVS Emacs