Function: vc-cvs-repository-hostname

vc-cvs-repository-hostname is a byte-compiled function defined in vc-cvs.el.gz.

Signature

(vc-cvs-repository-hostname DIRNAME)

Documentation

Hostname of the CVS server associated to workarea DIRNAME.

Return nil if there is no hostname, or the hostname could not be determined because the CVS/Root specification is invalid.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-cvs.el.gz
(defun vc-cvs-repository-hostname (dirname)
  "Hostname of the CVS server associated to workarea DIRNAME.

Return nil if there is no hostname, or the hostname could not be
determined because the CVS/Root specification is invalid."
  (let ((rootname (expand-file-name "CVS/Root" dirname)))
    (when (file-readable-p rootname)
      (with-temp-buffer
	(let ((coding-system-for-read
	       (or file-name-coding-system
		   default-file-name-coding-system)))
	  (vc-insert-file rootname))
	(goto-char (point-min))
        (let ((hostname
	       (nth 2 (vc-cvs-parse-root
		       (buffer-substring (point)
                                         (line-end-position))))))
          (unless (string= hostname "")
            hostname))))))