Mercurial > emacs
comparison lisp/vc-sccs.el @ 31404:f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el: (toplevel): Don't require `dired' at run-time.
(vc-dired-resynch-file): Remove autoload cookie.
2000-09-05 Andre Spiegel <spiegel@gnu.org>
* vc.el: Made several backend functions optional.
(vc-default-responsible-p): New function.
(vc-merge): Use RET for first version to trigger merge-news, not
prefix arg.
(vc-annotate): Handle backends that do not support annotation.
(vc-default-merge-news): Removed. The existence of a merge-news
implementation is now checked on caller sites.
* vc-hooks.el (vc-default-mode-line-string): Removed CVS special
case.
* vc-cvs.el (vc-cvs-mode-line-string): New function, handles the
special case that has been removed from the default in vc-hooks.el.
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el (vc-log-edit): Properly handle the case where FILE is nil.
2000-09-05 Andre Spiegel <spiegel@gnu.org>
* vc-hooks.el: Require vc during compilation.
(vc-file-setprop): Use `vc-touched-properties' if bound by the new
macro `with-vc-properties' in vc.el.
(vc-file-getprop): Doc fix.
(vc-after-save): Call `vc-dired-resynch-file' only if vc is loaded.
* vc.el: Require dired-aux during compilation.
(vc-name-assoc-file): Moved to vc-sccs.el.
(with-vc-properties): New macro.
(vc-checkin, vc-checkout, vc-revert, vc-cancel-version,
vc-finish-steal): Use it.
(vc-cancel-version): Moved RCS-specific code to vc-rcs.el. The call
to the backend-specific function is now supposed to do the checkout,
too.
(vc-log-edit): Handle FILE being nil and added a FIXME for log-edit.
* vc-cvs.el (vc-cvs-checkin, vc-cvs-checkout): Don't bother to
set file properties; that gets done in the generic code now.
* vc-rcs.el (vc-rcs-uncheck): Renamed to `vc-rcs-cancel-version'.
Changed parameter list, added code from vc.el that does the
checkout, possibly with a double-take.
* vc-sccs.el (vc-sccs-name-assoc-file): Moved here from vc.el.
(vc-sccs-add-triple, vc-sccs-rename-file, vc-sccs-lookup-triple): Use
the above under the new name.
(vc-sccs-uncheck): Renamed to `vc-sccs-cancel-version'. Changed
parameter list, added checkout command.
(vc-sccs-checkin, vc-sccs-checkout): Don't bother to set file
properties; that gets done in the generic code now.
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el: Docstring fixes (courtesy of checkdoc).
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el (vc-checkout-writable-buffer-hook)
(vc-checkout-writable-buffer): Remove.
(vc-start-entry): Always call vc-log-edit, never vc-log-mode.
(vc-log-mode): Make it into a clean derived major mode.
(vc-log-edit): Mark buffer unmodified (as vc-log-mode did) and use
vc-log-mode if log-edit is not available.
(vc-dired-mode-map): Don't set-keymap-parent yet.
(vc-dired-mode): Do set-keymap-parent here.
(vc-dired-buffers-for-dir): Nop if dired is not loaded.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 05 Sep 2000 20:08:22 +0000 |
parents | b1e1a94dfc0a |
children | 1cfec89307a6 |
comparison
equal
deleted
inserted
replaced
31403:736bba059dd4 | 31404:f2ab9420390f |
---|---|
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.35 2000/08/13 11:52:19 spiegel Exp $ | 8 ;; $Id: vc-sccs.el,v 1.1 2000/09/04 19:48:23 gerd 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 |
54 (repeat :tag "User-specified" | 54 (repeat :tag "User-specified" |
55 (choice string | 55 (choice string |
56 function))) | 56 function))) |
57 :version "20.5" | 57 :version "20.5" |
58 :group 'vc) | 58 :group 'vc) |
59 | |
60 (defconst vc-sccs-name-assoc-file "VC-names") | |
59 | 61 |
60 ;;;###autoload | 62 ;;;###autoload |
61 (progn (defun vc-sccs-registered (f) (vc-default-registered 'SCCS f))) | 63 (progn (defun vc-sccs-registered (f) (vc-default-registered 'SCCS f))) |
62 | 64 |
63 (defun vc-sccs-state (file) | 65 (defun vc-sccs-state (file) |
170 ;; Named-configuration support | 172 ;; Named-configuration support |
171 | 173 |
172 (defun vc-sccs-add-triple (name file rev) | 174 (defun vc-sccs-add-triple (name file rev) |
173 (with-current-buffer | 175 (with-current-buffer |
174 (find-file-noselect | 176 (find-file-noselect |
175 (expand-file-name vc-name-assoc-file | 177 (expand-file-name vc-sccs-name-assoc-file |
176 (file-name-directory (vc-name file)))) | 178 (file-name-directory (vc-name file)))) |
177 (goto-char (point-max)) | 179 (goto-char (point-max)) |
178 (insert name "\t:\t" file "\t" rev "\n") | 180 (insert name "\t:\t" file "\t" rev "\n") |
179 (basic-save-buffer) | 181 (basic-save-buffer) |
180 (kill-buffer (current-buffer)))) | 182 (kill-buffer (current-buffer)))) |
183 ;; Move the master file (using vc-rcs-master-templates). | 185 ;; Move the master file (using vc-rcs-master-templates). |
184 (vc-rename-master (vc-name old) new vc-sccs-master-templates) | 186 (vc-rename-master (vc-name old) new vc-sccs-master-templates) |
185 ;; Update the snapshot file. | 187 ;; Update the snapshot file. |
186 (with-current-buffer | 188 (with-current-buffer |
187 (find-file-noselect | 189 (find-file-noselect |
188 (expand-file-name vc-name-assoc-file | 190 (expand-file-name vc-sccs-name-assoc-file |
189 (file-name-directory (vc-name old)))) | 191 (file-name-directory (vc-name old)))) |
190 (goto-char (point-min)) | 192 (goto-char (point-min)) |
191 ;; (replace-regexp (concat ":" (regexp-quote old) "$") (concat ":" new)) | 193 ;; (replace-regexp (concat ":" (regexp-quote old) "$") (concat ":" new)) |
192 (while (re-search-forward (concat ":" (regexp-quote old) "$") nil t) | 194 (while (re-search-forward (concat ":" (regexp-quote old) "$") nil t) |
193 (replace-match (concat ":" new) nil nil)) | 195 (replace-match (concat ":" new) nil nil)) |
201 (let ((firstchar (aref name 0))) | 203 (let ((firstchar (aref name 0))) |
202 (and (>= firstchar ?0) (<= firstchar ?9)))) | 204 (and (>= firstchar ?0) (<= firstchar ?9)))) |
203 name | 205 name |
204 (with-temp-buffer | 206 (with-temp-buffer |
205 (vc-insert-file | 207 (vc-insert-file |
206 (expand-file-name vc-name-assoc-file | 208 (expand-file-name vc-sccs-name-assoc-file |
207 (file-name-directory (vc-name file)))) | 209 (file-name-directory (vc-name file)))) |
208 (vc-parse-buffer (concat name "\t:\t" file "\t\\(.+\\)") 1)))) | 210 (vc-parse-buffer (concat name "\t:\t" file "\t\\(.+\\)") 1)))) |
209 | 211 |
210 (defun vc-sccs-merge (file first-version &optional second-version) | 212 (defun vc-sccs-merge (file first-version &optional second-version) |
211 (error "Merging not implemented for SCCS")) | 213 (error "Merging not implemented for SCCS")) |
219 (defun vc-sccs-steal-lock (file &optional rev) | 221 (defun vc-sccs-steal-lock (file &optional rev) |
220 "Steal the lock on the current workfile for FILE and revision REV." | 222 "Steal the lock on the current workfile for FILE and revision REV." |
221 (vc-do-command nil 0 "unget" (vc-name file) "-n" (if rev (concat "-r" rev))) | 223 (vc-do-command nil 0 "unget" (vc-name file) "-n" (if rev (concat "-r" rev))) |
222 (vc-do-command nil 0 "get" (vc-name file) "-g" (if rev (concat "-r" rev)))) | 224 (vc-do-command nil 0 "get" (vc-name file) "-g" (if rev (concat "-r" rev)))) |
223 | 225 |
224 (defun vc-sccs-uncheck (file target) | 226 (defun vc-sccs-cancel-version (file writable) |
225 "Undo the checkin of FILE's revision TARGET." | 227 "Undo the most recent checkin of FILE. |
226 (vc-do-command nil 0 "rmdel" (vc-name file) (concat "-r" target))) | 228 WRITABLE non-nil means previous version should be locked." |
229 (vc-do-command nil 0 "rmdel" | |
230 (vc-name file) | |
231 (concat "-r" (vc-workfile-version file))) | |
232 (vc-do-command nil 0 "get" | |
233 (vc-name file) | |
234 (if writable "-e"))) | |
227 | 235 |
228 (defun vc-sccs-revert (file) | 236 (defun vc-sccs-revert (file) |
229 "Revert FILE to the version it was based on." | 237 "Revert FILE to the version it was based on." |
230 (vc-do-command nil 0 "unget" (vc-name file)) | 238 (vc-do-command nil 0 "unget" (vc-name file)) |
231 (vc-do-command nil 0 "get" (vc-name file)) | 239 (vc-do-command nil 0 "get" (vc-name file)) |
241 vc-checkin-switches))) | 249 vc-checkin-switches))) |
242 (apply 'vc-do-command nil 0 "delta" (vc-name file) | 250 (apply 'vc-do-command nil 0 "delta" (vc-name file) |
243 (if rev (concat "-r" rev)) | 251 (if rev (concat "-r" rev)) |
244 (concat "-y" comment) | 252 (concat "-y" comment) |
245 switches) | 253 switches) |
246 (vc-file-setprop file 'vc-state 'up-to-date) | |
247 (vc-file-setprop file 'vc-workfile-version nil) | |
248 (if vc-keep-workfiles | 254 (if vc-keep-workfiles |
249 (vc-do-command nil 0 "get" (vc-name file))))) | 255 (vc-do-command nil 0 "get" (vc-name file))))) |
250 | 256 |
251 (defun vc-sccs-latest-on-branch-p (file) | 257 (defun vc-sccs-latest-on-branch-p (file) |
252 "Return t iff the current workfile version of FILE is the latest on | 258 "Return t iff the current workfile version of FILE is the latest on |
369 (and failed (file-exists-p filename) | 375 (and failed (file-exists-p filename) |
370 (delete-file filename)))) | 376 (delete-file filename)))) |
371 (apply 'vc-do-command nil 0 "get" (vc-name file) | 377 (apply 'vc-do-command nil 0 "get" (vc-name file) |
372 (if writable "-e") | 378 (if writable "-e") |
373 (and rev (concat "-r" (vc-sccs-lookup-triple file rev))) | 379 (and rev (concat "-r" (vc-sccs-lookup-triple file rev))) |
374 switches) | 380 switches))))) |
375 (vc-file-setprop file 'vc-workfile-version nil)) | 381 (message "Checking out %s...done" filename))) |
376 (unless workfile | |
377 (if writable | |
378 (vc-file-setprop file 'vc-state 'edited)) | |
379 (vc-file-setprop file | |
380 'vc-checkout-time (nth 5 (file-attributes file)))) | |
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) |