emacs-diffs
[Top][All Lists]
Advanced

[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: Wed, 01 Dec 2004 17:48:47 -0500

Index: emacs/lisp/pcvs.el
diff -c emacs/lisp/pcvs.el:1.73 emacs/lisp/pcvs.el:1.74
*** emacs/lisp/pcvs.el:1.73     Thu Nov 11 23:45:52 2004
--- emacs/lisp/pcvs.el  Wed Dec  1 22:35:15 2004
***************
*** 575,581 ****
    ;; emacsen. It shouldn't be needed, but it does no harm.
    (sit-for 0))
  
! (defun cvs-update-header (args fis) ; inline
    (let* ((lastarg nil)
         (args (mapcar (lambda (arg)
                         (cond
--- 575,581 ----
    ;; emacsen. It shouldn't be needed, but it does no harm.
    (sit-for 0))
  
! (defun cvs-header-msg (args fis)
    (let* ((lastarg nil)
         (args (mapcar (lambda (arg)
                         (cond
***************
*** 595,632 ****
                           (concat (match-string 0 arg) "<log message>"))
                          ;; Keep the rest as is.
                          (t arg)))
!                      args))
!        ;; turn them into a string
!        (arg (cvs-strings->string
!              (append (cvs-flags-query 'cvs-cvs-flags nil 'noquery)
!                      (if cvs-cvsroot (list "-d" cvs-cvsroot))
!                      args
!                      (mapcar 'cvs-fileinfo->full-path fis))))
!        (str (if args (concat "-- Running " cvs-program " " arg " ...\n")
!               "\n")))
!     (if nil (insert str)              ;inline
!       ;;(with-current-buffer cvs-buffer
!       (let* ((prev-msg (car (ewoc-get-hf cvs-cookies)))
!            (tin (ewoc-nth cvs-cookies 0)))
!       ;; look for the first *real* fileinfo (to determine emptyness)
!       (while
!           (and tin
!                (memq (cvs-fileinfo->type (ewoc-data tin))
!                      '(MESSAGE DIRCHANGE)))
!         (setq tin (ewoc-next cvs-cookies tin)))
!       ;; cleanup the prev-msg
!       (when (string-match "Running \\(.*\\) ...\n" prev-msg)
!         (setq prev-msg
!               (concat
!                "-- last cmd: "
!                (match-string 1 prev-msg)
!                " --")))
!       ;; set the new header and footer
!       (ewoc-set-hf cvs-cookies
!                    str (concat "\n--------------------- "
!                                (if tin "End" "Empty")
!                                " ---------------------\n"
!                                prev-msg))))))
  
  
  (defun cvs-sentinel (proc msg)
--- 595,634 ----
                           (concat (match-string 0 arg) "<log message>"))
                          ;; Keep the rest as is.
                          (t arg)))
!                      args)))
!     (concat cvs-program " "
!           (cvs-strings->string
!            (append (cvs-flags-query 'cvs-cvs-flags nil 'noquery)
!                    (if cvs-cvsroot (list "-d" cvs-cvsroot))
!                    args
!                    (mapcar 'cvs-fileinfo->full-path fis))))))
! 
! (defun cvs-update-header (cmd add)
!   (let* ((hf (ewoc-get-hf cvs-cookies))
!        (str (car hf))
!        (done "")
!        (tin (ewoc-nth cvs-cookies 0)))
!     (if (eq (length str) 1) (setq str ""))
!     ;; look for the first *real* fileinfo (to determine emptyness)
!     (while
!       (and tin
!            (memq (cvs-fileinfo->type (ewoc-data tin))
!                  '(MESSAGE DIRCHANGE)))
!       (setq tin (ewoc-next cvs-cookies tin)))
!     (if add
!       (setq str (concat "-- Running " cmd " ...\n" str))
!       (if (not (string-match
!               (concat "^-- Running " (regexp-quote cmd) " \\.\\.\\.\n") str))
!         (error "Internal PCL-CVS error while removing message")
!       (setq str (replace-match "" t t str))
!       (if (zerop (length str)) (setq str "\n"))
!       (setq done (concat "-- last cmd: " cmd " --"))))
!     ;; set the new header and footer
!     (ewoc-set-hf cvs-cookies
!                str (concat "\n--------------------- "
!                            (if tin "End" "Empty")
!                            " ---------------------\n"
!                            done))))
  
  
  (defun cvs-sentinel (proc msg)
***************
*** 658,664 ****
            ;; in a file-like buffer.  -stef
            (buffer-enable-undo)
            (with-current-buffer cvs-buffer
-             (cvs-update-header nil nil) ;FIXME: might need to be inline
              (message "CVS process has completed in %s" (buffer-name)))))
        ;; This might not even be necessary
        (set-buffer obuf)))))
--- 660,665 ----
***************
*** 1824,1831 ****
                ;; absence of `cvs update' output has a specific meaning.
                (or fis (list (cvs-create-fileinfo 'DIRCHANGE "" "." ""))))))
        (push `(cvs-parse-process ',dont-change-disc nil ',old-fis) postproc)))
      (setq postproc (if (cdr postproc) (cons 'progn postproc) (car postproc)))
-     (cvs-update-header args fis)
      (with-current-buffer buf
        (let ((inhibit-read-only t)) (erase-buffer))
        (message "Running cvs %s ..." cmd)
--- 1825,1836 ----
                ;; absence of `cvs update' output has a specific meaning.
                (or fis (list (cvs-create-fileinfo 'DIRCHANGE "" "." ""))))))
        (push `(cvs-parse-process ',dont-change-disc nil ',old-fis) postproc)))
+     (let ((msg (cvs-header-msg args fis)))
+       (cvs-update-header msg 'add)
+       (push `(with-current-buffer cvs-buffer
+              (cvs-update-header ',msg nil))
+           postproc))
      (setq postproc (if (cdr postproc) (cons 'progn postproc) (car postproc)))
      (with-current-buffer buf
        (let ((inhibit-read-only t)) (erase-buffer))
        (message "Running cvs %s ..." cmd)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]