diff options
| author | André Spiegel | 2003-02-17 08:11:13 +0000 |
|---|---|---|
| committer | André Spiegel | 2003-02-17 08:11:13 +0000 |
| commit | 4b180a76d247d1ee3e5534b8ea3fe0f572937b96 (patch) | |
| tree | 0509c2f9b7d544e13b6bcce19317e8a274bbc215 | |
| parent | f1b1a9f2b42889756f5dd2f87690c6f1410ebd2e (diff) | |
| download | emacs-4b180a76d247d1ee3e5534b8ea3fe0f572937b96.tar.gz emacs-4b180a76d247d1ee3e5534b8ea3fe0f572937b96.zip | |
(vc-cvs-dir-state): Protect against DIR not being under CVS control.
| -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 @@ | |||
| 5 | ;; Author: FSF (see vc.el for full credits) | 5 | ;; Author: FSF (see vc.el for full credits) |
| 6 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> | 6 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
| 7 | 7 | ||
| 8 | ;; $Id: vc-cvs.el,v 1.49 2002/10/17 15:43:48 lektu Exp $ | 8 | ;; $Id: vc-cvs.el,v 1.50 2002/12/26 14:05:48 spiegel Exp $ |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| @@ -207,19 +207,21 @@ See also variable `vc-cvs-sticky-date-format-string'." | |||
| 207 | 207 | ||
| 208 | (defun vc-cvs-dir-state (dir) | 208 | (defun vc-cvs-dir-state (dir) |
| 209 | "Find the CVS state of all files in DIR." | 209 | "Find the CVS state of all files in DIR." |
| 210 | (if (vc-cvs-stay-local-p dir) | 210 | ;; if DIR is not under CVS control, don't do anything |
| 211 | (vc-cvs-dir-state-heuristic dir) | 211 | (if (file-readable-p (expand-file-name "CVS/Entries" dir)) |
| 212 | (let ((default-directory dir)) | 212 | (if (vc-cvs-stay-local-p dir) |
| 213 | ;; Don't specify DIR in this command, the default-directory is | 213 | (vc-cvs-dir-state-heuristic dir) |
| 214 | ;; enough. Otherwise it might fail with remote repositories. | 214 | (let ((default-directory dir)) |
| 215 | (with-temp-buffer | 215 | ;; Don't specify DIR in this command, the default-directory is |
| 216 | (vc-cvs-command t 0 nil "status" "-l") | 216 | ;; enough. Otherwise it might fail with remote repositories. |
| 217 | (goto-char (point-min)) | 217 | (with-temp-buffer |
| 218 | (while (re-search-forward "^=+\n\\([^=\n].*\n\\|\n\\)+" nil t) | 218 | (vc-do-command t 0 "cvs" nil "status" "-l") |
| 219 | (narrow-to-region (match-beginning 0) (match-end 0)) | 219 | (goto-char (point-min)) |
| 220 | (vc-cvs-parse-status) | 220 | (while (re-search-forward "^=+\n\\([^=\n].*\n\\|\n\\)+" nil t) |
| 221 | (goto-char (point-max)) | 221 | (narrow-to-region (match-beginning 0) (match-end 0)) |
| 222 | (widen)))))) | 222 | (vc-cvs-parse-status) |
| 223 | (goto-char (point-max)) | ||
| 224 | (widen))))))) | ||
| 223 | 225 | ||
| 224 | (defun vc-cvs-workfile-version (file) | 226 | (defun vc-cvs-workfile-version (file) |
| 225 | "CVS-specific version of `vc-workfile-version'." | 227 | "CVS-specific version of `vc-workfile-version'." |