changeset 66096:59b6016b2dc3

(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.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 15 Oct 2005 12:04:34 +0000
parents a661cd70033f
children 94b9e76a6995
files lisp/ChangeLog lisp/pcvs.el
diffstat 2 files changed, 33 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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  <monnier@iro.umontreal.ca>
+
+	* 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  <wohler@newt.com>
 
 	* toolbar/gud-break.*: Moved to etc/images/gud/break.*.
--- 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)))))
 
 
 ;;;;