summaryrefslogtreecommitdiff
path: root/lisp/vc-cvs.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2000-09-05 20:08:22 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2000-09-05 20:08:22 +0000
commit099bd78a963080c986d8374d8af79d32c5fe0ca3 (patch)
tree85c91f82453cd6a8ed691b6e0f37a97b131f9838 /lisp/vc-cvs.el
parent0772f3a31cd172365e87b25571201348b776648b (diff)
downloademacs-099bd78a963080c986d8374d8af79d32c5fe0ca3.tar.gz
emacs-099bd78a963080c986d8374d8af79d32c5fe0ca3.tar.bz2
emacs-099bd78a963080c986d8374d8af79d32c5fe0ca3.zip
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-cvs.el')
-rw-r--r--lisp/vc-cvs.el29
1 files changed, 22 insertions, 7 deletions
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el
index 7e41e9fe092..e7388ebbdd9 100644
--- a/lisp/vc-cvs.el
+++ b/lisp/vc-cvs.el
@@ -5,7 +5,7 @@
;; Author: FSF (see vc.el for full credits)
;; Maintainer: Andre Spiegel <spiegel@gnu.org>
-;; $Id: vc-cvs.el,v 1.58 2000/08/12 18:47:41 spiegel Exp $
+;; $Id: vc-cvs.el,v 1.1 2000/09/04 19:48:04 gerd Exp $
;; This file is part of GNU Emacs.
@@ -204,6 +204,26 @@ essential information."
'up-to-date
'edited)))
+(defun vc-cvs-mode-line-string (file)
+ "Return string for placement into the modeline for FILE.
+Compared to the default implementation, this function handles the
+special case of a CVS file that is added but not yet comitted."
+ (let ((state (vc-state file))
+ (rev (vc-workfile-version file)))
+ (cond ((string= rev "0")
+ ;; A file that is added but not yet comitted.
+ "CVS @@")
+ ((or (eq state 'up-to-date)
+ (eq state 'needs-patch))
+ (concat "CVS-" rev))
+ ((stringp state)
+ (concat "CVS:" state ":" rev))
+ (t
+ ;; Not just for the 'edited state, but also a fallback
+ ;; for all other states. Think about different symbols
+ ;; for 'needs-patch and 'needs-merge.
+ (concat "CVS:" rev)))))
+
(defun vc-cvs-dir-state (dir)
"Find the CVS state of all files in DIR."
(if (vc-cvs-stay-local-p dir)
@@ -513,8 +533,6 @@ its branch."
;; tell it from the permissions of the file (see
;; vc-cvs-checkout-model).
(vc-file-setprop file 'vc-checkout-model nil)
- (vc-file-setprop file 'vc-state 'up-to-date)
- (vc-file-setprop file 'vc-checkout-time (nth 5 (file-attributes file)))
;; if this was an explicit check-in, remove the sticky tag
(if rev (vc-do-command t 0 "cvs" file "update" "-A"))))
@@ -612,10 +630,7 @@ REV is the revision to check out into WORKFILE."
(if (or (not rev) (string= rev ""))
"-A"
(concat "-r" rev))
- switches))
- (when writable (vc-file-setprop file 'vc-state 'edited))
- (vc-file-setprop file
- 'vc-checkout-time (nth 5 (file-attributes file)))))
+ switches))))
(vc-mode-line file)
(message "Checking out %s...done" filename)))))