Mercurial > emacs
comparison lisp/vc-sccs.el @ 31477:1cfec89307a6
Doc fixes.
(vc-sccs-register-switches, vc-sccs-master-templates): Add
:version.
author | Dave Love <fx@gnu.org> |
---|---|
date | Thu, 07 Sep 2000 20:06:55 +0000 |
parents | f2ab9420390f |
children | f9d2d484e1e2 |
comparison
equal
deleted
inserted
replaced
31476:18bf0c070870 | 31477:1cfec89307a6 |
---|---|
3 ;; Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc. |
4 | 4 |
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.1 2000/09/04 19:48:23 gerd Exp $ | 8 ;; $Id: vc-sccs.el,v 1.2 2000/09/05 20:08:22 monnier Exp $ |
9 | 9 |
10 ;; This file is part of GNU Emacs. | 10 ;; This file is part of GNU Emacs. |
11 | 11 |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | 12 ;; GNU Emacs is free software; you can redistribute it and/or modify |
13 ;; it under the terms of the GNU General Public License as published by | 13 ;; it under the terms of the GNU General Public License as published by |
27 ;;; Commentary: | 27 ;;; Commentary: |
28 | 28 |
29 ;;; Code: | 29 ;;; Code: |
30 | 30 |
31 (defcustom vc-sccs-register-switches nil | 31 (defcustom vc-sccs-register-switches nil |
32 "*A string or list of strings; extra switches for registering a file | 32 "*Extra switches for registering a file in SCCS. |
33 in |SCCS. These are passed to the checkin program by | 33 A string or list of strings passed to the checkin program by |
34 \\[vc-sccs-register]." | 34 \\[vc-sccs-register]." |
35 :type '(choice (const :tag "None" nil) | 35 :type '(choice (const :tag "None" nil) |
36 (string :tag "Argument String") | 36 (string :tag "Argument String") |
37 (repeat :tag "Argument List" | 37 (repeat :tag "Argument List" |
38 :value ("") | 38 :value ("") |
39 string)) | 39 string)) |
40 :version "21.1" | |
40 :group 'vc) | 41 :group 'vc) |
41 | 42 |
42 (defcustom vc-sccs-header (or (cdr (assoc 'SCCS vc-header-alist)) '("%W%")) | 43 (defcustom vc-sccs-header (or (cdr (assoc 'SCCS vc-header-alist)) '("%W%")) |
43 "*Header keywords to be inserted by `vc-insert-headers'." | 44 "*Header keywords to be inserted by `vc-insert-headers'." |
44 :type 'string | 45 :type 'string |
52 :type '(choice (const :tag "Use standard SCCS file names" | 53 :type '(choice (const :tag "Use standard SCCS file names" |
53 ("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir)) | 54 ("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir)) |
54 (repeat :tag "User-specified" | 55 (repeat :tag "User-specified" |
55 (choice string | 56 (choice string |
56 function))) | 57 function))) |
57 :version "20.5" | 58 :version "21.1" |
58 :group 'vc) | 59 :group 'vc) |
59 | 60 |
60 (defconst vc-sccs-name-assoc-file "VC-names") | 61 (defconst vc-sccs-name-assoc-file "VC-names") |
61 | 62 |
62 ;;;###autoload | 63 ;;;###autoload |
94 'up-to-date | 95 'up-to-date |
95 (if (string-match ".rw..-..-." permissions) | 96 (if (string-match ".rw..-..-." permissions) |
96 (if (file-ownership-preserved-p file) | 97 (if (file-ownership-preserved-p file) |
97 'edited | 98 'edited |
98 (vc-user-login-name owner-uid)) | 99 (vc-user-login-name owner-uid)) |
99 ;; Strange permissions. | 100 ;; Strange permissions. |
100 ;; Fall through to real state computation. | 101 ;; Fall through to real state computation. |
101 (vc-sccs-state file))) | 102 (vc-sccs-state file))) |
102 (vc-sccs-state file)))) | 103 (vc-sccs-state file)))) |
103 | 104 |
104 (defun vc-sccs-workfile-version (file) | 105 (defun vc-sccs-workfile-version (file) |
105 "SCCS-specific version of `vc-workfile-version'." | 106 "SCCS-specific version of `vc-workfile-version'." |
106 (with-temp-buffer | 107 (with-temp-buffer |
107 (vc-insert-file (vc-name file) "^\001e") | 108 (vc-insert-file (vc-name file) "^\001e") |
108 (vc-parse-buffer "^\001d D \\([^ ]+\\)" 1))) | 109 (vc-parse-buffer "^\001d D \\([^ ]+\\)" 1))) |
109 | 110 |
110 (defun vc-sccs-checkout-model (file) | 111 (defun vc-sccs-checkout-model (file) |
111 "SCCS-specific version of `vc-checkout-model'." | 112 "SCCS-specific version of `vc-checkout-model'." |
112 'locking) | 113 'locking) |
113 | 114 |
114 (defun vc-sccs-workfile-unchanged-p (file) | 115 (defun vc-sccs-workfile-unchanged-p (file) |
115 "SCCS-specific implementation of vc-workfile-unchanged-p." | 116 "SCCS-specific implementation of vc-workfile-unchanged-p." |
116 (apply 'vc-do-command nil 1 "vcdiff" (vc-name file) | 117 (apply 'vc-do-command nil 1 "vcdiff" (vc-name file) |
117 (list "--brief" "-q" | 118 (list "--brief" "-q" |
118 (concat "-r" (vc-workfile-version file))))) | 119 (concat "-r" (vc-workfile-version file))))) |
119 | 120 |
120 ;; internal code | 121 ;; internal code |
121 | 122 |
122 ;; This function is wrapped with `progn' so that the autoload cookie | 123 ;; This function is wrapped with `progn' so that the autoload cookie |
197 (kill-buffer (current-buffer)))) | 198 (kill-buffer (current-buffer)))) |
198 | 199 |
199 (defun vc-sccs-lookup-triple (file name) | 200 (defun vc-sccs-lookup-triple (file name) |
200 "Return the numeric version corresponding to a named snapshot of FILE. | 201 "Return the numeric version corresponding to a named snapshot of FILE. |
201 If NAME is nil or a version number string it's just passed through." | 202 If NAME is nil or a version number string it's just passed through." |
202 (if (or (null name) | 203 (if (or (null name) |
203 (let ((firstchar (aref name 0))) | 204 (let ((firstchar (aref name 0))) |
204 (and (>= firstchar ?0) (<= firstchar ?9)))) | 205 (and (>= firstchar ?0) (<= firstchar ?9)))) |
205 name | 206 name |
206 (with-temp-buffer | 207 (with-temp-buffer |
207 (vc-insert-file | 208 (vc-insert-file |
222 "Steal the lock on the current workfile for FILE and revision REV." | 223 "Steal the lock on the current workfile for FILE and revision REV." |
223 (vc-do-command nil 0 "unget" (vc-name file) "-n" (if rev (concat "-r" rev))) | 224 (vc-do-command nil 0 "unget" (vc-name file) "-n" (if rev (concat "-r" rev))) |
224 (vc-do-command nil 0 "get" (vc-name file) "-g" (if rev (concat "-r" rev)))) | 225 (vc-do-command nil 0 "get" (vc-name file) "-g" (if rev (concat "-r" rev)))) |
225 | 226 |
226 (defun vc-sccs-cancel-version (file writable) | 227 (defun vc-sccs-cancel-version (file writable) |
227 "Undo the most recent checkin of FILE. | 228 "Undo the most recent checkin of FILE. |
228 WRITABLE non-nil means previous version should be locked." | 229 WRITABLE non-nil means previous version should be locked." |
229 (vc-do-command nil 0 "rmdel" | 230 (vc-do-command nil 0 "rmdel" |
230 (vc-name file) | 231 (vc-name file) |
231 (concat "-r" (vc-workfile-version file))) | 232 (concat "-r" (vc-workfile-version file))) |
232 (vc-do-command nil 0 "get" | 233 (vc-do-command nil 0 "get" |
233 (vc-name file) | 234 (vc-name file) |
234 (if writable "-e"))) | 235 (if writable "-e"))) |
235 | 236 |
253 switches) | 254 switches) |
254 (if vc-keep-workfiles | 255 (if vc-keep-workfiles |
255 (vc-do-command nil 0 "get" (vc-name file))))) | 256 (vc-do-command nil 0 "get" (vc-name file))))) |
256 | 257 |
257 (defun vc-sccs-latest-on-branch-p (file) | 258 (defun vc-sccs-latest-on-branch-p (file) |
258 "Return t iff the current workfile version of FILE is the latest on | 259 "Return t iff the current workfile version of FILE is latest on its branch." |
259 its branch." | |
260 ;; Always return t; we do not support previous versions in the workfile | 260 ;; Always return t; we do not support previous versions in the workfile |
261 ;; under SCCS. | 261 ;; under SCCS. |
262 t) | 262 t) |
263 | 263 |
264 (defun vc-sccs-logentry-check () | 264 (defun vc-sccs-logentry-check () |
309 (basename (file-name-nondirectory file)) | 309 (basename (file-name-nondirectory file)) |
310 (project-file (vc-sccs-search-project-dir dirname basename))) | 310 (project-file (vc-sccs-search-project-dir dirname basename))) |
311 (let ((vc-name | 311 (let ((vc-name |
312 (or project-file | 312 (or project-file |
313 (format (car vc-sccs-master-templates) dirname basename)))|) | 313 (format (car vc-sccs-master-templates) dirname basename)))|) |
314 (apply 'vc-do-command nil 0 "admin" nil | 314 (apply 'vc-do-command nil 0 "admin" nil |
315 (and rev (concat "-r" rev)) | 315 (and rev (concat "-r" rev)) |
316 "-fb" | 316 "-fb" |
317 (concat "-i" file) | 317 (concat "-i" file) |
318 (and comment (concat "-y" comment)) | 318 (and comment (concat "-y" comment)) |
319 vc-name | 319 vc-name |
321 (delete-file file) | 321 (delete-file file) |
322 (if vc-keep-workfiles | 322 (if vc-keep-workfiles |
323 (vc-do-command nil 0 "get" (vc-name file))))) | 323 (vc-do-command nil 0 "get" (vc-name file))))) |
324 | 324 |
325 (defun vc-sccs-checkout (file &optional writable rev workfile) | 325 (defun vc-sccs-checkout (file &optional writable rev workfile) |
326 "Retrieve a copy of a saved version of an SCCS controlled FILE into | 326 "Retrieve a copy of a saved version of SCCS controlled FILE into a WORKFILE. |
327 a WORKFILE. WRITABLE non-nil means that the file should be writable. | 327 WRITABLE non-nil means that the file should be writable. REV is the |
328 REV is the revision to check out into WORKFILE." | 328 revision to check out into WORKFILE." |
329 (let ((filename (or workfile file)) | 329 (let ((filename (or workfile file)) |
330 (file-buffer (get-file-buffer file)) | 330 (file-buffer (get-file-buffer file)) |
331 switches) | 331 switches) |
332 (message "Checking out %s..." filename) | 332 (message "Checking out %s..." filename) |
333 (save-excursion | 333 (save-excursion |
361 (with-temp-file filename | 361 (with-temp-file filename |
362 (apply 'vc-do-command | 362 (apply 'vc-do-command |
363 (current-buffer) 0 "get" (vc-name file) | 363 (current-buffer) 0 "get" (vc-name file) |
364 "-s" ;; suppress diagnostic output | 364 "-s" ;; suppress diagnostic output |
365 (if writable "-e") | 365 (if writable "-e") |
366 "-p" | 366 "-p" |
367 (and rev | 367 (and rev |
368 (concat "-r" | 368 (concat "-r" |
369 (vc-sccs-lookup-triple file rev))) | 369 (vc-sccs-lookup-triple file rev))) |
370 switches))) | 370 switches))) |
371 (set-file-modes filename | 371 (set-file-modes filename |
372 (logior (file-modes (vc-name file)) | 372 (logior (file-modes (vc-name file)) |
373 (if writable 128 0))) | 373 (if writable 128 0))) |
379 (and rev (concat "-r" (vc-sccs-lookup-triple file rev))) | 379 (and rev (concat "-r" (vc-sccs-lookup-triple file rev))) |
380 switches))))) | 380 switches))))) |
381 (message "Checking out %s...done" filename))) | 381 (message "Checking out %s...done" filename))) |
382 | 382 |
383 (defun vc-sccs-update-changelog (files) | 383 (defun vc-sccs-update-changelog (files) |
384 (error "Sorry, generating ChangeLog entries is not implemented for SCCS.")) | 384 (error "Sorry, generating ChangeLog entries is not implemented for SCCS")) |
385 | 385 |
386 (provide 'vc-sccs) | 386 (provide 'vc-sccs) |
387 | 387 |
388 ;;; vc-sccs.el ends here | 388 ;;; vc-sccs.el ends here |