(defvar vc-ignore-vc-files nil)
(make-obsolete-variable 'vc-ignore-vc-files
- "set `vc-handled-backends' to nil to disable VC.")
+ "set `vc-handled-backends' to nil to disable VC."
+ "21.1")
(defvar vc-master-templates ())
(make-obsolete-variable 'vc-master-templates
"to define master templates for a given BACKEND, use
vc-BACKEND-master-templates. To enable or disable VC for a given
-BACKEND, use `vc-handled-backends'.")
+BACKEND, use `vc-handled-backends'."
+ "21.1")
(defvar vc-header-alist ())
-(make-obsolete-variable 'vc-header-alist 'vc-BACKEND-header)
+(make-obsolete-variable 'vc-header-alist 'vc-BACKEND-header "21.1")
(defcustom vc-ignore-dir-regexp
;; Stop SMB, automounter, AFS, and DFS host lookups.
:type '(repeat string)
:group 'vc)
-(defcustom vc-path
- (if (file-directory-p "/usr/sccs")
- '("/usr/sccs")
- nil)
+(defcustom vc-path nil
"List of extra directories to search for version control commands."
:type '(repeat directory)
:group 'vc)
(when (file-exists-p file)
(if (not limit)
(insert-file-contents file)
- (if (not blocksize) (setq blocksize 8192))
+ (unless blocksize (setq blocksize 8192))
(let ((filepos 0))
(while
(and (< 0 (cadr (insert-file-contents
file nil filepos (incf filepos blocksize))))
(progn (beginning-of-line)
(let ((pos (re-search-forward limit nil 'move)))
- (if pos (delete-region (match-beginning 0)
- (point-max)))
+ (when pos (delete-region (match-beginning 0)
+ (point-max)))
(not pos)))))))
(set-buffer-modified-p nil)
t))
'removed Scheduled to be deleted from the repository on next commit.
'conflict The file contains conflicts as the result of a merge.
- For now the conflicts are text conflicts. In the
- futures this might be extended to deal with metadata
+ For now the conflicts are text conflicts. In the
+ future this might be extended to deal with metadata
conflicts too.
- 'missing The file is not present in the file system, but the VC
+ 'missing The file is not present in the file system, but the VC
system still tracks it.
'ignored The file showed up in a dir-state listing with a flag
;; - `removed'
;; - `copied' and `moved' (might be handled by `removed' and `added')
(or (vc-file-getprop file 'vc-state)
- (if (and (> (length file) 0) (vc-backend file))
- (vc-file-setprop file 'vc-state
- (vc-call state-heuristic file)))))
+ (when (and (> (length file) 0) (vc-backend file))
+ (vc-file-setprop file 'vc-state
+ (vc-call state-heuristic file)))))
(defun vc-recompute-state (file)
"Recompute the version control state of FILE, and return it.
"Return the repository version from which FILE was checked out.
If FILE is not registered, this function always returns nil."
(or (vc-file-getprop file 'vc-working-revision)
- (if (vc-backend file)
- (vc-file-setprop file 'vc-working-revision
- (vc-call working-revision file)))))
+ (when (vc-backend file)
+ (vc-file-setprop file 'vc-working-revision
+ (vc-call working-revision file)))))
+
;; Backward compatibility.
(define-obsolete-function-alias
'vc-workfile-version 'vc-working-revision "23.1")
(mapcar
(lambda (s)
(let ((trial (vc-possible-master s dirname basename)))
- (if (and trial (file-exists-p trial)
- ;; Make sure the file we found with name
- ;; TRIAL is not the source file itself.
- ;; That can happen with RCS-style names if
- ;; the file name is truncated (e.g. to 14
- ;; chars). See if either directory or
- ;; attributes differ.
- (or (not (string= dirname
- (file-name-directory trial)))
- (not (equal (file-attributes file)
- (file-attributes trial)))))
+ (when (and trial (file-exists-p trial)
+ ;; Make sure the file we found with name
+ ;; TRIAL is not the source file itself.
+ ;; That can happen with RCS-style names if
+ ;; the file name is truncated (e.g. to 14
+ ;; chars). See if either directory or
+ ;; attributes differ.
+ (or (not (string= dirname
+ (file-name-directory trial)))
+ (not (equal (file-attributes file)
+ (file-attributes trial)))))
(throw 'found trial))))
templates))))
;; from a previous visit.
(vc-file-clearprops buffer-file-name)
(let ((backend (vc-backend buffer-file-name)))
- (if backend (vc-call-backend backend 'find-file-not-found-hook))))
+ (when backend (vc-call-backend backend 'find-file-not-found-hook))))
(defun vc-default-find-file-not-found-hook (backend)
;; This used to do what vc-rcs-find-file-not-found-hook does, but it only
(defun vc-kill-buffer-hook ()
"Discard VC info about a file when we kill its buffer."
- (if buffer-file-name
- (vc-file-clearprops buffer-file-name)))
+ (when buffer-file-name (vc-file-clearprops buffer-file-name)))
(add-hook 'kill-buffer-hook 'vc-kill-buffer-hook)
(define-key map "a" 'vc-update-change-log)
(define-key map "b" 'vc-switch-backend)
(define-key map "c" 'vc-rollback)
- (define-key map "d" 'vc-status)
+ (define-key map "d" 'vc-dir)
(define-key map "g" 'vc-annotate)
(define-key map "h" 'vc-insert-headers)
(define-key map "i" 'vc-register)
(define-key map "+" 'vc-update)
(define-key map "=" 'vc-diff)
(define-key map "~" 'vc-revision-other-window)
- ;; `vc-status' is a not-quite-ready replacement for `vc-directory'
- ;; (define-key map "?" 'vc-status)
+ ;; `vc-dir' is a not-quite-ready replacement for `vc-directory'
+ ;; (define-key map "?" 'vc-dir)
map))
(fset 'vc-prefix-map vc-prefix-map)
(define-key global-map "\C-xv" 'vc-prefix-map)
(define-key map [vc-register]
'(menu-item "Register" vc-register
:help "Register file set into a version control system"))
- (define-key map [vc-status]
- '(menu-item "VC Status" vc-status
+ (define-key map [vc-dir]
+ '(menu-item "VC Dir" vc-dir
:help "Show the VC status of files in a directory"))
map))