1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-18 11:50:38 -08:00

(vc-backend-checkout): Use with-temp-file to check out into arbitrary

file names.
This commit is contained in:
André Spiegel 1999-09-22 12:58:49 +00:00
parent 48970f2f02
commit d76a596e39

View file

@ -5,7 +5,7 @@
;; Author: Eric S. Raymond <esr@snark.thyrsus.com> ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de> ;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de>
;; $Id: vc.el,v 1.253 1999/09/06 03:46:33 rms Exp rms $ ;; $Id: vc.el,v 1.254 1999/09/06 22:15:10 rms Exp $
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.
@ -2595,24 +2595,19 @@ THRESHOLD, nil otherwise"
(failed t)) (failed t))
(unwind-protect (unwind-protect
(progn (progn
(with-temp-file filename
(apply 'vc-do-command (apply 'vc-do-command
nil 0 "/bin/sh" file 'MASTER "-c" (current-buffer) 0 "get" file 'MASTER
;; Some shells make the "" dummy argument into $0 "-s" ;; suppress diagnostic output
;; while others use the shell's name as $0 and
;; use the "" as $1. The if-statement
;; converts the latter case to the former.
(format "if [ x\"$1\" = x ]; then shift; fi; \
umask %o; exec >\"$1\" || exit; \
shift; umask %o; exec get \"$@\""
(logand 511 (lognot vc-modes))
(logand 511 (lognot (default-file-modes))))
"" ; dummy argument for shell's $0
filename
(if writable "-e") (if writable "-e")
"-p" "-p"
(and rev (and rev
(concat "-r" (vc-lookup-triple file rev))) (concat "-r"
switches) (vc-lookup-triple file rev)))
switches))
(set-file-modes filename
(logior (file-modes (vc-name file))
(if writable 128 0)))
(setq failed nil)) (setq failed nil))
(and failed (file-exists-p filename) (and failed (file-exists-p filename)
(delete-file filename)))) (delete-file filename))))
@ -2629,20 +2624,16 @@ THRESHOLD, nil otherwise"
(failed t)) (failed t))
(unwind-protect (unwind-protect
(progn (progn
(with-temp-file filename
(apply 'vc-do-command (apply 'vc-do-command
nil 0 "/bin/sh" file 'MASTER "-c" (current-buffer) 0 "co" file 'MASTER
;; See the SCCS case, above, regarding the "-q" ;; suppress diagnostic output
;; if-statement.
(format "if [ x\"$1\" = x ]; then shift; fi; \
umask %o; exec >\"$1\" || exit; \
shift; umask %o; exec co \"$@\""
(logand 511 (lognot vc-modes))
(logand 511 (lognot (default-file-modes))))
"" ; dummy argument for shell's $0
filename
(if writable "-l") (if writable "-l")
(concat "-p" rev) (concat "-p" rev)
switches) switches))
(set-file-modes filename
(logior (file-modes (vc-name file))
(if writable 128 0)))
(setq failed nil)) (setq failed nil))
(and failed (file-exists-p filename) (delete-file filename)))) (and failed (file-exists-p filename) (delete-file filename))))
(let (new-version) (let (new-version)
@ -2684,14 +2675,14 @@ THRESHOLD, nil otherwise"
(let ((failed t)) (let ((failed t))
(unwind-protect (unwind-protect
(progn (progn
(with-temp-file filename
(apply 'vc-do-command (apply 'vc-do-command
nil 0 "/bin/sh" file 'WORKFILE "-c" (current-buffer) 0 "cvs" file 'WORKFILE
"exec >\"$1\" || exit; shift; exec cvs update \"$@\"" "-Q" ;; suppress diagnostic output
"" ; dummy argument for shell's $0 "update"
workfile
(concat "-r" rev) (concat "-r" rev)
"-p" "-p"
switches) switches))
(setq failed nil)) (setq failed nil))
(and failed (file-exists-p filename) (delete-file filename)))) (and failed (file-exists-p filename) (delete-file filename))))
;; default for verbose checkout: clear the sticky tag ;; default for verbose checkout: clear the sticky tag