bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date"


From: Dan Nicolaescu
Subject: bug#737: vc-dir reports unregistered-then-deleted file is "up-to-date"
Date: Sun, 5 Oct 2008 08:40:11 -0700 (PDT)

Glenn Morris <rgm@gnu.org> writes:

  > Glenn Morris wrote (on Sat, 4 Oct 2008 at 21:45 -0400):
  > 
  > > Whoops, I have local changes that may be affecting this. I will rebuild
  > > without them...
  > 
  > I am still seeing this problem with CVS.

Hmm, OK, I was testing with files several directories deep, and indeed
they disappear from that directory, but they just get moved to the top
directory.  Oops.

This patch vs vc-cvs.el 1.149 seems to fix it (sorry, I don't have time
to deal with the stay-local breakage).

--- vc-cvs.el.~1.149~   2008-10-04 18:52:44.000000000 -0700
+++ vc-cvs.el   2008-10-05 08:37:30.000000000 -0700
@@ -832,13 +832,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))
@@ -852,6 +853,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))
@@ -870,8 +886,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))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]