;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de>
-;; $Id: vc.el,v 1.254 1999/09/06 22:15:10 rms Exp $
+;; $Id: vc.el,v 1.256 1999/10/02 10:53:18 spiegel Exp $
;; This file is part of GNU Emacs.
(let ((new-mark (vc-find-position-by-context mark-context)))
(if new-mark (set-mark new-mark))))))
+;; Maybe this "smart mark preservation" could be added directly
+;; to revert-buffer since it can be generally useful. -sm
(defun vc-revert-buffer1 (&optional arg no-confirm)
;; Revert buffer, try to keep point and mark where user expects them in spite
;; of changes because of expanded version-control key words.
(let ((odefault default-directory)
(changelog (find-change-log))
;; Presumably not portable to non-Unixy systems, along with rcs2log:
- (tempfile (make-temp-name
+ (tempfile (make-temp-file
(expand-file-name "vc"
(or small-temporary-file-directory
temporary-file-directory))))
(failed t))
(unwind-protect
(progn
- (with-temp-file filename
- (apply 'vc-do-command
- (current-buffer) 0 "get" file 'MASTER
- "-s" ;; suppress diagnostic output
- (if writable "-e")
- "-p"
- (and rev
- (concat "-r"
- (vc-lookup-triple file rev)))
- switches))
+ (let ((coding-system-for-read 'no-conversion)
+ (coding-system-for-write 'no-conversion))
+ (with-temp-file filename
+ (apply 'vc-do-command
+ (current-buffer) 0 "get" file 'MASTER
+ "-s" ;; suppress diagnostic output
+ (if writable "-e")
+ "-p"
+ (and rev
+ (concat "-r"
+ (vc-lookup-triple file rev)))
+ switches)))
(set-file-modes filename
(logior (file-modes (vc-name file))
(if writable 128 0)))
(failed t))
(unwind-protect
(progn
- (with-temp-file filename
- (apply 'vc-do-command
- (current-buffer) 0 "co" file 'MASTER
- "-q" ;; suppress diagnostic output
- (if writable "-l")
- (concat "-p" rev)
- switches))
+ (let ((coding-system-for-read 'no-conversion)
+ (coding-system-for-write 'no-conversion))
+ (with-temp-file filename
+ (apply 'vc-do-command
+ (current-buffer) 0 "co" file 'MASTER
+ "-q" ;; suppress diagnostic output
+ (if writable "-l")
+ (concat "-p" rev)
+ switches)))
(set-file-modes filename
(logior (file-modes (vc-name file))
(if writable 128 0)))
(let ((failed t))
(unwind-protect
(progn
- (with-temp-file filename
- (apply 'vc-do-command
- (current-buffer) 0 "cvs" file 'WORKFILE
- "-Q" ;; suppress diagnostic output
- "update"
- (concat "-r" rev)
- "-p"
- switches))
+ (let ((coding-system-for-read 'no-conversion)
+ (coding-system-for-write 'no-conversion))
+ (with-temp-file filename
+ (apply 'vc-do-command
+ (current-buffer) 0 "cvs" file 'WORKFILE
+ "-Q" ;; suppress diagnostic output
+ "update"
+ (concat "-r" rev)
+ "-p"
+ switches)))
(setq failed nil))
(and failed (file-exists-p filename) (delete-file filename))))
;; default for verbose checkout: clear the sticky tag