;; Maintainer: Andre Spiegel <spiegel@gnu.org>
;; Keywords: tools
-;; $Id: vc.el,v 1.352 2003/05/09 16:33:10 monnier Exp $
+;; $Id: vc.el,v 1.359 2003/07/06 19:08:13 jpw Exp $
;; This file is part of GNU Emacs.
;; to be installed somewhere on Emacs's path for executables.
;;
;; If your site uses the ChangeLog convention supported by Emacs, the
-;; function vc-comment-to-change-log should prove a useful checkin hook.
+;; function log-edit-comment-to-change-log could prove a useful checkin hook,
+;; although you might prefer to use C-c C-a (i.e. log-edit-insert-changelog)
+;; from the commit buffer instead or to set `log-edit-setup-invert'.
;;
;; The vc code maintains some internal state in order to reduce expensive
;; version-control operations to a minimum. Some names are only computed
;; Rename file OLD to NEW, both in the working area and in the
;; repository. If this function is not provided, the renaming
;; will be done by (vc-delete-file old) and (vc-register new).
-;;
+;;
;;; Code:
:group 'vc
:version "20.3")
-(defcustom vc-directory-exclusion-list '("SCCS" "RCS" "CVS")
+(defcustom vc-directory-exclusion-list '("SCCS" "RCS" "CVS" "MCVS" ".svn")
"*List of directory names to be ignored when walking directory trees."
:type '(repeat string)
:group 'vc)
;;;###autoload
(defcustom vc-checkin-hook nil
"*Normal hook (list of functions) run after a checkin is done.
-See `run-hooks'."
+See also `log-edit-done-hook'."
:type 'hook
- :options '(vc-comment-to-change-log)
+ :options '(log-edit-comment-to-change-log)
:group 'vc)
;;;###autoload
(vc-call diff file rel1 rel2))))
-(defcustom vc-stay-local t
- "*Non-nil means use local operations when possible for remote repositories.
-This avoids slow queries over the network and instead uses heuristics
-and past information to determine the current status of a file.
-
-The value can also be a regular expression or list of regular
-expressions to match against the host name of a repository; then VC
-only stays local for hosts that match it. Alternatively, the value
-can be a list of regular expressions where the first element is the
-symbol `except'; then VC always stays local except for hosts matched
-by these regular expressions."
- :type '(choice (const :tag "Always stay local" t)
- (const :tag "Don't stay local" nil)
- (list :format "\nExamine hostname and %v" :tag "Examine hostname ..."
- (set :format "%v" :inline t (const :format "%t" :tag "don't" except))
- (regexp :format " stay local,\n%t: %v" :tag "if it matches")
- (repeat :format "%v%i\n" :inline t (regexp :tag "or"))))
- :version "21.4"
- :group 'vc)
-
-(defun vc-stay-local-p (file)
- "Return non-nil if VC should stay local when handling FILE.
-This uses the `repository-hostname' backend operation."
- (let* ((backend (vc-backend file))
- (sym (vc-make-backend-sym backend 'stay-local))
- (stay-local (if (boundp sym) (symbol-value sym) t)))
- (if (eq stay-local t) (setq stay-local vc-stay-local))
- (if (symbolp stay-local) stay-local
- (let ((dirname (if (file-directory-p file)
- (directory-file-name file)
- (file-name-directory file))))
- (eq 'yes
- (or (vc-file-getprop dirname 'vc-stay-local-p)
- (vc-file-setprop
- dirname 'vc-stay-local-p
- (let ((hostname (vc-call-backend
- backend 'repository-hostname dirname)))
- (if (not hostname)
- 'no
- (let ((default t))
- (if (eq (car-safe stay-local) 'except)
- (setq default nil stay-local (cdr stay-local)))
- (when (consp stay-local)
- (setq stay-local
- (mapconcat 'identity stay-local "\\|")))
- (if (if (string-match stay-local hostname)
- default (not default))
- 'yes 'no)))))))))))
-
(defun vc-switches (backend op)
(let ((switches
(or (if backend
(set-buffer-modified-p nil)))))
(defun vc-default-show-log-entry (backend rev)
- (log-view-goto-rev rev))
+ (with-no-warnings
+ (log-view-goto-rev rev)))
(defun vc-default-comment-history (backend file)
"Return a string with all log entries stored in BACKEND for FILE."
(defun vc-delete-file (file)
"Delete file and mark it as such in the version control system."
(interactive "fVC delete file: ")
- (let ((buf (get-file-buffer file)))
+ (let ((buf (get-file-buffer file))
+ (backend (vc-backend file)))
+ (unless backend
+ (error "File %s is not under version control"
+ (file-name-nondirectory file)))
(unless (vc-find-backend-function backend 'delete-file)
- (error "Renaming files under %s is not supported in VC" backend))
+ (error "Deleting files under %s is not supported in VC" backend))
(if (and buf (buffer-modified-p buf))
(error "Please save files before deleting them"))
(unless (y-or-n-p (format "Really want to delete %s ? "
(error "Already editing new file name"))
(if (file-exists-p new)
(error "New file already exists"))
- (let ((state (vc-state file)))
+ (let ((state (vc-state old)))
(unless (memq state '(up-to-date edited))
(error "Please %s files before moving them"
(if (stringp state) "check in" "update"))))
"Return the current time, encoded as fractional days."
(vc-annotate-convert-time (current-time)))
+(defvar vc-annotate-offset nil)
+
(defun vc-annotate-display (&optional color-map offset)
"Highlight `vc-annotate' output in the current buffer.
COLOR-MAP, if present, overrides `vc-annotate-color-map'.
(set (make-local-variable 'vc-annotate-color-map) color-map))
(set (make-local-variable 'vc-annotate-offset) offset)
(font-lock-mode 1))
-(make-obsolete 'vc-annotate-display 'vc-annotate-display-select "21.4")
-
-(defvar vc-annotate-offset nil)
(defun vc-annotate-lines (limit)
(let (difference)
;;
;; Thus, there is no explicit recovery code.
+;;; arch-tag: ca82c1de-3091-4e26-af92-460abc6213a6
;;; vc.el ends here