47 |
:group 'pcl-cvs |
:group 'pcl-cvs |
48 |
:type '(boolean)) |
:type '(boolean)) |
49 |
|
|
|
(defvar global-font-lock-mode) |
|
|
(defvar font-lock-auto-fontify) |
|
|
(defcustom cvs-highlight |
|
|
(or (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify) |
|
|
(and (boundp 'global-font-lock-mode) global-font-lock-mode)) |
|
|
"*Whether to use text highlighting (à la font-lock) or not." |
|
|
:group 'pcl-cvs |
|
|
:type '(boolean)) |
|
|
|
|
50 |
(defcustom cvs-allow-dir-commit nil |
(defcustom cvs-allow-dir-commit nil |
51 |
"*Allow `cvs-mode-commit' on directories. |
"*Allow `cvs-mode-commit' on directories. |
52 |
If you commit without any marked file and with the cursor positioned |
If you commit without any marked file and with the cursor positioned |
170 |
;; untouched version resides. |
;; untouched version resides. |
171 |
|
|
172 |
;; The meaning of the type field: |
;; The meaning of the type field: |
173 |
|
|
174 |
;; Value ---Used by--- Explanation |
;; Value ---Used by--- Explanation |
175 |
;; update status |
;; update status |
176 |
;; NEED-UPDATE x file needs update |
;; NEED-UPDATE x file needs update |
235 |
|
|
236 |
;; Predicate: |
;; Predicate: |
237 |
|
|
|
(defun boolp (x) (or (eq t x) (null x))) |
|
238 |
(defun cvs-check-fileinfo (fi) |
(defun cvs-check-fileinfo (fi) |
239 |
"Check FI's conformance to some conventions." |
"Check FI's conformance to some conventions." |
240 |
(let ((check 'none) |
(let ((check 'none) |
246 |
(base-rev (cvs-fileinfo->base-rev fi)) |
(base-rev (cvs-fileinfo->base-rev fi)) |
247 |
(head-rev (cvs-fileinfo->head-rev fi)) |
(head-rev (cvs-fileinfo->head-rev fi)) |
248 |
(full-log (cvs-fileinfo->full-log fi))) |
(full-log (cvs-fileinfo->full-log fi))) |
249 |
(if (and (setq check 'marked) (boolp marked) |
(if (and (setq check 'marked) (memq marked '(t nil)) |
250 |
(setq check 'base-rev) (or (null base-rev) (stringp base-rev)) |
(setq check 'base-rev) (or (null base-rev) (stringp base-rev)) |
251 |
(setq check 'head-rev) (or (null head-rev) (stringp head-rev)) |
(setq check 'head-rev) (or (null head-rev) (stringp head-rev)) |
252 |
(setq check 'full-log) (stringp full-log) |
(setq check 'full-log) (stringp full-log) |
269 |
(error "Invalid :%s in cvs-fileinfo %s" check fi)))) |
(error "Invalid :%s in cvs-fileinfo %s" check fi)))) |
270 |
|
|
271 |
|
|
272 |
;;;; |
;;;; |
273 |
;;;; State table to indicate what you can do when. |
;;;; State table to indicate what you can do when. |
274 |
;;;; |
;;;; |
275 |
|
|
276 |
(defconst cvs-states |
(defconst cvs-states |
277 |
`((NEED-UPDATE update diff) |
`((NEED-UPDATE update diff) |
308 |
(and (not (eq type 'MESSAGE)) |
(and (not (eq type 'MESSAGE)) |
309 |
(eq (car (memq func (cdr (assq type cvs-states)))) func)))) |
(eq (car (memq func (cdr (assq type cvs-states)))) func)))) |
310 |
|
|
311 |
(defun cvs-add-face (str face &optional keymap &rest properties) |
(defun cvs-add-face (str face &optional keymap &rest props) |
312 |
(when (or cvs-highlight properties) |
(when keymap |
313 |
(add-text-properties 0 (length str) |
(when (keymapp keymap) |
314 |
(append |
(setq props (list* 'keymap keymap props))) |
315 |
(when cvs-highlight |
(setq props (list* 'mouse-face 'highlight props))) |
316 |
(list* 'face face |
(add-text-properties 0 (length str) (list* 'font-lock-face face props) str) |
|
(when keymap |
|
|
(list* 'mouse-face 'highlight |
|
|
(when (keymapp keymap) |
|
|
(list 'keymap keymap)))))) |
|
|
properties) |
|
|
str)) |
|
317 |
str) |
str) |
318 |
|
|
319 |
(defun cvs-fileinfo-pp (fileinfo) |
(defun cvs-fileinfo-pp (fileinfo) |
326 |
(case type |
(case type |
327 |
(DIRCHANGE (concat "In directory " |
(DIRCHANGE (concat "In directory " |
328 |
(cvs-add-face (cvs-fileinfo->full-path fileinfo) |
(cvs-add-face (cvs-fileinfo->full-path fileinfo) |
329 |
'cvs-header-face t) |
'cvs-header-face t |
330 |
|
'cvs-goal-column t) |
331 |
":")) |
":")) |
332 |
(MESSAGE |
(MESSAGE |
333 |
(cvs-add-face (format "Message: %s" (cvs-fileinfo->full-log fileinfo)) |
(cvs-add-face (format "Message: %s" (cvs-fileinfo->full-log fileinfo)) |
452 |
((equal date "Result of merge") (setq subtype 'MERGED)) |
((equal date "Result of merge") (setq subtype 'MERGED)) |
453 |
((let ((mtime (nth 5 (file-attributes (concat dir f)))) |
((let ((mtime (nth 5 (file-attributes (concat dir f)))) |
454 |
(system-time-locale "C")) |
(system-time-locale "C")) |
455 |
(equal (setq timestamp (format-time-string "%c" mtime 'utc)) |
(setq timestamp (format-time-string "%c" mtime 'utc)) |
456 |
date)) |
;; Solaris sometimes uses "Wed Sep 05", not "Wed Sep 5". |
457 |
|
;; See "grep '[^a-z_]ctime' cvs/src/*.c" for reference. |
458 |
|
(if (= (aref timestamp 8) ?0) |
459 |
|
(setq timestamp (concat (substring timestamp 0 8) |
460 |
|
" " (substring timestamp 9)))) |
461 |
|
(equal timestamp date)) |
462 |
(setq type (if all 'UP-TO-DATE))) |
(setq type (if all 'UP-TO-DATE))) |
463 |
((equal date (concat "Result of merge+" timestamp)) |
((equal date (concat "Result of merge+" timestamp)) |
464 |
(setq type 'CONFLICT))) |
(setq type 'CONFLICT))) |