bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cvs-retrieve-revision ignores the working file's coding system


From: Kevin Rodgers
Subject: cvs-retrieve-revision ignores the working file's coding system
Date: Wed, 10 Sep 2003 16:27:14 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

This bug was originally reported and discussed on gnu.emacs.help; see
http://mail.gnu.org/archive/html/help-gnu-emacs/2003-09/msg00163.html

vc.el and vc-cvs.el handle it via vc-coding-system-for-diff, but pcvs.el
doesn't handle it at all.  Here's a patch to use the working file's coding
system when retrieving other versions from the repository:

*** emacs-21.3/lisp/pcvs.el.orig        Sat Sep 22 14:23:16 2001
--- emacs-21.3/lisp/pcvs.el     Wed Sep 10 16:16:37 2003
***************
*** 1517,1534 ****
    (let* ((file (cvs-fileinfo->full-path fileinfo))
         (buffile (concat file "." rev)))
      (or (find-buffer-visiting buffile)
!       (with-current-buffer (create-file-buffer buffile)
!         (message "Retrieving revision %s..." rev)
!         (let ((res (call-process cvs-program nil t nil
! "-q" "update" "-p" "-r" rev file)))
!           (when (and res (not (and (equal 0 res))))
!             (error "Something went wrong retrieving revision %s: %s" rev res))
!           (set-buffer-modified-p nil)
!           (let ((buffer-file-name (expand-file-name file)))
!             (after-find-file))
!           (toggle-read-only 1)
!           (message "Retrieving revision %s... Done" rev)
!           (current-buffer))))))

  (eval-and-compile (autoload 'smerge-ediff "smerge-mode"))

--- 1517,1546 ----
    (let* ((file (cvs-fileinfo->full-path fileinfo))
         (buffile (concat file "." rev)))
      (or (find-buffer-visiting buffile)
!       (let* ((buffer (find-buffer-visiting file))
!              (coding-system (cond ((eq buffer (current-buffer))
! buffer-file-coding-system) ! (buffer (with-current-buffer buffer ! buffer-file-coding-system)) ! (t (find-operation-coding-system ! 'insert-file-contents ! file)))))
!         (when (consp coding-system)
!           (setq coding-system (car coding-system)))
!         (with-current-buffer (create-file-buffer buffile)
!           (message "Retrieving revision %s..." rev)
!           (let* ((coding-system-for-read coding-system) ; (or ... 'undecided)
!                  (res (call-process cvs-program nil t nil
! "-q" "update" "-p" "-r" rev file)))
!             (when (and res (not (and (equal 0 res))))
!               (error "Something went wrong retrieving revision %s: %s"
!                      rev res))
!             (set-buffer-modified-p nil)
!             (let ((buffer-file-name (expand-file-name file)))
!               (after-find-file))
!             (toggle-read-only 1)
!             (message "Retrieving revision %s... Done" rev)
!             (current-buffer)))))))

  (eval-and-compile (autoload 'smerge-ediff "smerge-mode"))

--
Kevin Rodgers





reply via email to

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