aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1994-11-22 12:23:40 +0000
committerRoland McGrath1994-11-22 12:23:40 +0000
commitf797cb30c9f10d5fb9a8c19b8f2784ce392677e2 (patch)
tree92c808e2166b2fd7fff1919ead72049623be77c0
parent0fb16286c2438bbc518dd4d1b988f64904c1b924 (diff)
downloademacs-f797cb30c9f10d5fb9a8c19b8f2784ce392677e2.tar.gz
emacs-f797cb30c9f10d5fb9a8c19b8f2784ce392677e2.zip
(vc-backend-checkout): Finish last change.
-rw-r--r--lisp/vc.el159
1 files changed, 83 insertions, 76 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index 59cbc69e414..f15bbdb927b 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -1688,87 +1688,94 @@ with RCS)."
1688 ;; Retrieve a copy of a saved version into a workfile 1688 ;; Retrieve a copy of a saved version into a workfile
1689 (let ((filename (or workfile file))) 1689 (let ((filename (or workfile file)))
1690 (message "Checking out %s..." filename) 1690 (message "Checking out %s..." filename)
1691 (save-excursion 1691 (save-excursion
1692 ;; Change buffers to get local value of vc-checkin-switches. 1692 ;; Change buffers to get local value of vc-checkin-switches.
1693 (set-buffer (or (get-file-buffer file) (current-buffer))) 1693 (set-buffer (or (get-file-buffer file) (current-buffer)))
1694 (vc-backend-dispatch file 1694 (vc-backend-dispatch file
1695 (if workfile ;; SCCS 1695 (if workfile;; SCCS
1696 ;; Some SCCS implementations allow checking out directly to a 1696 ;; Some SCCS implementations allow checking out directly to a
1697 ;; file using the -G option, but then some don't so use the 1697 ;; file using the -G option, but then some don't so use the
1698 ;; least common denominator approach and use the -p option 1698 ;; least common denominator approach and use the -p option
1699 ;; ala RCS. 1699 ;; ala RCS.
1700 (let ((vc-modes (logior (file-modes (vc-name file)) 1700 (let ((vc-modes (logior (file-modes (vc-name file))
1701 (if writable 128 0))) 1701 (if writable 128 0)))
1702 (failed t)) 1702 (failed t))
1703 (unwind-protect 1703 (unwind-protect
1704 (progn 1704 (progn
1705 (apply 'vc-do-command 1705 (apply 'vc-do-command
1706 0 "/bin/sh" file 'MASTER "-c" 1706 0 "/bin/sh" file 'MASTER "-c"
1707 ;; Some shells make the "" dummy argument into $0 1707 ;; Some shells make the "" dummy argument into $0
1708 ;; while others use the shell's name as $0 and 1708 ;; while others use the shell's name as $0 and
1709 ;; use the "" as $1. The if-statement 1709 ;; use the "" as $1. The if-statement
1710 ;; converts the latter case to the former. 1710 ;; converts the latter case to the former.
1711 (format "if [ x\"$1\" = x ]; then shift; fi; \ 1711 (format "if [ x\"$1\" = x ]; then shift; fi; \
1712 umask %o; exec >\"$1\" || exit; \ 1712 umask %o; exec >\"$1\" || exit; \
1713 shift; umask %o; exec get \"$@\"" 1713 shift; umask %o; exec get \"$@\""
1714 (logand 511 (lognot vc-modes)) 1714 (logand 511 (lognot vc-modes))
1715 (logand 511 (lognot (default-file-modes)))) 1715 (logand 511 (lognot (default-file-modes))))
1716 "" ; dummy argument for shell's $0 1716 "" ; dummy argument for shell's $0
1717 filename 1717 filename
1718 (if writable "-e") 1718 (if writable "-e")
1719 "-p" (and rev 1719 "-p" (and rev
1720 (concat "-r" (vc-lookup-triple file rev))) 1720 (concat "-r" (vc-lookup-triple file rev)))
1721 vc-checkout-switches) 1721 vc-checkout-switches)
1722 (setq failed nil)) 1722 (setq failed nil))
1723 (and failed (file-exists-p filename) (delete-file filename)))) 1723 (and failed (file-exists-p filename) (delete-file filename))))
1724 (vc-do-command 0 "get" file 'MASTER ;; SCCS 1724 (apply 'vc-do-command 0 "get" file 'MASTER;; SCCS
1725 (if writable "-e") 1725 (if writable "-e")
1726 (and rev (concat "-r" (vc-lookup-triple file rev))))) 1726 (and rev (concat "-r" (vc-lookup-triple file rev))))
1727 (if workfile ;; RCS 1727 vc-checkout-switches)
1728 ;; RCS doesn't let us check out into arbitrary file names directly. 1728 (if workfile;; RCS
1729 ;; Use `co -p' and make stdout point to the correct file. 1729 ;; RCS doesn't let us check out into arbitrary file names directly.
1730 (let ((vc-modes (logior (file-modes (vc-name file)) 1730 ;; Use `co -p' and make stdout point to the correct file.
1731 (if writable 128 0))) 1731 (let ((vc-modes (logior (file-modes (vc-name file))
1732 (failed t)) 1732 (if writable 128 0)))
1733 (unwind-protect 1733 (failed t))
1734 (progn 1734 (unwind-protect
1735 (vc-do-command 1735 (progn
1736 0 "/bin/sh" file 'MASTER "-c" 1736 (apply 'vc-do-command
1737 ;; See the SCCS case, above, regarding the if-statement. 1737 0 "/bin/sh" file 'MASTER "-c"
1738 (format "if [ x\"$1\" = x ]; then shift; fi; \ 1738 ;; See the SCCS case, above, regarding the
1739 ;; if-statement.
1740 (format "if [ x\"$1\" = x ]; then shift; fi; \
1739 umask %o; exec >\"$1\" || exit; \ 1741 umask %o; exec >\"$1\" || exit; \
1740 shift; umask %o; exec co \"$@\"" 1742 shift; umask %o; exec co \"$@\""
1741 (logand 511 (lognot vc-modes)) 1743 (logand 511 (lognot vc-modes))
1742 (logand 511 (lognot (default-file-modes)))) 1744 (logand 511 (lognot (default-file-modes))))
1743 "" ; dummy argument for shell's $0 1745 "" ; dummy argument for shell's $0
1744 filename 1746 filename
1745 (if writable "-l") 1747 (if writable "-l")
1746 (concat "-p" rev)) 1748 (concat "-p" rev)
1747 (setq failed nil)) 1749 vc-checkout-switches)
1748 (and failed (file-exists-p filename) (delete-file filename)))) 1750 (setq failed nil))
1749 (vc-do-command 0 "co" file 'MASTER 1751 (and failed (file-exists-p filename) (delete-file filename))))
1750 (if writable "-l") 1752 (apply 'vc-do-command 0 "co" file 'MASTER
1751 (and rev (concat "-r" rev)))) 1753 (if writable "-l")
1752 (if workfile ;; CVS 1754 (and rev (concat "-r" rev)))
1753 ;; CVS is much like RCS 1755 vc-checkout-switches)
1754 (let ((failed t)) 1756 (if workfile;; CVS
1755 (unwind-protect 1757 ;; CVS is much like RCS
1756 (progn 1758 (let ((failed t))
1757 (vc-do-command 1759 (unwind-protect
1758 0 "/bin/sh" file 'BASE "-c" 1760 (progn
1759 "exec >\"$1\" || exit; shift; exec cvs update \"$@\"" 1761 (apply 'vc-do-command
1760 "" ; dummy argument for shell's $0 1762 0 "/bin/sh" file 'BASE "-c"
1761 workfile 1763 "exec >\"$1\" || exit; shift; exec cvs update \"$@\""
1762 (concat "-r" rev) 1764 "" ; dummy argument for shell's $0
1763 "-p") 1765 workfile
1764 (setq failed nil)) 1766 (concat "-r" rev)
1765 (and failed (file-exists-p filename) (delete-file filename)))) 1767 "-p"
1766 (vc-do-command 0 "cvs" file 'BASE 1768 vc-checkout-switches)
1767 (and rev (concat "-r" rev)) 1769 (setq failed nil))
1768 file)) 1770 (and failed (file-exists-p filename) (delete-file filename))))
1769 ) 1771 (apply 'vc-do-command 0 "cvs" file 'BASE
1772 (and rev (concat "-r" rev))
1773 file
1774 vc-checkout-switches))
1775 ))
1770 (or workfile 1776 (or workfile
1771 (vc-file-setprop file 'vc-checkout-time (nth 5 (file-attributes file)))) 1777 (vc-file-setprop file
1778 'vc-checkout-time (nth 5 (file-attributes file))))
1772 (message "Checking out %s...done" filename)) 1779 (message "Checking out %s...done" filename))
1773 ) 1780 )
1774 1781