]> code.delx.au - gnu-emacs/blobdiff - lisp/pcvs-info.el
(gdb-flush-pending-output): New variable.
[gnu-emacs] / lisp / pcvs-info.el
index 422063e298468020fed2bdd1032b5f684288c9bb..77e165b2462145e0de40da5d7e875f4cdee4c6f5 100644 (file)
@@ -1,10 +1,10 @@
 ;;; pcvs-info.el --- internal representation of a fileinfo entry
 
-;; Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000  Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+;;   2000, 2004  Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
 ;; Keywords: pcl-cvs
-;; Revision: $Id: pcvs-info.el,v 1.10 2002/06/15 19:04:57 walters Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -130,7 +130,7 @@ to confuse some users sometimes."
   "The prefix that CVS prepends to files when rcsmerge'ing.")
 
 (easy-mmode-defmap cvs-status-map
-  '(([(mouse-2)] . cvs-mouse-toggle-mark))
+  '(([(mouse-2)] . cvs-mode-toggle-mark))
   "Local keymap for text properties of status")
 
 ;; Constructor:
@@ -170,7 +170,7 @@ to confuse some users sometimes."
                 ;; untouched version resides.
 
   ;; The meaning of the type field:
-  
+
   ;; Value           ---Used by---     Explanation
   ;;                 update status
   ;; NEED-UPDATE               x       file needs update
@@ -220,8 +220,8 @@ to confuse some users sometimes."
         (file (cvs-fileinfo->file fileinfo))
         (default-directory (file-name-as-directory (expand-file-name dir)))
         (files (directory-files "." nil
-                                (concat "^" (regexp-quote cvs-bakprefix)
-                                        (regexp-quote file) "\\.")))
+                                (concat "\\`" (regexp-quote cvs-bakprefix)
+                                        (regexp-quote file) "\\(\\.[0-9]+\\.[0-9]+\\)+\\'")))
         bf)
     (dolist (f files bf)
       (when (and (file-readable-p f)
@@ -235,7 +235,6 @@ to confuse some users sometimes."
 \f
 ;; Predicate:
 
-(defun boolp (x) (or (eq t x) (null x)))
 (defun cvs-check-fileinfo (fi)
   "Check FI's conformance to some conventions."
   (let ((check 'none)
@@ -247,7 +246,7 @@ to confuse some users sometimes."
        (base-rev (cvs-fileinfo->base-rev fi))
        (head-rev (cvs-fileinfo->head-rev fi))
        (full-log (cvs-fileinfo->full-log fi)))
-    (if (and (setq check 'marked)      (boolp marked)
+    (if (and (setq check 'marked)      (memq marked '(t nil))
             (setq check 'base-rev)     (or (null base-rev) (stringp base-rev))
             (setq check 'head-rev)     (or (null head-rev) (stringp head-rev))
             (setq check 'full-log)     (stringp full-log)
@@ -270,12 +269,12 @@ to confuse some users sometimes."
       (error "Invalid :%s in cvs-fileinfo %s" check fi))))
 
 \f
-;;;; 
+;;;;
 ;;;; State table to indicate what you can do when.
-;;;; 
+;;;;
 
 (defconst cvs-states
-  `((NEED-UPDATE       update diff)
+  `((NEED-UPDATE       update diff ignore)
     (UP-TO-DATE                update nil remove diff safe-rm revert)
     (MODIFIED          update commit undo remove diff merge diff-base)
     (ADDED             update commit remove)
@@ -310,13 +309,11 @@ FI-OR-TYPE can either be a symbol (a fileinfo-type) or a fileinfo."
         (eq (car (memq func (cdr (assq type cvs-states)))) func))))
 
 (defun cvs-add-face (str face &optional keymap &rest props)
-  (when cvs-highlight
-    (when keymap
-      (when (keymapp keymap)
-       (setq props (list* 'keymap keymap props)))
-      (setq props (list* 'mouse-face 'highlight props)))
-    (setq props (list* 'font-lock-face face props)))
-  (when props (add-text-properties 0 (length str) props str))
+  (when keymap
+    (when (keymapp keymap)
+      (setq props (list* 'keymap keymap props)))
+    (setq props (list* 'mouse-face 'highlight props)))
+  (add-text-properties 0 (length str) (list* 'font-lock-face face props) str)
   str)
 
 (defun cvs-fileinfo-pp (fileinfo)
@@ -455,8 +452,13 @@ DIR can also be a file."
               ((equal date "Result of merge") (setq subtype 'MERGED))
               ((let ((mtime (nth 5 (file-attributes (concat dir f))))
                      (system-time-locale "C"))
-                 (equal (setq timestamp (format-time-string "%c" mtime 'utc))
-                        date))
+                 (setq timestamp (format-time-string "%c" mtime 'utc))
+                 ;; Solaris sometimes uses "Wed Sep 05", not "Wed Sep  5".
+                 ;; See "grep '[^a-z_]ctime' cvs/src/*.c" for reference.
+                 (if (= (aref timestamp 8) ?0)
+                     (setq timestamp (concat (substring timestamp 0 8)
+                                             " " (substring timestamp 9))))
+                 (equal timestamp date))
                (setq type (if all 'UP-TO-DATE)))
               ((equal date (concat "Result of merge+" timestamp))
                (setq type 'CONFLICT)))
@@ -469,4 +471,5 @@ DIR can also be a file."
 
 (provide 'pcvs-info)
 
+;; arch-tag: d85dde07-bdc2-400a-882f-92f398c7b0ba
 ;;; pcvs-info.el ends here