(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,25 +2595,20 @@ THRESHOLD, nil otherwise"
(failed t)) (failed t))
(unwind-protect (unwind-protect
(progn (progn
(apply 'vc-do-command (with-temp-file filename
nil 0 "/bin/sh" file 'MASTER "-c" (apply 'vc-do-command
;; Some shells make the "" dummy argument into $0 (current-buffer) 0 "get" file 'MASTER
;; while others use the shell's name as $0 and "-s" ;; suppress diagnostic output
;; use the "" as $1. The if-statement (if writable "-e")
;; converts the latter case to the former. "-p"
(format "if [ x\"$1\" = x ]; then shift; fi; \ (and rev
umask %o; exec >\"$1\" || exit; \ (concat "-r"
shift; umask %o; exec get \"$@\"" (vc-lookup-triple file rev)))
(logand 511 (lognot vc-modes)) switches))
(logand 511 (lognot (default-file-modes)))) (set-file-modes filename
"" ; dummy argument for shell's $0 (logior (file-modes (vc-name file))
filename (if writable 128 0)))
(if writable "-e") (setq failed nil))
"-p"
(and rev
(concat "-r" (vc-lookup-triple file rev)))
switches)
(setq failed nil))
(and failed (file-exists-p filename) (and failed (file-exists-p filename)
(delete-file filename)))) (delete-file filename))))
(apply 'vc-do-command nil 0 "get" file 'MASTER ;; SCCS (apply 'vc-do-command nil 0 "get" file 'MASTER ;; SCCS
@ -2629,21 +2624,17 @@ THRESHOLD, nil otherwise"
(failed t)) (failed t))
(unwind-protect (unwind-protect
(progn (progn
(apply 'vc-do-command (with-temp-file filename
nil 0 "/bin/sh" file 'MASTER "-c" (apply 'vc-do-command
;; See the SCCS case, above, regarding the (current-buffer) 0 "co" file 'MASTER
;; if-statement. "-q" ;; suppress diagnostic output
(format "if [ x\"$1\" = x ]; then shift; fi; \ (if writable "-l")
umask %o; exec >\"$1\" || exit; \ (concat "-p" rev)
shift; umask %o; exec co \"$@\"" switches))
(logand 511 (lognot vc-modes)) (set-file-modes filename
(logand 511 (lognot (default-file-modes)))) (logior (file-modes (vc-name file))
"" ; dummy argument for shell's $0 (if writable 128 0)))
filename (setq failed nil))
(if writable "-l")
(concat "-p" rev)
switches)
(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)
;; if we should go to the head of the trunk, ;; if we should go to the head of the trunk,
@ -2684,14 +2675,14 @@ THRESHOLD, nil otherwise"
(let ((failed t)) (let ((failed t))
(unwind-protect (unwind-protect
(progn (progn
(apply 'vc-do-command (with-temp-file filename
nil 0 "/bin/sh" file 'WORKFILE "-c" (apply 'vc-do-command
"exec >\"$1\" || exit; shift; exec cvs update \"$@\"" (current-buffer) 0 "cvs" file 'WORKFILE
"" ; dummy argument for shell's $0 "-Q" ;; suppress diagnostic output
workfile "update"
(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