]> code.delx.au - gnu-emacs/blobdiff - lisp/pcvs-parse.el
*** empty log message ***
[gnu-emacs] / lisp / pcvs-parse.el
index 607a6fa6f067cc5ed8c3a53224b50e16e404dceb..b8dbe815388eaaf6eeeac9dda5c5700ab869c640 100644 (file)
@@ -1,11 +1,10 @@
 ;;; pcvs-parse.el --- the CVS output parser
 
-;; Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,2002
+;; Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,02,2003
 ;;              Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
 ;; Keywords: pcl-cvs
-;; Revision: $Id: pcvs-parse.el,v 1.11 2002/03/17 20:48:14 monnier Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -200,9 +199,9 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
 
 (defun cvs-parse-table ()
   "Table of message objects for `cvs-parse-process'."
-  (let (c file dir path type base-rev subtype)
+  (let (c file dir path base-rev subtype)
     (cvs-or
-     
+
      (cvs-parse-status)
      (cvs-parse-merge)
      (cvs-parse-commit)
@@ -211,7 +210,7 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
      ;; such duplicate info and luckily the second info is the one we want.
      ;; (and (cvs-match "M \\(.*\\)$" (path 1))
      ;;      (cvs-parse-merge path))
-     
+
      ;; Normal file state indicator.
      (and
       (cvs-match "\\([MARCUPNJ?]\\) \\(.*\\)$" (c 1) (path 2))
@@ -266,14 +265,29 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
        ;; [-n update] A new (or pruned) directory appeared but isn't traversed
        (and
        (cvs-match "New directory `\\(.*\\)' -- ignored$" (dir 1))
-       (cvs-parsed-fileinfo 'MESSAGE " " (file-name-as-directory dir)))
+       ;; (cvs-parsed-fileinfo 'MESSAGE " " (file-name-as-directory dir))
+       ;; These messages either correspond to a true new directory
+       ;; that an update will bring in, or to a directory that's empty
+       ;; on the current branch (either because it only exists in other
+       ;; branches, or because it's been removed).
+       (if (ignore-errors
+             (with-current-buffer
+                 (find-file-noselect (expand-file-name
+                                      ".cvsignore" (file-name-directory dir)))
+               (goto-char (point-min))
+               (re-search-forward
+                (concat "^" (regexp-quote (file-name-nondirectory dir)) "/$")
+                nil t)))
+           t                  ;The user requested to ignore those messages.
+         (cvs-parsed-fileinfo '(NEED-UPDATE . NEW-DIR) dir t)))
 
        ;; File removed, since it is removed (by third party) in repository.
        (and
        (cvs-or
         (cvs-match "warning: \\(.*\\) is not (any longer) pertinent$" (file 1))
         (cvs-match "\\(.*\\) is no longer in the repository$" (file 1)))
-       (cvs-parsed-fileinfo 'DEAD file))
+       (cvs-parsed-fileinfo
+        (if dont-change-disc '(NEED-UPDATE . REMOVED) 'DEAD) file))
 
        ;; [add]
        (and
@@ -286,6 +300,9 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
        (and
        (cvs-match "\\(.*\\), version \\(.*\\), resurrected$"
                   (path 1) (base-rev 2))
+       ;; FIXME: resurrection only brings back the original version,
+       ;; not the latest on the branch, so `up-to-date' is not always
+       ;; what we want.
        (cvs-parsed-fileinfo '(UP-TO-DATE . RESURRECTED) path nil
                             :base-rev base-rev))
 
@@ -307,7 +324,7 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
                                 'MISSING
                               '(UP-TO-DATE . UPDATED))
                             path))
-     
+
        ;; Mode conflicts (rather than contents)
        (and
        (cvs-match "conflict: ")
@@ -329,7 +346,7 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
         (cvs-match "sticky tag .* for file `\\(.*\\)' is not a branch$"
                    (file 1)))
        (cvs-parsed-fileinfo 'MESSAGE file))
-     
+
        ;; File unknown.
        (and (cvs-match "use `.+ add' to create an entry for \\(.*\\)$" (path 1))
            (cvs-parsed-fileinfo 'UNKNOWN path))
@@ -347,7 +364,7 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
             'MESSAGE "" " "
             "*** Add (setq cvs-execute-single-dir t) to your .emacs ***
        See the FAQ file or the variable's documentation for more info."))
-       
+
        ;; Cvs waits for a lock.  Ignored: already handled by the process filter
        (cvs-match "\\[..:..:..\\] \\(waiting for\\|obtained\\) .*lock in .*$")
        ;; File you removed still exists.  Ignore (will be noted as removed).
@@ -364,7 +381,7 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
        (cvs-match "Rebuilding administrative file database$")
        ;; ???
        (cvs-match "--> Using per-directory sticky tag `.*'")
-     
+
        ;; CVS is running a *info program.
        (and
        (cvs-match "Executing.*$")
@@ -376,14 +393,14 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
      (and
       (cvs-match "cvs[.ex]* \\[[a-z]+ aborted\\]:.*$")
       (cvs-parsed-fileinfo 'MESSAGE ""))
-     
+
      ;; sadly you can't do much with these since the path is in the repository
      (cvs-match "Directory .* added to the repository$")
      )))
 
 
 (defun cvs-parse-merge ()
-  (let (path base-rev head-rev handled type)
+  (let (path base-rev head-rev type)
     ;; A merge (maybe with a conflict).
     (and
      (cvs-match "RCS file: .*$")
@@ -444,6 +461,7 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
       (cvs-match "Locally Removed$"    (type 'REMOVED))
       (cvs-match "Locally Modified$"   (type 'MODIFIED))
       (cvs-match "Needs Merge$"                (type 'NEED-MERGE))
+      (cvs-match "Entry Invalid"       (type '(NEED-MERGE . REMOVED)))
       (cvs-match "Unknown$"            (type 'UNKNOWN)))
      (cvs-match "$")
      (cvs-or
@@ -497,7 +515,7 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
        ;; a `current-dir' set to something different from ""
        (cvs-parsed-fileinfo (cons 'UP-TO-DATE subtype) path 'trust
                             :base-rev base-rev)))
-     
+
      ;; useless message added before the actual addition: ignored
      (cvs-match "RCS file: .*\ndone$"))))