aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Spiegel1999-09-22 12:58:49 +0000
committerAndré Spiegel1999-09-22 12:58:49 +0000
commitd76a596e39b5a2f003201cdece56c737302b8b5c (patch)
tree292fae4476a8a56a49258ee4ce0619518ad8b8f7
parent48970f2f02c0d057e17a8d470b1f301bc40ff55b (diff)
downloademacs-d76a596e39b5a2f003201cdece56c737302b8b5c.tar.gz
emacs-d76a596e39b5a2f003201cdece56c737302b8b5c.zip
(vc-backend-checkout): Use with-temp-file to check out into arbitrary
file names.
-rw-r--r--lisp/vc.el77
1 files changed, 34 insertions, 43 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index 864017fc6c4..0f131fd5d5a 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -5,7 +5,7 @@
5;; Author: Eric S. Raymond <esr@snark.thyrsus.com> 5;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
6;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de> 6;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de>
7 7
8;; $Id: vc.el,v 1.253 1999/09/06 03:46:33 rms Exp rms $ 8;; $Id: vc.el,v 1.254 1999/09/06 22:15:10 rms Exp $
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
@@ -2595,25 +2595,20 @@ THRESHOLD, nil otherwise"
2595 (failed t)) 2595 (failed t))
2596 (unwind-protect 2596 (unwind-protect
2597 (progn 2597 (progn
2598 (apply 'vc-do-command 2598 (with-temp-file filename
2599 nil 0 "/bin/sh" file 'MASTER "-c" 2599 (apply 'vc-do-command
2600 ;; Some shells make the "" dummy argument into $0 2600 (current-buffer) 0 "get" file 'MASTER
2601 ;; while others use the shell's name as $0 and 2601 "-s" ;; suppress diagnostic output
2602 ;; use the "" as $1. The if-statement 2602 (if writable "-e")
2603 ;; converts the latter case to the former. 2603 "-p"
2604 (format "if [ x\"$1\" = x ]; then shift; fi; \ 2604 (and rev
2605 umask %o; exec >\"$1\" || exit; \ 2605 (concat "-r"
2606 shift; umask %o; exec get \"$@\"" 2606 (vc-lookup-triple file rev)))
2607 (logand 511 (lognot vc-modes)) 2607 switches))
2608 (logand 511 (lognot (default-file-modes)))) 2608 (set-file-modes filename
2609 "" ; dummy argument for shell's $0 2609 (logior (file-modes (vc-name file))
2610 filename 2610 (if writable 128 0)))
2611 (if writable "-e") 2611 (setq failed nil))
2612 "-p"
2613 (and rev
2614 (concat "-r" (vc-lookup-triple file rev)))
2615 switches)
2616 (setq failed nil))
2617 (and failed (file-exists-p filename) 2612 (and failed (file-exists-p filename)
2618 (delete-file filename)))) 2613 (delete-file filename))))
2619 (apply 'vc-do-command nil 0 "get" file 'MASTER ;; SCCS 2614 (apply 'vc-do-command nil 0 "get" file 'MASTER ;; SCCS
@@ -2629,21 +2624,17 @@ THRESHOLD, nil otherwise"
2629 (failed t)) 2624 (failed t))
2630 (unwind-protect 2625 (unwind-protect
2631 (progn 2626 (progn
2632 (apply 'vc-do-command 2627 (with-temp-file filename
2633 nil 0 "/bin/sh" file 'MASTER "-c" 2628 (apply 'vc-do-command
2634 ;; See the SCCS case, above, regarding the 2629 (current-buffer) 0 "co" file 'MASTER
2635 ;; if-statement. 2630 "-q" ;; suppress diagnostic output
2636 (format "if [ x\"$1\" = x ]; then shift; fi; \ 2631 (if writable "-l")
2637 umask %o; exec >\"$1\" || exit; \ 2632 (concat "-p" rev)
2638 shift; umask %o; exec co \"$@\"" 2633 switches))
2639 (logand 511 (lognot vc-modes)) 2634 (set-file-modes filename
2640 (logand 511 (lognot (default-file-modes)))) 2635 (logior (file-modes (vc-name file))
2641 "" ; dummy argument for shell's $0 2636 (if writable 128 0)))
2642 filename 2637 (setq failed nil))
2643 (if writable "-l")
2644 (concat "-p" rev)
2645 switches)
2646 (setq failed nil))
2647 (and failed (file-exists-p filename) (delete-file filename)))) 2638 (and failed (file-exists-p filename) (delete-file filename))))
2648 (let (new-version) 2639 (let (new-version)
2649 ;; if we should go to the head of the trunk, 2640 ;; if we should go to the head of the trunk,
@@ -2684,14 +2675,14 @@ THRESHOLD, nil otherwise"
2684 (let ((failed t)) 2675 (let ((failed t))
2685 (unwind-protect 2676 (unwind-protect
2686 (progn 2677 (progn
2687 (apply 'vc-do-command 2678 (with-temp-file filename
2688 nil 0 "/bin/sh" file 'WORKFILE "-c" 2679 (apply 'vc-do-command
2689 "exec >\"$1\" || exit; shift; exec cvs update \"$@\"" 2680 (current-buffer) 0 "cvs" file 'WORKFILE
2690 "" ; dummy argument for shell's $0 2681 "-Q" ;; suppress diagnostic output
2691 workfile 2682 "update"
2692 (concat "-r" rev) 2683 (concat "-r" rev)
2693 "-p" 2684 "-p"
2694 switches) 2685 switches))
2695 (setq failed nil)) 2686 (setq failed nil))
2696 (and failed (file-exists-p filename) (delete-file filename)))) 2687 (and failed (file-exists-p filename) (delete-file filename))))
2697 ;; default for verbose checkout: clear the sticky tag 2688 ;; default for verbose checkout: clear the sticky tag