;;; pcvs-parse.el --- the CVS output parser
-;; Copyright (C) 1991-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1991-2016 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: pcl-cvs
;;; Code:
-(eval-when-compile (require 'cl))
-
(require 'pcvs-util)
(require 'pcvs-info)
then assign the variables as specified in MATCHES (via `setq')."
(cons 'cvs-do-match
(cons re (mapcar (lambda (match)
- `(cons ',(first match) ,(second match)))
+ `(cons ',(car match) ,(cadr match)))
matches))))
(defun cvs-do-match (re &rest matches)
(cvs-or
(funcall parse-spec)
- (dolist (re cvs-parse-ignored-messages)
- (when (cvs-match re) (return t)))
+ (cl-dolist (re cvs-parse-ignored-messages)
+ (when (cvs-match re) (cl-return t)))
;; This is a parse error. Create a message-type fileinfo.
(and
TYPE can either be a type symbol or a cons of the form (TYPE . SUBTYPE).
PATH is the filename.
DIRECTORY influences the way PATH is interpreted:
-- if it's a string, it denotes the directory in which PATH (which should then be
+- if a string, it denotes the directory in which PATH (which should then be
a plain file name with no directory component) resides.
- if it's nil, the PATH should not be trusted: if it has a directory
component, use it, else, assume it is relative to the current directory.
-- else, the PATH should be trusted to be relative to the root
- directory (i.e. if there is no directory component, it means the file
- is inside the main directory).
+- else, the PATH should be trusted to be relative to the root directory
+ (i.e. if there is no directory component, it means the file is inside
+ the main directory).
The remaining KEYS are passed directly to `cvs-create-fileinfo'."
(let ((dir directory)
(file path))
;; ?: Unknown file.
(let ((code (aref c 0)))
(cvs-parsed-fileinfo
- (case code
+ (pcase code
(?M 'MODIFIED)
(?A 'ADDED)
(?R 'REMOVED)
(if (re-search-forward "^<<<<<<< " nil t)
'CONFLICT 'NEED-MERGE))))
(?J 'NEED-MERGE) ;not supported by standard CVS
- ((?U ?P)
+ ((or ?U ?P)
(if dont-change-disc 'NEED-UPDATE
(cons 'UP-TO-DATE (if (eq code ?U) 'UPDATED 'PATCHED)))))
path 'trust)))
(cvs-match "restoring \\(.*\\) from backup file .*$" (path 1))))
t)
- ;; Is it a succesful merge?
+ ;; Is it a successful merge?
;; Figure out result of merging (ie, was there a conflict?)
(let ((qfile (regexp-quote path)))
(cvs-or
;; Conflict
(and
(cvs-match (concat "C \\(.*" qfile "\\)$") (path 1) (type 'CONFLICT))
- ;; C might be followed by a "suprious" U for non-mergeable files
+ ;; C might be followed by a "spurious" U for non-mergable files
(cvs-or (cvs-match (concat "U \\(.*" qfile "\\)$")) t))
;; Successful merge
(cvs-match (concat "M \\(.*" qfile "\\)$") (path 1))