From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Masanobu UMEDA Newsgroups: gmane.emacs.devel Subject: Update: vc-cvs-dir-state Date: Mon, 17 Feb 2003 00:22:23 +0900 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200302161522.AAA05849@latour.mse.kyutech.ac.jp> Reply-To: umerin@mse.kyutech.ac.jp NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP-2 X-Trace: main.gmane.org 1045408926 10639 80.91.224.249 (16 Feb 2003 15:22:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 16 Feb 2003 15:22:06 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18kQcF-0002lP-00 for ; Sun, 16 Feb 2003 16:22:03 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18kQqD-0005lE-00 for ; Sun, 16 Feb 2003 16:36:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18kQe3-0004tG-01 for emacs-devel@quimby.gnus.org; Sun, 16 Feb 2003 10:23:55 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18kQdl-0004np-00 for emacs-devel@gnu.org; Sun, 16 Feb 2003 10:23:37 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18kQdj-0004hi-00 for emacs-devel@gnu.org; Sun, 16 Feb 2003 10:23:36 -0500 Original-Received: from latour.mse.kyutech.ac.jp ([131.206.67.77]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18kQdi-0002sf-00 for emacs-devel@gnu.org; Sun, 16 Feb 2003 10:23:35 -0500 Original-Received: (from umerin@localhost) by latour.mse.kyutech.ac.jp (8.9.3+3.2W/3.7W) id AAA05849; Mon, 17 Feb 2003 00:22:23 +0900 Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:11684 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11684 Dear vc-cvs.el maintainer, It is sometimes useful to have unregistered subdirectories in a directory which is under the control of CVS. However, current implementation of vc-cvs-dir-state in vc-cvs.el (of Emacs 21.2) does not work if a directory contains unregistered subdirectories. Here is more useful implementation of vc-cvs-dir-state. It checks if a given subdirectory is under the control of CVS or not. By using this, vc-directory never get fails even if a directory contains unregistered subdirectories. Masanobu UMEDA ---------------------------------------------------------------------- (defun vc-cvs-dir-state (dir) "Find the CVS state of all files in DIR." ;; Get the state only if DIR is under the control of CVS. (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)))))))