comparison lisp/pcvs-info.el @ 61866:37400c7baa6c

Rename "full-path" -> "full-name". (cvs-fileinfo->full-path, cvs-display-full-path): New fun and var, to preserve compatibility. (cvs-fileinfo->backup-file): Don't pass the full file name to file-newer-than-file-p.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 26 Apr 2005 20:35:42 +0000
parents 31aa9a390538
children 24689001fa22 08185296b491
comparison
equal deleted inserted replaced
61865:d2d61028720d 61866:37400c7baa6c
39 39
40 ;;;; 40 ;;;;
41 ;;;; config variables 41 ;;;; config variables
42 ;;;; 42 ;;;;
43 43
44 (defcustom cvs-display-full-path t 44 (defcustom cvs-display-full-name t
45 "*Specifies how the filenames should look like in the listing. 45 "*Specifies how the filenames should be displayed in the listing.
46 If t, their full path name will be displayed, else only the filename." 46 If non-nil, their full filename name will be displayed, else only the
47 non-directory part."
47 :group 'pcl-cvs 48 :group 'pcl-cvs
48 :type '(boolean)) 49 :type '(boolean))
50 (define-obsolete-variable-alias 'cvs-display-full-path 'cvs-display-full-name)
49 51
50 (defcustom cvs-allow-dir-commit nil 52 (defcustom cvs-allow-dir-commit nil
51 "*Allow `cvs-mode-commit' on directories. 53 "*Allow `cvs-mode-commit' on directories.
52 If you commit without any marked file and with the cursor positioned 54 If you commit without any marked file and with the cursor positioned
53 on a directory entry, cvs would commit the whole directory. This seems 55 on a directory entry, cvs would commit the whole directory. This seems
163 ;;mod-time ;; Not used. 165 ;;mod-time ;; Not used.
164 166
165 ;; In addition to the above, the following values can be extracted: 167 ;; In addition to the above, the following values can be extracted:
166 168
167 ;; handled ;; t if this file doesn't require further action. 169 ;; handled ;; t if this file doesn't require further action.
168 ;; full-path ;; The complete relative filename. 170 ;; full-name ;; The complete relative filename.
169 ;; pp-name ;; The printed file name 171 ;; pp-name ;; The printed file name
170 ;; backup-file;; For MERGED and CONFLICT files after a \"cvs update\", 172 ;; backup-file;; For MERGED and CONFLICT files after a \"cvs update\",
171 ;; this is a full path to the backup file where the 173 ;; this is a full path to the backup file where the
172 ;; untouched version resides. 174 ;; untouched version resides.
173 175
199 (defun cvs-create-fileinfo (type dir file msg &rest keys) 201 (defun cvs-create-fileinfo (type dir file msg &rest keys)
200 (cvs-check-fileinfo (apply #'-cvs-create-fileinfo type dir file msg keys))) 202 (cvs-check-fileinfo (apply #'-cvs-create-fileinfo type dir file msg keys)))
201 203
202 ;; Fake selectors: 204 ;; Fake selectors:
203 205
204 (defun cvs-fileinfo->full-path (fileinfo) 206 (defun cvs-fileinfo->full-name (fileinfo)
205 "Return the full path for the file that is described in FILEINFO." 207 "Return the full path for the file that is described in FILEINFO."
206 (let ((dir (cvs-fileinfo->dir fileinfo))) 208 (let ((dir (cvs-fileinfo->dir fileinfo)))
207 (if (eq (cvs-fileinfo->type fileinfo) 'DIRCHANGE) 209 (if (eq (cvs-fileinfo->type fileinfo) 'DIRCHANGE)
208 (if (string= dir "") "." (directory-file-name dir)) 210 (if (string= dir "") "." (directory-file-name dir))
209 ;; Here, I use `concat' rather than `expand-file-name' because I want 211 ;; Here, I use `concat' rather than `expand-file-name' because I want
210 ;; the resulting path to stay relative if `dir' is relative. 212 ;; the resulting path to stay relative if `dir' is relative.
211 (concat dir (cvs-fileinfo->file fileinfo))))) 213 (concat dir (cvs-fileinfo->file fileinfo)))))
214 (define-obsolete-function-alias 'cvs-fileinfo->full-path 'cvs-fileinfo->full-name)
212 215
213 (defun cvs-fileinfo->pp-name (fi) 216 (defun cvs-fileinfo->pp-name (fi)
214 "Return the filename of FI as it should be displayed." 217 "Return the filename of FI as it should be displayed."
215 (if cvs-display-full-path 218 (if cvs-display-full-name
216 (cvs-fileinfo->full-path fi) 219 (cvs-fileinfo->full-name fi)
217 (cvs-fileinfo->file fi))) 220 (cvs-fileinfo->file fi)))
218 221
219 (defun cvs-fileinfo->backup-file (fileinfo) 222 (defun cvs-fileinfo->backup-file (fileinfo)
220 "Construct the file name of the backup file for FILEINFO." 223 "Construct the file name of the backup file for FILEINFO."
221 (let* ((dir (cvs-fileinfo->dir fileinfo)) 224 (let* ((dir (cvs-fileinfo->dir fileinfo))
223 (default-directory (file-name-as-directory (expand-file-name dir))) 226 (default-directory (file-name-as-directory (expand-file-name dir)))
224 (files (directory-files "." nil 227 (files (directory-files "." nil
225 (concat "\\`" (regexp-quote cvs-bakprefix) 228 (concat "\\`" (regexp-quote cvs-bakprefix)
226 (regexp-quote file) "\\(\\.[0-9]+\\.[0-9]+\\)+\\'"))) 229 (regexp-quote file) "\\(\\.[0-9]+\\.[0-9]+\\)+\\'")))
227 bf) 230 bf)
228 (dolist (f files bf) 231 (dolist (f files)
229 (when (and (file-readable-p f) 232 (when (and (file-readable-p f)
230 (or (null bf) (file-newer-than-file-p f bf))) 233 (or (null bf) (file-newer-than-file-p f bf)))
231 (setq bf (concat dir f)))))) 234 (setq bf f)))
235 (concat dir bf)))
232 236
233 ;; (defun cvs-fileinfo->handled (fileinfo) 237 ;; (defun cvs-fileinfo->handled (fileinfo)
234 ;; "Tell if this requires further action" 238 ;; "Tell if this requires further action"
235 ;; (memq (cvs-fileinfo->type fileinfo) '(UP-TO-DATE DEAD))) 239 ;; (memq (cvs-fileinfo->type fileinfo) '(UP-TO-DATE DEAD)))
236 240
325 (let ((type (cvs-fileinfo->type fileinfo)) 329 (let ((type (cvs-fileinfo->type fileinfo))
326 (subtype (cvs-fileinfo->subtype fileinfo))) 330 (subtype (cvs-fileinfo->subtype fileinfo)))
327 (insert 331 (insert
328 (case type 332 (case type
329 (DIRCHANGE (concat "In directory " 333 (DIRCHANGE (concat "In directory "
330 (cvs-add-face (cvs-fileinfo->full-path fileinfo) 334 (cvs-add-face (cvs-fileinfo->full-name fileinfo)
331 'cvs-header-face t 335 'cvs-header-face t
332 'cvs-goal-column t) 336 'cvs-goal-column t)
333 ":")) 337 ":"))
334 (MESSAGE 338 (MESSAGE
335 (cvs-add-face (format "Message: %s" (cvs-fileinfo->full-log fileinfo)) 339 (cvs-add-face (format "Message: %s" (cvs-fileinfo->full-log fileinfo))