diff options
author | André Spiegel <spiegel@gnu.org> | 2003-02-17 08:11:13 +0000 |
---|---|---|
committer | André Spiegel <spiegel@gnu.org> | 2003-02-17 08:11:13 +0000 |
commit | 4b180a76d247d1ee3e5534b8ea3fe0f572937b96 (patch) | |
tree | 0509c2f9b7d544e13b6bcce19317e8a274bbc215 /lisp/vc-cvs.el | |
parent | f1b1a9f2b42889756f5dd2f87690c6f1410ebd2e (diff) | |
download | emacs-4b180a76d247d1ee3e5534b8ea3fe0f572937b96.tar.gz |
(vc-cvs-dir-state): Protect against DIR not being under CVS control.
Diffstat (limited to 'lisp/vc-cvs.el')
-rw-r--r-- | lisp/vc-cvs.el | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index 5da3e5a092a..c6f3c2b2f55 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el @@ -5,7 +5,7 @@ ;; Author: FSF (see vc.el for full credits) ;; Maintainer: Andre Spiegel <spiegel@gnu.org> -;; $Id: vc-cvs.el,v 1.49 2002/10/17 15:43:48 lektu Exp $ +;; $Id: vc-cvs.el,v 1.50 2002/12/26 14:05:48 spiegel Exp $ ;; This file is part of GNU Emacs. @@ -207,19 +207,21 @@ See also variable `vc-cvs-sticky-date-format-string'." (defun vc-cvs-dir-state (dir) "Find the CVS state of all files in DIR." - (if (vc-cvs-stay-local-p dir) - (vc-cvs-dir-state-heuristic dir) - (let ((default-directory dir)) - ;; Don't specify DIR in this command, the default-directory is - ;; enough. Otherwise it might fail with remote repositories. - (with-temp-buffer - (vc-cvs-command t 0 nil "status" "-l") - (goto-char (point-min)) - (while (re-search-forward "^=+\n\\([^=\n].*\n\\|\n\\)+" nil t) - (narrow-to-region (match-beginning 0) (match-end 0)) - (vc-cvs-parse-status) - (goto-char (point-max)) - (widen)))))) + ;; if DIR is not under CVS control, don't do anything + (if (file-readable-p (expand-file-name "CVS/Entries" dir)) + (if (vc-cvs-stay-local-p dir) + (vc-cvs-dir-state-heuristic dir) + (let ((default-directory dir)) + ;; Don't specify DIR in this command, the default-directory is + ;; enough. Otherwise it might fail with remote repositories. + (with-temp-buffer + (vc-do-command t 0 "cvs" nil "status" "-l") + (goto-char (point-min)) + (while (re-search-forward "^=+\n\\([^=\n].*\n\\|\n\\)+" nil t) + (narrow-to-region (match-beginning 0) (match-end 0)) + (vc-cvs-parse-status) + (goto-char (point-max)) + (widen))))))) (defun vc-cvs-workfile-version (file) "CVS-specific version of `vc-workfile-version'." |