diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2000-09-05 20:08:22 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2000-09-05 20:08:22 +0000 |
commit | 099bd78a963080c986d8374d8af79d32c5fe0ca3 (patch) | |
tree | 85c91f82453cd6a8ed691b6e0f37a97b131f9838 /lisp/vc-hooks.el | |
parent | 0772f3a31cd172365e87b25571201348b776648b (diff) | |
download | emacs-099bd78a963080c986d8374d8af79d32c5fe0ca3.tar.gz |
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el: (toplevel): Don't require `dired' at run-time.
(vc-dired-resynch-file): Remove autoload cookie.
2000-09-05 Andre Spiegel <spiegel@gnu.org>
* vc.el: Made several backend functions optional.
(vc-default-responsible-p): New function.
(vc-merge): Use RET for first version to trigger merge-news, not
prefix arg.
(vc-annotate): Handle backends that do not support annotation.
(vc-default-merge-news): Removed. The existence of a merge-news
implementation is now checked on caller sites.
* vc-hooks.el (vc-default-mode-line-string): Removed CVS special
case.
* vc-cvs.el (vc-cvs-mode-line-string): New function, handles the
special case that has been removed from the default in vc-hooks.el.
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el (vc-log-edit): Properly handle the case where FILE is nil.
2000-09-05 Andre Spiegel <spiegel@gnu.org>
* vc-hooks.el: Require vc during compilation.
(vc-file-setprop): Use `vc-touched-properties' if bound by the new
macro `with-vc-properties' in vc.el.
(vc-file-getprop): Doc fix.
(vc-after-save): Call `vc-dired-resynch-file' only if vc is loaded.
* vc.el: Require dired-aux during compilation.
(vc-name-assoc-file): Moved to vc-sccs.el.
(with-vc-properties): New macro.
(vc-checkin, vc-checkout, vc-revert, vc-cancel-version,
vc-finish-steal): Use it.
(vc-cancel-version): Moved RCS-specific code to vc-rcs.el. The call
to the backend-specific function is now supposed to do the checkout,
too.
(vc-log-edit): Handle FILE being nil and added a FIXME for log-edit.
* vc-cvs.el (vc-cvs-checkin, vc-cvs-checkout): Don't bother to
set file properties; that gets done in the generic code now.
* vc-rcs.el (vc-rcs-uncheck): Renamed to `vc-rcs-cancel-version'.
Changed parameter list, added code from vc.el that does the
checkout, possibly with a double-take.
* vc-sccs.el (vc-sccs-name-assoc-file): Moved here from vc.el.
(vc-sccs-add-triple, vc-sccs-rename-file, vc-sccs-lookup-triple): Use
the above under the new name.
(vc-sccs-uncheck): Renamed to `vc-sccs-cancel-version'. Changed
parameter list, added checkout command.
(vc-sccs-checkin, vc-sccs-checkout): Don't bother to set file
properties; that gets done in the generic code now.
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el: Docstring fixes (courtesy of checkdoc).
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el (vc-checkout-writable-buffer-hook)
(vc-checkout-writable-buffer): Remove.
(vc-start-entry): Always call vc-log-edit, never vc-log-mode.
(vc-log-mode): Make it into a clean derived major mode.
(vc-log-edit): Mark buffer unmodified (as vc-log-mode did) and use
vc-log-mode if log-edit is not available.
(vc-dired-mode-map): Don't set-keymap-parent yet.
(vc-dired-mode): Do set-keymap-parent here.
(vc-dired-buffers-for-dir): Nop if dired is not loaded.
Diffstat (limited to 'lisp/vc-hooks.el')
-rw-r--r-- | lisp/vc-hooks.el | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index efb7a973405..4554e1e6860 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -5,7 +5,7 @@ ;; Author: FSF (see vc.el for full credits) ;; Maintainer: Andre Spiegel <spiegel@gnu.org> -;; $Id: vc-hooks.el,v 1.53 2000/08/13 11:36:46 spiegel Exp $ +;; $Id: vc-hooks.el,v 1.116 2000/09/04 19:47:25 gerd Exp $ ;; This file is part of GNU Emacs. @@ -33,6 +33,9 @@ ;;; Code: +(eval-when-compile + (require 'vc)) + ;; Customization Variables (the rest is in vc.el) (defvar vc-ignore-vc-files nil "Obsolete -- use `vc-handled-backends'.") @@ -47,7 +50,7 @@ Removing an entry from the list prevents VC from being activated when visiting a file managed by that backend. An empty list disables VC altogether." :type '(repeat symbol) - :version "20.5" + :version "21.1" :group 'vc) (defcustom vc-path @@ -117,24 +120,30 @@ See also variable `vc-consult-headers'." (make-variable-buffer-local 'vc-mode) (put 'vc-mode 'permanent-local t) +(defmacro vc-error-occurred (&rest body) + (list 'condition-case nil (cons 'progn (append body '(nil))) '(error t))) + ;; We need a notion of per-file properties because the version ;; control state of a file is expensive to derive --- we compute ;; them when the file is initially found, keep them up to date ;; during any subsequent VC operations, and forget them when ;; the buffer is killed. -(defmacro vc-error-occurred (&rest body) - (list 'condition-case nil (cons 'progn (append body '(nil))) '(error t))) - (defvar vc-file-prop-obarray (make-vector 16 0) "Obarray for per-file properties.") +(defvar vc-touched-properties nil) + (defun vc-file-setprop (file property value) "Set per-file VC PROPERTY for FILE to VALUE." + (if (and vc-touched-properties + (not (memq property vc-touched-properties))) + (setq vc-touched-properties (append (list property) + vc-touched-properties))) (put (intern file vc-file-prop-obarray) property value)) (defun vc-file-getprop (file property) - "get per-file VC PROPERTY for FILE." + "Get per-file VC PROPERTY for FILE." (get (intern file vc-file-prop-obarray) property)) (defun vc-file-clearprops (file) @@ -462,7 +471,10 @@ to do that, use this command a second time with no argument." (eq (vc-checkout-model file) 'implicit) (vc-file-setprop file 'vc-state 'edited) (vc-mode-line file) - (vc-dired-resynch-file file)))) + (if (featurep 'vc) + ;; If VC is not loaded, then there can't be + ;; any VC Dired buffer to synchronize. + (vc-dired-resynch-file file))))) (defun vc-mode-line (file) "Set `vc-mode' to display type of version control for FILE. @@ -470,10 +482,9 @@ The value is set in the current buffer, which should be the buffer visiting FILE." (interactive (list buffer-file-name nil)) (unless (not (vc-backend file)) - (setq vc-mode (concat " " - (if vc-display-status - (vc-call mode-line-string file) - (symbol-name (vc-backend file))))) + (setq vc-mode (concat " " (if vc-display-status + (vc-call mode-line-string file) + (symbol-name (vc-backend file))))) ;; If the file is locked by some other user, make ;; the buffer read-only. Like this, even root ;; cannot modify a file that someone else has locked. @@ -499,16 +510,12 @@ Format: \"BACKEND-REV\" if the file is up-to-date \"BACKEND:REV\" if the file is edited (or locked by the calling user) \"BACKEND:LOCKER:REV\" if the file is locked by somebody else - \"BACKEND @@\" for a CVS file that is added, but not yet committed This function assumes that the file is registered." (setq backend (symbol-name backend)) (let ((state (vc-state file)) (rev (vc-workfile-version file))) - (cond ((string= "0" rev) - ;; CVS special case; should go into a CVS-specific implementation - (concat backend " @@")) - ((or (eq state 'up-to-date) + (cond ((or (eq state 'up-to-date) (eq state 'needs-patch)) (concat backend "-" rev)) ((stringp state) |