summaryrefslogtreecommitdiff
path: root/lisp/pcvs.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2006-06-14 15:38:10 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2006-06-14 15:38:10 +0000
commit608f267107ecd28199fc5a84bc01d1b4540e6221 (patch)
treefd05f92ed8f19d82d656e7399a5328f9e6ca977c /lisp/pcvs.el
parent633e63caff83abbad3da2a86921e10c83c566a22 (diff)
downloademacs-608f267107ecd28199fc5a84bc01d1b4540e6221.tar.gz
(cvs-retrieve-revision): Use decode-coding-inserted-region.
Diffstat (limited to 'lisp/pcvs.el')
-rw-r--r--lisp/pcvs.el22
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index 5e322b9276a..89aeef53b80 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -1723,16 +1723,22 @@ Signal an error if there is no backup file."
(message "Retrieving revision %s..." rev)
;; Discard stderr output to work around the CVS+SSH+libc
;; problem when stdout and stderr are the same.
- (let ((res (apply 'call-process cvs-program nil '(t nil) nil
- "-q" "update" "-p"
- ;; If `rev' is HEAD, don't pass it at all:
- ;; the default behavior is to get the head
- ;; of the current branch whereas "-r HEAD"
- ;; stupidly gives you the head of the trunk.
- (append (unless (equal rev "HEAD") (list "-r" rev))
- (list file)))))
+ (let ((res
+ (let ((coding-system-for-read 'binary))
+ (apply 'call-process cvs-program nil '(t nil) nil
+ "-q" "update" "-p"
+ ;; If `rev' is HEAD, don't pass it at all:
+ ;; the default behavior is to get the head
+ ;; of the current branch whereas "-r HEAD"
+ ;; stupidly gives you the head of the trunk.
+ (append (unless (equal rev "HEAD") (list "-r" rev))
+ (list file))))))
(when (and res (not (and (equal 0 res))))
(error "Something went wrong retrieving revision %s: %s" rev res))
+ ;; Figure out the encoding used and decode the byte-sequence
+ ;; into a sequence of chars.
+ (decode-coding-inserted-region
+ (point-min) (point-max) file t nil nil t)
(set-buffer-modified-p nil)
(let ((buffer-file-name (expand-file-name file)))
(after-find-file))