Mercurial > emacs
comparison lisp/vc.el @ 16033:244188795475
(vc-register-switches): New variable.
(vc-backend-admin): Use vc-register-switches.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 01 Sep 1996 18:33:12 +0000 |
parents | 2813c68432c9 |
children | 852c9735c076 |
comparison
equal
deleted
inserted
replaced
16032:8f14513f5dfb | 16033:244188795475 |
---|---|
102 "*If non-nil, treat user as expert; suppress yes-no prompts on some things.") | 102 "*If non-nil, treat user as expert; suppress yes-no prompts on some things.") |
103 (defvar vc-initial-comment nil | 103 (defvar vc-initial-comment nil |
104 "*If non-nil, prompt for initial comment when a file is registered.") | 104 "*If non-nil, prompt for initial comment when a file is registered.") |
105 (defvar vc-command-messages nil | 105 (defvar vc-command-messages nil |
106 "*If non-nil, display run messages from back-end commands.") | 106 "*If non-nil, display run messages from back-end commands.") |
107 (defvar vc-register-switches nil | |
108 "*A string or list of strings specifying extra switches passed | |
109 to the register program by \\[vc-register].") | |
107 (defvar vc-checkin-switches nil | 110 (defvar vc-checkin-switches nil |
108 "*A string or list of strings specifying extra switches passed | 111 "*A string or list of strings specifying extra switches passed |
109 to the checkin program by \\[vc-checkin].") | 112 to the checkin program by \\[vc-checkin].") |
110 (defvar vc-checkout-switches nil | 113 (defvar vc-checkout-switches nil |
111 "*A string or list of strings specifying extra switches passed | 114 "*A string or list of strings specifying extra switches passed |
1812 ;; it deletes the workfile. | 1815 ;; it deletes the workfile. |
1813 (vc-file-clearprops file) | 1816 (vc-file-clearprops file) |
1814 (or vc-default-back-end | 1817 (or vc-default-back-end |
1815 (setq vc-default-back-end (if (vc-find-binary "rcs") 'RCS 'SCCS))) | 1818 (setq vc-default-back-end (if (vc-find-binary "rcs") 'RCS 'SCCS))) |
1816 (message "Registering %s..." file) | 1819 (message "Registering %s..." file) |
1817 (let ((backend | 1820 (let ((switches |
1821 (if (stringp vc-register-switches) | |
1822 (list vc-register-switches) | |
1823 vc-register-switches)) | |
1824 (backend | |
1818 (cond | 1825 (cond |
1819 ((file-exists-p (vc-backend-subdirectory-name)) vc-default-back-end) | 1826 ((file-exists-p (vc-backend-subdirectory-name)) vc-default-back-end) |
1820 ((file-exists-p "RCS") 'RCS) | 1827 ((file-exists-p "RCS") 'RCS) |
1821 ((file-exists-p "SCCS") 'SCCS) | 1828 ((file-exists-p "SCCS") 'SCCS) |
1822 ((file-exists-p "CVS") 'CVS) | 1829 ((file-exists-p "CVS") 'CVS) |
1823 (t vc-default-back-end)))) | 1830 (t vc-default-back-end)))) |
1824 (cond ((eq backend 'SCCS) | 1831 (cond ((eq backend 'SCCS) |
1825 (vc-do-command nil 0 "admin" file 'MASTER ;; SCCS | 1832 (apply 'vc-do-command nil 0 "admin" file 'MASTER ;; SCCS |
1826 (and rev (concat "-r" rev)) | 1833 (and rev (concat "-r" rev)) |
1827 "-fb" | 1834 "-fb" |
1828 (concat "-i" file) | 1835 (concat "-i" file) |
1829 (and comment (concat "-y" comment)) | 1836 (and comment (concat "-y" comment)) |
1830 (format | 1837 (format |
1831 (car (rassq 'SCCS vc-master-templates)) | 1838 (car (rassq 'SCCS vc-master-templates)) |
1832 (or (file-name-directory file) "") | 1839 (or (file-name-directory file) "") |
1833 (file-name-nondirectory file))) | 1840 (file-name-nondirectory file)) |
1841 switches) | |
1834 (delete-file file) | 1842 (delete-file file) |
1835 (if vc-keep-workfiles | 1843 (if vc-keep-workfiles |
1836 (vc-do-command nil 0 "get" file 'MASTER))) | 1844 (vc-do-command nil 0 "get" file 'MASTER))) |
1837 ((eq backend 'RCS) | 1845 ((eq backend 'RCS) |
1838 (vc-do-command nil 0 "ci" file 'MASTER ;; RCS | 1846 (apply 'vc-do-command nil 0 "ci" file 'WORKFILE ;; RCS |
1839 ;; if available, use the secure registering option | 1847 ;; if available, use the secure registering option |
1840 (and (vc-backend-release-p 'RCS "5.6.4") "-i") | 1848 (and (vc-backend-release-p 'RCS "5.6.4") "-i") |
1841 (concat (if vc-keep-workfiles "-u" "-r") rev) | 1849 (concat (if vc-keep-workfiles "-u" "-r") rev) |
1842 (and comment (concat "-t-" comment)) | 1850 (and comment (concat "-t-" comment)) |
1843 file)) | 1851 switches)) |
1844 ((eq backend 'CVS) | 1852 ((eq backend 'CVS) |
1845 (vc-do-command nil 0 "cvs" file 'WORKFILE ;; CVS | 1853 (apply 'vc-do-command nil 0 "cvs" file 'WORKFILE ;; CVS |
1846 "add" | 1854 "add" |
1847 (and comment (string-match "[^\t\n ]" comment) | 1855 (and comment (string-match "[^\t\n ]" comment) |
1848 (concat "-m" comment))) | 1856 (concat "-m" comment)) |
1857 switches) | |
1849 ))) | 1858 ))) |
1850 (message "Registering %s...done" file) | 1859 (message "Registering %s...done" file) |
1851 ) | 1860 ) |
1852 | 1861 |
1853 (defun vc-backend-checkout (file &optional writable rev workfile) | 1862 (defun vc-backend-checkout (file &optional writable rev workfile) |