diff options
| author | Stefan Monnier | 2003-05-08 19:18:33 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-05-08 19:18:33 +0000 |
| commit | dc0f87c9f5dfc0fde817fb81d746c3bde2932758 (patch) | |
| tree | 960d4217c9c828f091ae8cf36d40f16f4cedc53b | |
| parent | d011ca0f9b1f97f8076cb74364ad3ae5e23bf6f0 (diff) | |
| download | emacs-dc0f87c9f5dfc0fde817fb81d746c3bde2932758.tar.gz emacs-dc0f87c9f5dfc0fde817fb81d746c3bde2932758.zip | |
(vc-sccs-register, vc-sccs-checkin)
(vc-sccs-find-version, vc-sccs-checkout, vc-sccs-diff): Use vc-switches.
(vc-sccs-register): Remove unused var `|'.
| -rw-r--r-- | lisp/vc-sccs.el | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/lisp/vc-sccs.el b/lisp/vc-sccs.el index ac11190a77f..352218b6c4d 100644 --- a/lisp/vc-sccs.el +++ b/lisp/vc-sccs.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: FSF (see vc.el for full credits) | 5 | ;; Author: FSF (see vc.el for full credits) |
| 6 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> | 6 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
| 7 | 7 | ||
| 8 | ;; $Id: vc-sccs.el,v 1.20 2002/12/26 14:07:15 spiegel Exp $ | 8 | ;; $Id: vc-sccs.el,v 1.21 2003/02/04 12:11:54 lektu Exp $ |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| @@ -166,25 +166,18 @@ the SCCS command (in that order). | |||
| 166 | 166 | ||
| 167 | Automatically retrieve a read-only version of the file with keywords | 167 | Automatically retrieve a read-only version of the file with keywords |
| 168 | expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile." | 168 | expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile." |
| 169 | (let* ((switches (append | 169 | (let* ((dirname (or (file-name-directory file) "")) |
| 170 | (if (stringp vc-register-switches) | ||
| 171 | (list vc-register-switches) | ||
| 172 | vc-register-switches) | ||
| 173 | (if (stringp vc-sccs-register-switches) | ||
| 174 | (list vc-sccs-register-switches) | ||
| 175 | vc-sccs-register-switches))) | ||
| 176 | (dirname (or (file-name-directory file) "")) | ||
| 177 | (basename (file-name-nondirectory file)) | 170 | (basename (file-name-nondirectory file)) |
| 178 | (project-file (vc-sccs-search-project-dir dirname basename))) | 171 | (project-file (vc-sccs-search-project-dir dirname basename))) |
| 179 | (let ((vc-name | 172 | (let ((vc-name |
| 180 | (or project-file | 173 | (or project-file |
| 181 | (format (car vc-sccs-master-templates) dirname basename)))|) | 174 | (format (car vc-sccs-master-templates) dirname basename)))) |
| 182 | (apply 'vc-do-command nil 0 "admin" vc-name | 175 | (apply 'vc-do-command nil 0 "admin" vc-name |
| 183 | (and rev (concat "-r" rev)) | 176 | (and rev (concat "-r" rev)) |
| 184 | "-fb" | 177 | "-fb" |
| 185 | (concat "-i" (file-relative-name file)) | 178 | (concat "-i" (file-relative-name file)) |
| 186 | (and comment (concat "-y" comment)) | 179 | (and comment (concat "-y" comment)) |
| 187 | switches)) | 180 | (vc-switches 'SCCS 'register))) |
| 188 | (delete-file file) | 181 | (delete-file file) |
| 189 | (if vc-keep-workfiles | 182 | (if vc-keep-workfiles |
| 190 | (vc-do-command nil 0 "get" (vc-name file))))) | 183 | (vc-do-command nil 0 "get" (vc-name file))))) |
| @@ -198,15 +191,12 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile." | |||
| 198 | 191 | ||
| 199 | (defun vc-sccs-checkin (file rev comment) | 192 | (defun vc-sccs-checkin (file rev comment) |
| 200 | "SCCS-specific version of `vc-backend-checkin'." | 193 | "SCCS-specific version of `vc-backend-checkin'." |
| 201 | (let ((switches (if (stringp vc-checkin-switches) | 194 | (apply 'vc-do-command nil 0 "delta" (vc-name file) |
| 202 | (list vc-checkin-switches) | 195 | (if rev (concat "-r" rev)) |
| 203 | vc-checkin-switches))) | 196 | (concat "-y" comment) |
| 204 | (apply 'vc-do-command nil 0 "delta" (vc-name file) | 197 | (vc-switches 'SCCS 'checkin)) |
| 205 | (if rev (concat "-r" rev)) | 198 | (if vc-keep-workfiles |
| 206 | (concat "-y" comment) | 199 | (vc-do-command nil 0 "get" (vc-name file)))) |
| 207 | switches) | ||
| 208 | (if vc-keep-workfiles | ||
| 209 | (vc-do-command nil 0 "get" (vc-name file))))) | ||
| 210 | 200 | ||
| 211 | (defun vc-sccs-find-version (file rev buffer) | 201 | (defun vc-sccs-find-version (file rev buffer) |
| 212 | (apply 'vc-do-command | 202 | (apply 'vc-do-command |
| @@ -216,9 +206,7 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile." | |||
| 216 | (and rev | 206 | (and rev |
| 217 | (concat "-r" | 207 | (concat "-r" |
| 218 | (vc-sccs-lookup-triple file rev))) | 208 | (vc-sccs-lookup-triple file rev))) |
| 219 | (if (stringp vc-checkout-switches) | 209 | (vc-switches 'SCCS 'checkout))) |
| 220 | (list vc-checkout-switches) | ||
| 221 | vc-checkout-switches))) | ||
| 222 | 210 | ||
| 223 | (defun vc-sccs-checkout (file &optional editable rev) | 211 | (defun vc-sccs-checkout (file &optional editable rev) |
| 224 | "Retrieve a copy of a saved version of SCCS controlled FILE. | 212 | "Retrieve a copy of a saved version of SCCS controlled FILE. |
| @@ -230,9 +218,7 @@ locked. REV is the revision to check out." | |||
| 230 | (save-excursion | 218 | (save-excursion |
| 231 | ;; Change buffers to get local value of vc-checkout-switches. | 219 | ;; Change buffers to get local value of vc-checkout-switches. |
| 232 | (if file-buffer (set-buffer file-buffer)) | 220 | (if file-buffer (set-buffer file-buffer)) |
| 233 | (setq switches (if (stringp vc-checkout-switches) | 221 | (setq switches (vc-switches 'SCCS 'checkout)) |
| 234 | (list vc-checkout-switches) | ||
| 235 | vc-checkout-switches)) | ||
| 236 | ;; Save this buffer's default-directory | 222 | ;; Save this buffer's default-directory |
| 237 | ;; and use save-excursion to make sure it is restored | 223 | ;; and use save-excursion to make sure it is restored |
| 238 | ;; in the same buffer it was saved in. | 224 | ;; in the same buffer it was saved in. |
| @@ -298,7 +284,7 @@ EDITABLE non-nil means previous version should be locked." | |||
| 298 | (append (list "-q" | 284 | (append (list "-q" |
| 299 | (and oldvers (concat "-r" oldvers)) | 285 | (and oldvers (concat "-r" oldvers)) |
| 300 | (and newvers (concat "-r" newvers))) | 286 | (and newvers (concat "-r" newvers))) |
| 301 | (vc-diff-switches-list 'SCCS)))) | 287 | (vc-switches 'SCCS 'diff)))) |
| 302 | 288 | ||
| 303 | 289 | ||
| 304 | ;;; | 290 | ;;; |