# HG changeset patch # User Stefan Monnier # Date 1129377874 0 # Node ID 59b6016b2dc3ef3789b93336809ae370541750ed # Parent a661cd70033f2f232ffb9869e87b2aab04fe9f25 (cvs-edit-log-files): New var. (cvs-mode-edit-log): New arg `file'. (cvs-edit-log-minor-wrap): Don't set the ignore-marks property. Instead force the use of the original file and nothing else. (cvs-edit-log-filelist): Don't use the cvs-mode-* function unless the cvs-minor-wrap-function is set. (cvs-do-edit-log): Obey the vars set in cvs-edit-log-minor-wrap. diff -r a661cd70033f -r 59b6016b2dc3 lisp/ChangeLog --- a/lisp/ChangeLog Sat Oct 15 06:00:10 2005 +0000 +++ b/lisp/ChangeLog Sat Oct 15 12:04:34 2005 +0000 @@ -1,3 +1,13 @@ +2005-10-15 Stefan Monnier + + * pcvs.el (cvs-edit-log-files): New var. + (cvs-mode-edit-log): New arg `file'. + (cvs-edit-log-minor-wrap): Don't set the ignore-marks property. + Instead force the use of the original file and nothing else. + (cvs-edit-log-filelist): Don't use the cvs-mode-* function unless + the cvs-minor-wrap-function is set. + (cvs-do-edit-log): Obey the vars set in cvs-edit-log-minor-wrap. + 2005-10-14 Bill Wohler * toolbar/gud-break.*: Moved to etc/images/gud/break.*. diff -r a661cd70033f -r 59b6016b2dc3 lisp/pcvs.el --- a/lisp/pcvs.el Sat Oct 15 06:00:10 2005 +0000 +++ b/lisp/pcvs.el Sat Oct 15 12:04:34 2005 +0000 @@ -1482,11 +1482,16 @@ (point)))))) (defvar cvs-edit-log-revision) -(defun cvs-mode-edit-log (rev &optional text) +(defvar cvs-edit-log-files) (put 'cvs-edit-log-files 'permanent-local t) +(defun cvs-mode-edit-log (file rev &optional text) "Edit the log message at point. This is best called from a `log-view-mode' buffer." (interactive (list + (or (cvs-mode! (lambda () + (car (cvs-mode-files nil nil + :read-only t :file t :noquery t)))) + (read-string "File name: ")) (or (cvs-mode! (lambda () (cvs-prefix-get 'cvs-branch-prefix))) (read-string "Revision to edit: ")) (cvs-edit-log-text-at-point))) @@ -1498,26 +1503,38 @@ (let ((buf (cvs-temp-buffer "message" 'normal 'nosetup)) (setupfun (or (nth 2 (cdr (assoc "message" cvs-buffer-name-alist))) 'log-edit))) + (with-current-buffer buf + ;; Set the filename before, so log-edit can correctly setup its + ;; log-edit-initial-files variable. + (set (make-local-variable 'cvs-edit-log-files) (list file))) (funcall setupfun 'cvs-do-edit-log nil 'cvs-edit-log-filelist buf) (when text (erase-buffer) (insert text)) (set (make-local-variable 'cvs-edit-log-revision) rev) - (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-edit-log-minor-wrap) + (set (make-local-variable 'cvs-minor-wrap-function) + 'cvs-edit-log-minor-wrap) ;; (run-hooks 'cvs-mode-commit-hook) )) (defun cvs-edit-log-minor-wrap (buf f) - (let ((cvs-ignore-marks-modif (cvs-mode-mark-get-modif "commit"))) + (let ((cvs-branch-prefix (with-current-buffer buf cvs-edit-log-revision)) + (cvs-minor-current-files + (with-current-buffer buf cvs-edit-log-files)) + ;; FIXME: I need to force because the fileinfos are UNKNOWN + (cvs-force-command "/F")) (funcall f))) (defun cvs-edit-log-filelist () - (cvs-mode-files nil nil :read-only t :file t :noquery t)) + (if cvs-minor-wrap-function + (cvs-mode-files nil nil :read-only t :file t :noquery t) + cvs-edit-log-files)) (defun cvs-do-edit-log (rev) "Do the actual commit, using the current buffer as the log message." (interactive (list cvs-edit-log-revision)) (let ((msg (buffer-substring-no-properties (point-min) (point-max)))) - (cvs-mode!) - (cvs-mode-do "admin" (list (concat "-m" rev ":" msg)) nil))) + (cvs-mode! + (lambda () + (cvs-mode-do "admin" (list (concat "-m" rev ":" msg)) nil))))) ;;;;