]> code.delx.au - gnu-emacs/blobdiff - lisp/pcvs-parse.el
(calc-embedded-close-formula, calc-embedded-open-formula,
[gnu-emacs] / lisp / pcvs-parse.el
index b8dbe815388eaaf6eeeac9dda5c5700ab869c640..66c791db51cb0bdd7b692ceb514dbe4f3e382161 100644 (file)
@@ -1,7 +1,7 @@
 ;;; pcvs-parse.el --- the CVS output parser
 
-;; Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,02,2003
-;;              Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+;;   2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
 ;; Keywords: pcl-cvs
@@ -20,8 +20,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -370,7 +370,7 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
        ;; File you removed still exists.  Ignore (will be noted as removed).
        (cvs-match ".* should be removed and is still there$")
        ;; just a note
-       (cvs-match "use '.+ commit' to \\sw+ th\\sw+ files? permanently$")
+       (cvs-match "use ['`].+ commit' to \\sw+ th\\sw+ files? permanently$")
        ;; [add,status] followed by a more complete status description anyway
        (and (cvs-match "nothing known about \\(.*\\)$" (path 1))
            (cvs-parsed-fileinfo 'DEAD path 'trust))
@@ -457,12 +457,12 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
                 (type (if nofile '(UP-TO-DATE . REMOVED) 'UP-TO-DATE)))
       (cvs-match "File had conflicts on merge$" (type 'MODIFIED))
       (cvs-match ".*[Cc]onflict.*$"    (type 'CONFLICT))
-      (cvs-match "Locally Added$"              (type 'ADDED))
+      (cvs-match "Locally Added$"      (type 'ADDED))
       (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 ".*$"                 (type 'UNKNOWN)))
      (cvs-match "$")
      (cvs-or
       (cvs-match " *Version:[ \t]*\\([0-9.]+\\).*$" (base-rev 1))
@@ -475,12 +475,15 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
       (cvs-match " *Repository revision:[ \t]*\\([0-9.]+\\)[ \t]*\\(.*\\)$"
                 (head-rev 1))
       (cvs-match " *Repository revision:.*"))
+     (cvs-or (cvs-match " *Expansion option:.*") t)  ;Optional CVSNT thingie.
+     (cvs-or (cvs-match " *Commit Identifier:.*") t) ;Optional CVSNT thingie.
      (cvs-or
-      (and;;sometimes those fields are missing
-       (cvs-match " *Sticky Tag:[ \t]*\\(.*\\)$") ; FIXME: use it
-       (cvs-match " *Sticky Date:[ \t]*\\(.*\\)$") ; FIXME: use it
-       (cvs-match " *Sticky Options:[ \t]*\\(.*\\)$")) ; FIXME: use it
+      (and ;; Sometimes those fields are missing.
+       (cvs-match " *Sticky Tag:[ \t]*\\(.*\\)$")      ; FIXME: use it.
+       (cvs-match " *Sticky Date:[ \t]*\\(.*\\)$")     ; FIXME: use it.
+       (cvs-match " *Sticky Options:[ \t]*\\(.*\\)$")) ; FIXME: use it.
       t)
+     (cvs-or (cvs-match " *Merge From:.*") t) ;Optional CVSNT thingie.
      (cvs-match "$")
      ;; ignore the tags-listing in the case of `status -v'
      (cvs-or (cvs-match " *Existing Tags:\n\\(\t.*\n\\)*$") t)
@@ -489,12 +492,14 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
                          :head-rev head-rev))))
 
 (defun cvs-parse-commit ()
-  (let (path base-rev subtype)
+  (let (path file base-rev subtype)
     (cvs-or
 
      (and
-      (cvs-match "\\(Checking in\\|Removing\\) \\(.*\\);$" (path 2))
-      (cvs-match ".*,v  <--  .*$")
+      (cvs-or
+       (cvs-match "\\(Checking in\\|Removing\\) \\(.*\\);$" (path 2))
+       t)
+      (cvs-match ".*,v  <--  \\(.*\\)$" (file 1))
       (cvs-or
        ;; deletion
        (cvs-match "new revision: delete; previous revision: \\([0-9.]*\\)$"
@@ -505,15 +510,20 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
        ;; update
        (cvs-match "new revision: \\([0-9.]*\\); previous revision: .*$"
                  (subtype 'COMMITTED) (base-rev 1)))
-      (cvs-match "done$")
+      (cvs-or (cvs-match "done$") t)
+      ;; In cvs-1.12.9 commit messages have been changed and became
+      ;; ambiguous.  More specifically, the `path' above is not given.
+      ;; We assume here that in future releases the corresponding info will
+      ;; be put into `file'.
       (progn
        ;; Try to remove the temp files used by VC.
-       (vc-delete-automatic-version-backups (expand-file-name path))
+       (vc-delete-automatic-version-backups (expand-file-name (or path file)))
        ;; it's important here not to rely on the default directory management
        ;; because `cvs commit' might begin by a series of Examining messages
        ;; so the processing of the actual checkin messages might begin with
        ;; a `current-dir' set to something different from ""
-       (cvs-parsed-fileinfo (cons 'UP-TO-DATE subtype) path 'trust
+       (cvs-parsed-fileinfo (cons 'UP-TO-DATE subtype)
+                            (or path file) 'trust
                             :base-rev base-rev)))
 
      ;; useless message added before the actual addition: ignored
@@ -522,4 +532,5 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
 
 (provide 'pcvs-parse)
 
+;; arch-tag: 35418375-1a23-40a0-957d-96b0262f91d6
 ;;; pcvs-parse.el ends here