From 1a0cf619dbaf78fa268c89ae5916a62bbe3d1212 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Mon, 6 Oct 2008 05:30:25 +0000 Subject: [PATCH] (vc-cvs-after-dir-status): Parse the output for non existent files. --- lisp/ChangeLog | 5 +++++ lisp/vc-cvs.el | 24 +++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 054e0859f4e..a06b1120471 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-10-06 Dan Nicolaescu + + * vc-cvs.el (vc-cvs-after-dir-status): Parse the output for non + existent files. + 2008-10-05 Chong Yidong * international/mule-cmds.el (universal-coding-system-argument): diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index 303e6d63e3c..4913a23440d 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el @@ -830,13 +830,14 @@ state." (file nil) (result nil) (missing nil) + (ignore-next nil) (subdir default-directory)) (goto-char (point-min)) (while ;; Look for either a file entry, an unregistered file, or a ;; directory change. (re-search-forward - "\\(^=+\n\\([^=c?\n].*\n\\|\n\\)+\\)\\|\\(\\(^?? .*\n\\)+\\)\\|\\(^cvs status: Examining .*\n\\)" + "\\(^=+\n\\([^=c?\n].*\n\\|\n\\)+\\)\\|\\(\\(^?? .*\n\\)+\\)\\|\\(^cvs status: \\(Examining\\|nothing\\) .*\n\\)" nil t) ;; FIXME: get rid of narrowing here. (narrow-to-region (match-beginning 0) (match-end 0)) @@ -850,6 +851,21 @@ state." (expand-file-name (match-string 1) subdir))) (push (list file 'unregistered) result) (forward-line 1)) + (when (looking-at "cvs status: nothing known about") + ;; We asked about a non existent file. The output looks like this: + + ;; cvs status: nothing known about `lisp/v.diff' + ;; =================================================================== + ;; File: no file v.diff Status: Unknown + ;; + ;; Working revision: No entry for v.diff + ;; Repository revision: No revision control file + ;; + + ;; Due to narrowing in this iteration we only see the "cvs + ;; status:" line, so just set a flag so that we can ignore the + ;; file in the next iteration. + (setq ignore-next t)) ;; A file entry. (when (re-search-forward "^File: \\(no file \\)?\\(.*[^ \t]\\)[ \t]+Status: \\(.*\\)" nil t) (setq missing (match-string 1)) @@ -868,8 +884,10 @@ state." ((string-match "File had conflicts " status-str) 'conflict) ((string-match "Unknown" status-str) 'unregistered) (t 'edited))) - (unless (eq status 'up-to-date) - (push (list file status) result))) + (if ignore-next + (setq ignore-next nil) + (unless (eq status 'up-to-date) + (push (list file status) result)))) (goto-char (point-max)) (widen)) (funcall update-function result)) -- 2.39.5