;; 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.
;; untouched version resides.
;; The meaning of the type field:
-
+
;; Value ---Used by--- Explanation
;; update status
;; NEED-UPDATE x file needs update
\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)
(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)
(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)
(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)
((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)))
(provide 'pcvs-info)
+;;; arch-tag: d85dde07-bdc2-400a-882f-92f398c7b0ba
;;; pcvs-info.el ends here