[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/pcvs.el
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/pcvs.el |
Date: |
Mon, 24 Jun 2002 20:11:28 -0400 |
Index: emacs/lisp/pcvs.el
diff -c emacs/lisp/pcvs.el:1.37 emacs/lisp/pcvs.el:1.38
*** emacs/lisp/pcvs.el:1.37 Mon Jun 24 18:49:38 2002
--- emacs/lisp/pcvs.el Mon Jun 24 20:11:28 2002
***************
*** 14,20 ****
;; (Jari Aalto+mail.emacs) address@hidden
;; Maintainer: (Stefan Monnier) monnier+lists/cvs/address@hidden
;; Keywords: CVS, version control, release management
! ;; Revision: $Id: pcvs.el,v 1.37 2002/06/24 22:49:38 monnier Exp $
;; This file is part of GNU Emacs.
--- 14,20 ----
;; (Jari Aalto+mail.emacs) address@hidden
;; Maintainer: (Stefan Monnier) monnier+lists/cvs/address@hidden
;; Keywords: CVS, version control, release management
! ;; Revision: $Id: pcvs.el,v 1.38 2002/06/25 00:11:28 monnier Exp $
;; This file is part of GNU Emacs.
***************
*** 62,68 ****
;; ******** FIX THE DOCUMENTATION *********
;;
;; - rework the displaying of error messages.
- ;; - use UP-TO-DATE rather than DEAD when cleaning before `examine'.
;; - allow to flush messages only
;; - allow to protect files like ChangeLog from flushing
;; - automatically cvs-mode-insert files from find-file-hook
--- 62,67 ----
***************
*** 640,684 ****
SUBDIR is the subdirectory (if any) where this command was run.
OLD-FIS is the list of fileinfos on which the cvs command was applied and
which should be considered up-to-date if they are missing from the output."
! (let* ((from-buf (current-buffer))
! (fileinfos (cvs-parse-buffer 'cvs-parse-table dcd subdir))
! (_ (set-buffer cvs-buffer))
! last
! (from-pt (point)))
! ;; Expand OLD-FIS to actual files.
! (dolist (fi old-fis)
! (when (eq (cvs-fileinfo->type fi) 'DIRCHANGE)
! (setq old-fis (nconc (ewoc-collect cvs-cookies 'cvs-dir-member-p
! (cvs-fileinfo->dir fi))
! old-fis))))
! ;; Drop OLD-FIS which were already up-to-date.
! (let ((fis nil))
(dolist (fi old-fis)
! (unless (eq (cvs-fileinfo->type fi) 'UP-TO-DATE) (push fi fis)))
! (setq old-fis fis))
! ;; Add the new fileinfos to the ewoc.
! (dolist (fi fileinfos)
! (setq last (cvs-addto-collection cvs-cookies fi last))
! ;; This FI was in the output, so remove it from OLD-FIS.
! (setq old-fis (delq (ewoc-data last) old-fis)))
! ;; Process the "silent output" (i.e. absence means up-to-date).
! (dolist (fi old-fis)
! (setf (cvs-fileinfo->type fi) 'UP-TO-DATE)
! (setq last (cvs-addto-collection cvs-cookies fi last)))
! (setq fileinfos (nconc old-fis fileinfos))
! ;; Clean up the ewoc as requested by the user.
! (cvs-cleanup-collection cvs-cookies
! (eq cvs-auto-remove-handled t)
! cvs-auto-remove-directories
! nil)
! ;; Revert buffers if necessary.
! (when (and cvs-auto-revert (not dcd) (not cvs-from-vc))
! (cvs-revert-if-needed fileinfos))
! ;; get back to where we were. `save-excursion' doesn't seem to
! ;; work in this case, probably because the buffer is reconstructed
! ;; by the cookie code.
! (goto-char from-pt)
! (set-buffer from-buf)))
(defmacro defun-cvs-mode (fun args docstring interact &rest body)
"Define a function to be used in a *cvs* buffer.
--- 639,679 ----
SUBDIR is the subdirectory (if any) where this command was run.
OLD-FIS is the list of fileinfos on which the cvs command was applied and
which should be considered up-to-date if they are missing from the output."
! (let* ((fileinfos (cvs-parse-buffer 'cvs-parse-table dcd subdir))
! last)
! (with-current-buffer cvs-buffer
! ;; Expand OLD-FIS to actual files.
! (let ((fis nil))
! (dolist (fi old-fis)
! (setq fis (if (eq (cvs-fileinfo->type fi) 'DIRCHANGE)
! (nconc (ewoc-collect cvs-cookies 'cvs-dir-member-p
! (cvs-fileinfo->dir fi))
! fis)
! (cons fi fis))))
! (setq old-fis fis))
! ;; Drop OLD-FIS which were already up-to-date.
! (let ((fis nil))
! (dolist (fi old-fis)
! (unless (eq (cvs-fileinfo->type fi) 'UP-TO-DATE) (push fi fis)))
! (setq old-fis fis))
! ;; Add the new fileinfos to the ewoc.
! (dolist (fi fileinfos)
! (setq last (cvs-addto-collection cvs-cookies fi last))
! ;; This FI was in the output, so remove it from OLD-FIS.
! (setq old-fis (delq (ewoc-data last) old-fis)))
! ;; Process the "silent output" (i.e. absence means up-to-date).
(dolist (fi old-fis)
! (setf (cvs-fileinfo->type fi) 'UP-TO-DATE)
! (setq last (cvs-addto-collection cvs-cookies fi last)))
! (setq fileinfos (nconc old-fis fileinfos))
! ;; Clean up the ewoc as requested by the user.
! (cvs-cleanup-collection cvs-cookies
! (eq cvs-auto-remove-handled t)
! cvs-auto-remove-directories
! nil)
! ;; Revert buffers if necessary.
! (when (and cvs-auto-revert (not dcd) (not cvs-from-vc))
! (cvs-revert-if-needed fileinfos)))))
(defmacro defun-cvs-mode (fun args docstring interact &rest body)
"Define a function to be used in a *cvs* buffer.
***************
*** 766,771 ****
--- 761,768 ----
;; fi == tin
(cvs-fileinfo-update (ewoc-data tin) fi)
(ewoc-invalidate c tin)
+ ;; Move cursor back to where it belongs.
+ (when (bolp) (cvs-move-to-goal-column))
tin))))
(defcustom cvs-cleanup-functions nil
***************
*** 1108,1136 ****
;; Move around in the buffer
(defun-cvs-mode cvs-mode-previous-line (arg)
"Go to the previous line.
If a prefix argument is given, move by that many lines."
(interactive "p")
(ewoc-goto-prev cvs-cookies arg)
! (let ((fpos (next-single-property-change
! (point) 'cvs-goal-column
! (current-buffer) (line-end-position)))
! (eol (line-end-position)))
! (when (< fpos eol)
! (goto-char fpos))))
(defun-cvs-mode cvs-mode-next-line (arg)
"Go to the next line.
If a prefix argument is given, move by that many lines."
(interactive "p")
(ewoc-goto-next cvs-cookies arg)
! (let ((fpos (next-single-property-change
! (point) 'cvs-goal-column
! (current-buffer) (line-end-position)))
! (eol (line-end-position)))
! (when (< fpos eol)
! (goto-char fpos))))
;;;;
;;;; Mark handling
--- 1105,1129 ----
;; Move around in the buffer
+ (defun cvs-move-to-goal-column ()
+ (let* ((eol (line-end-position))
+ (fpos (next-single-property-change (point) 'cvs-goal-column nil eol)))
+ (when (< fpos eol)
+ (goto-char fpos))))
+
(defun-cvs-mode cvs-mode-previous-line (arg)
"Go to the previous line.
If a prefix argument is given, move by that many lines."
(interactive "p")
(ewoc-goto-prev cvs-cookies arg)
! (cvs-move-to-goal-column))
(defun-cvs-mode cvs-mode-next-line (arg)
"Go to the next line.
If a prefix argument is given, move by that many lines."
(interactive "p")
(ewoc-goto-next cvs-cookies arg)
! (cvs-move-to-goal-column))
;;;;
;;;; Mark handling
***************
*** 2144,2150 ****
(pop flags))
;; don't parse output we don't understand.
(member (car flags) cvs-parse-known-commands)))
! (save-excursion
(let ((buffer (current-buffer))
(dir default-directory)
(cvs-from-vc t))
--- 2137,2143 ----
(pop flags))
;; don't parse output we don't understand.
(member (car flags) cvs-parse-known-commands)))
! (save-current-buffer
(let ((buffer (current-buffer))
(dir default-directory)
(cvs-from-vc t))
***************
*** 2156,2161 ****
--- 2149,2161 ----
(let ((subdir (substring dir (length default-directory))))
(set-buffer buffer)
(set (make-local-variable 'cvs-buffer) cvs-buf)
+ ;; `cvs -q add file' produces no useful output :-(
+ (when (and (equal (car flags) "add")
+ (goto-char (point-min))
+ (looking-at ".*to add this file permanently\n\\'"))
+ (insert "cvs add: scheduling file `"
+ (file-name-nondirectory file)
+ "' for addition\n"))
;; VC never (?) does `cvs -n update' so dcd=nil
;; should probably always be the right choice.
(cvs-parse-process nil subdir))))))))