Mercurial > emacs
annotate lisp/vc-sccs.el @ 31395:d0f522cf422b
(Fother_buffer): Consider buffers as invisible when
they are displayed in a window on an invisible frame.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 05 Sep 2000 13:01:56 +0000 |
parents | b1e1a94dfc0a |
children | f2ab9420390f |
rev | line source |
---|---|
31385
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
1 ;;; vc-sccs.el --- support for SCCS version-control |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
2 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
3 ;; Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
4 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
5 ;; Author: FSF (see vc.el for full credits) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
7 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
8 ;; $Id: vc-sccs.el,v 1.35 2000/08/13 11:52:19 spiegel Exp $ |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
9 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
10 ;; This file is part of GNU Emacs. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
11 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
12 ;; GNU Emacs is free software; you can redistribute it and/or modify |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
13 ;; it under the terms of the GNU General Public License as published by |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
14 ;; the Free Software Foundation; either version 2, or (at your option) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
15 ;; any later version. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
16 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
17 ;; GNU Emacs is distributed in the hope that it will be useful, |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
20 ;; GNU General Public License for more details. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
21 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
22 ;; You should have received a copy of the GNU General Public License |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
25 ;; Boston, MA 02111-1307, USA. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
26 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
27 ;;; Commentary: |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
28 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
29 ;;; Code: |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
30 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
31 (defcustom vc-sccs-register-switches nil |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
32 "*A string or list of strings; extra switches for registering a file |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
33 in |SCCS. These are passed to the checkin program by |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
34 \\[vc-sccs-register]." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
35 :type '(choice (const :tag "None" nil) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
36 (string :tag "Argument String") |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
37 (repeat :tag "Argument List" |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
38 :value ("") |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
39 string)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
40 :group 'vc) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
41 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
42 (defcustom vc-sccs-header (or (cdr (assoc 'SCCS vc-header-alist)) '("%W%")) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
43 "*Header keywords to be inserted by `vc-insert-headers'." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
44 :type 'string |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
45 :group 'vc) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
46 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
47 ;;;###autoload |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
48 (defcustom vc-sccs-master-templates |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
49 '("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
50 "*Where to look for SCCS master files. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
51 For a description of possible values, see `vc-check-master-templates'." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
52 :type '(choice (const :tag "Use standard SCCS file names" |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
53 ("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
54 (repeat :tag "User-specified" |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
55 (choice string |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
56 function))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
57 :version "20.5" |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
58 :group 'vc) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
59 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
60 ;;;###autoload |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
61 (progn (defun vc-sccs-registered (f) (vc-default-registered 'SCCS f))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
62 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
63 (defun vc-sccs-state (file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
64 "SCCS-specific function to compute the version control state." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
65 (with-temp-buffer |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
66 (if (vc-insert-file (vc-sccs-lock-file file)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
67 (let* ((locks (vc-sccs-parse-locks)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
68 (workfile-version (vc-workfile-version file)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
69 (locking-user (cdr (assoc workfile-version locks)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
70 (if (not locking-user) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
71 (if (vc-workfile-unchanged-p file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
72 'up-to-date |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
73 'unlocked-changes) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
74 (if (string= locking-user (vc-user-login-name)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
75 'edited |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
76 locking-user))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
77 'up-to-date))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
78 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
79 (defun vc-sccs-state-heuristic (file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
80 "SCCS-specific state heuristic." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
81 (if (not (vc-mistrust-permissions file)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
82 ;; This implementation assumes that any file which is under version |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
83 ;; control and has -rw-r--r-- is locked by its owner. This is true |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
84 ;; for both RCS and SCCS, which keep unlocked files at -r--r--r--. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
85 ;; We have to be careful not to exclude files with execute bits on; |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
86 ;; scripts can be under version control too. Also, we must ignore the |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
87 ;; group-read and other-read bits, since paranoid users turn them off. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
88 (let* ((attributes (file-attributes file)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
89 (owner-uid (nth 2 attributes)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
90 (permissions (nth 8 attributes))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
91 (if (string-match ".r-..-..-." permissions) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
92 'up-to-date |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
93 (if (string-match ".rw..-..-." permissions) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
94 (if (file-ownership-preserved-p file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
95 'edited |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
96 (vc-user-login-name owner-uid)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
97 ;; Strange permissions. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
98 ;; Fall through to real state computation. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
99 (vc-sccs-state file))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
100 (vc-sccs-state file)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
101 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
102 (defun vc-sccs-workfile-version (file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
103 "SCCS-specific version of `vc-workfile-version'." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
104 (with-temp-buffer |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
105 (vc-insert-file (vc-name file) "^\001e") |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
106 (vc-parse-buffer "^\001d D \\([^ ]+\\)" 1))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
107 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
108 (defun vc-sccs-checkout-model (file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
109 "SCCS-specific version of `vc-checkout-model'." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
110 'locking) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
111 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
112 (defun vc-sccs-workfile-unchanged-p (file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
113 "SCCS-specific implementation of vc-workfile-unchanged-p." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
114 (apply 'vc-do-command nil 1 "vcdiff" (vc-name file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
115 (list "--brief" "-q" |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
116 (concat "-r" (vc-workfile-version file))))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
117 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
118 ;; internal code |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
119 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
120 ;; This function is wrapped with `progn' so that the autoload cookie |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
121 ;; copies the whole function itself into loaddefs.el rather than just placing |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
122 ;; a (autoload 'vc-sccs-search-project-dir "vc-sccs") which would not |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
123 ;; help us avoid loading vc-sccs. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
124 ;;;###autoload |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
125 (progn (defun vc-sccs-search-project-dir (dirname basename) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
126 "Return the name of a master file in the SCCS project directory. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
127 Does not check whether the file exists but returns nil if it does not |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
128 find any project directory." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
129 (let ((project-dir (getenv "PROJECTDIR")) dirs dir) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
130 (when project-dir |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
131 (if (file-name-absolute-p project-dir) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
132 (setq dirs '("SCCS" "")) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
133 (setq dirs '("src/SCCS" "src" "source/SCCS" "source")) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
134 (setq project-dir (expand-file-name (concat "~" project-dir)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
135 (while (and (not dir) dirs) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
136 (setq dir (expand-file-name (car dirs) project-dir)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
137 (unless (file-directory-p dir) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
138 (setq dir nil) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
139 (setq dirs (cdr dirs)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
140 (and dir (expand-file-name (concat "s." basename) dir)))))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
141 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
142 (defun vc-sccs-lock-file (file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
143 "Generate lock file name corresponding to FILE." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
144 (let ((master (vc-name file))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
145 (and |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
146 master |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
147 (string-match "\\(.*/\\)\\(s\\.\\)\\(.*\\)" master) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
148 (replace-match "p." t t master 2)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
149 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
150 (defun vc-sccs-parse-locks () |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
151 "Parse SCCS locks in current buffer. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
152 The result is a list of the form ((VERSION . USER) (VERSION . USER) ...)." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
153 (let (master-locks) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
154 (goto-char (point-min)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
155 (while (re-search-forward "^\\([0-9.]+\\) [0-9.]+ \\([^ ]+\\) .*\n?" |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
156 nil t) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
157 (setq master-locks |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
158 (cons (cons (match-string 1) (match-string 2)) master-locks))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
159 ;; FIXME: is it really necessary to reverse ? |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
160 (nreverse master-locks))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
161 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
162 (defun vc-sccs-print-log (file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
163 "Get change log associated with FILE." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
164 (vc-do-command t 0 "prs" (vc-name file))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
165 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
166 (defun vc-sccs-assign-name (file name) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
167 "Assign to FILE's latest version a given NAME." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
168 (vc-sccs-add-triple name file (vc-workfile-version file))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
169 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
170 ;; Named-configuration support |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
171 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
172 (defun vc-sccs-add-triple (name file rev) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
173 (with-current-buffer |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
174 (find-file-noselect |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
175 (expand-file-name vc-name-assoc-file |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
176 (file-name-directory (vc-name file)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
177 (goto-char (point-max)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
178 (insert name "\t:\t" file "\t" rev "\n") |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
179 (basic-save-buffer) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
180 (kill-buffer (current-buffer)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
181 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
182 (defun vc-sccs-rename-file (old new) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
183 ;; Move the master file (using vc-rcs-master-templates). |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
184 (vc-rename-master (vc-name old) new vc-sccs-master-templates) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
185 ;; Update the snapshot file. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
186 (with-current-buffer |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
187 (find-file-noselect |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
188 (expand-file-name vc-name-assoc-file |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
189 (file-name-directory (vc-name old)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
190 (goto-char (point-min)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
191 ;; (replace-regexp (concat ":" (regexp-quote old) "$") (concat ":" new)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
192 (while (re-search-forward (concat ":" (regexp-quote old) "$") nil t) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
193 (replace-match (concat ":" new) nil nil)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
194 (basic-save-buffer) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
195 (kill-buffer (current-buffer)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
196 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
197 (defun vc-sccs-lookup-triple (file name) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
198 "Return the numeric version corresponding to a named snapshot of FILE. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
199 If NAME is nil or a version number string it's just passed through." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
200 (if (or (null name) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
201 (let ((firstchar (aref name 0))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
202 (and (>= firstchar ?0) (<= firstchar ?9)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
203 name |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
204 (with-temp-buffer |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
205 (vc-insert-file |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
206 (expand-file-name vc-name-assoc-file |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
207 (file-name-directory (vc-name file)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
208 (vc-parse-buffer (concat name "\t:\t" file "\t\\(.+\\)") 1)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
209 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
210 (defun vc-sccs-merge (file first-version &optional second-version) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
211 (error "Merging not implemented for SCCS")) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
212 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
213 (defun vc-sccs-check-headers () |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
214 "Check if the current file has any headers in it." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
215 (save-excursion |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
216 (goto-char (point-min)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
217 (re-search-forward "%[A-Z]%" nil t))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
218 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
219 (defun vc-sccs-steal-lock (file &optional rev) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
220 "Steal the lock on the current workfile for FILE and revision REV." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
221 (vc-do-command nil 0 "unget" (vc-name file) "-n" (if rev (concat "-r" rev))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
222 (vc-do-command nil 0 "get" (vc-name file) "-g" (if rev (concat "-r" rev)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
223 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
224 (defun vc-sccs-uncheck (file target) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
225 "Undo the checkin of FILE's revision TARGET." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
226 (vc-do-command nil 0 "rmdel" (vc-name file) (concat "-r" target))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
227 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
228 (defun vc-sccs-revert (file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
229 "Revert FILE to the version it was based on." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
230 (vc-do-command nil 0 "unget" (vc-name file)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
231 (vc-do-command nil 0 "get" (vc-name file)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
232 ;; Checking out explicit versions is not supported under SCCS, yet. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
233 ;; We always "revert" to the latest version; therefore |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
234 ;; vc-workfile-version is cleared here so that it gets recomputed. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
235 (vc-file-setprop file 'vc-workfile-version nil)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
236 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
237 (defun vc-sccs-checkin (file rev comment) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
238 "SCCS-specific version of `vc-backend-checkin'." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
239 (let ((switches (if (stringp vc-checkin-switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
240 (list vc-checkin-switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
241 vc-checkin-switches))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
242 (apply 'vc-do-command nil 0 "delta" (vc-name file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
243 (if rev (concat "-r" rev)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
244 (concat "-y" comment) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
245 switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
246 (vc-file-setprop file 'vc-state 'up-to-date) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
247 (vc-file-setprop file 'vc-workfile-version nil) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
248 (if vc-keep-workfiles |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
249 (vc-do-command nil 0 "get" (vc-name file))))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
250 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
251 (defun vc-sccs-latest-on-branch-p (file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
252 "Return t iff the current workfile version of FILE is the latest on |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
253 its branch." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
254 ;; Always return t; we do not support previous versions in the workfile |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
255 ;; under SCCS. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
256 t) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
257 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
258 (defun vc-sccs-logentry-check () |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
259 "Check that the log entry in the current buffer is acceptable for SCCS." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
260 (when (>= (buffer-size) 512) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
261 (goto-char 512) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
262 (error "Log must be less than 512 characters; point is now at pos 512"))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
263 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
264 (defun vc-sccs-diff (file &optional oldvers newvers) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
265 "Get a difference report using SCCS between two versions of FILE." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
266 (setq oldvers (vc-sccs-lookup-triple file oldvers)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
267 (setq newvers (vc-sccs-lookup-triple file newvers)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
268 (let* ((diff-switches-list (if (listp diff-switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
269 diff-switches |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
270 (list diff-switches))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
271 (options (append (list "-q" |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
272 (and oldvers (concat "-r" oldvers)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
273 (and newvers (concat "-r" newvers))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
274 diff-switches-list))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
275 (apply 'vc-do-command t 1 "vcdiff" (vc-name file) options))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
276 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
277 (defun vc-sccs-responsible-p (file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
278 "Return non-nil if SCCS thinks it would be responsible for registering FILE." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
279 ;; TODO: check for all the patterns in vc-sccs-master-templates |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
280 (or (file-directory-p (expand-file-name "SCCS" (file-name-directory file))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
281 (stringp (vc-sccs-search-project-dir (or (file-name-directory file) "") |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
282 (file-name-nondirectory file))))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
283 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
284 (defun vc-sccs-register (file &optional rev comment) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
285 "Register FILE into the SCCS version-control system. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
286 REV is the optional revision number for the file. COMMENT can be used |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
287 to provide an initial description of FILE. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
288 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
289 `vc-register-switches' and `vc-sccs-register-switches' are passed to |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
290 the SCCS command (in that order). |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
291 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
292 Automatically retrieve a read-only version of the file with keywords |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
293 expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
294 (vc-file-clearprops file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
295 (let* ((switches (list |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
296 (if (stringp vc-register-switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
297 (list vc-register-switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
298 vc-register-switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
299 (if (stringp vc-sccs-register-switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
300 (list vc-sccs-register-switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
301 vc-sccs-register-switches))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
302 (dirname (or (file-name-directory file) "")) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
303 (basename (file-name-nondirectory file)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
304 (project-file (vc-sccs-search-project-dir dirname basename))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
305 (let ((vc-name |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
306 (or project-file |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
307 (format (car vc-sccs-master-templates) dirname basename)))|) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
308 (apply 'vc-do-command nil 0 "admin" nil |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
309 (and rev (concat "-r" rev)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
310 "-fb" |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
311 (concat "-i" file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
312 (and comment (concat "-y" comment)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
313 vc-name |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
314 switches)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
315 (delete-file file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
316 (if vc-keep-workfiles |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
317 (vc-do-command nil 0 "get" (vc-name file))))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
318 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
319 (defun vc-sccs-checkout (file &optional writable rev workfile) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
320 "Retrieve a copy of a saved version of an SCCS controlled FILE into |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
321 a WORKFILE. WRITABLE non-nil means that the file should be writable. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
322 REV is the revision to check out into WORKFILE." |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
323 (let ((filename (or workfile file)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
324 (file-buffer (get-file-buffer file)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
325 switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
326 (message "Checking out %s..." filename) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
327 (save-excursion |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
328 ;; Change buffers to get local value of vc-checkout-switches. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
329 (if file-buffer (set-buffer file-buffer)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
330 (setq switches (if (stringp vc-checkout-switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
331 (list vc-checkout-switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
332 vc-checkout-switches)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
333 ;; Save this buffer's default-directory |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
334 ;; and use save-excursion to make sure it is restored |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
335 ;; in the same buffer it was saved in. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
336 (let ((default-directory default-directory)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
337 (save-excursion |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
338 ;; Adjust the default-directory so that the check-out creates |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
339 ;; the file in the right place. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
340 (setq default-directory (file-name-directory filename)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
341 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
342 (and rev (string= rev "") (setq rev nil)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
343 (if workfile |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
344 ;; Some SCCS implementations allow checking out directly to a |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
345 ;; file using the -G option, but then some don't so use the |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
346 ;; least common denominator approach and use the -p option |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
347 ;; ala RCS. |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
348 (let ((vc-modes (logior (file-modes (vc-name file)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
349 (if writable 128 0))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
350 (failed t)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
351 (unwind-protect |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
352 (progn |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
353 (let ((coding-system-for-read 'no-conversion) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
354 (coding-system-for-write 'no-conversion)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
355 (with-temp-file filename |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
356 (apply 'vc-do-command |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
357 (current-buffer) 0 "get" (vc-name file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
358 "-s" ;; suppress diagnostic output |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
359 (if writable "-e") |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
360 "-p" |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
361 (and rev |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
362 (concat "-r" |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
363 (vc-sccs-lookup-triple file rev))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
364 switches))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
365 (set-file-modes filename |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
366 (logior (file-modes (vc-name file)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
367 (if writable 128 0))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
368 (setq failed nil)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
369 (and failed (file-exists-p filename) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
370 (delete-file filename)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
371 (apply 'vc-do-command nil 0 "get" (vc-name file) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
372 (if writable "-e") |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
373 (and rev (concat "-r" (vc-sccs-lookup-triple file rev))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
374 switches) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
375 (vc-file-setprop file 'vc-workfile-version nil)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
376 (unless workfile |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
377 (if writable |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
378 (vc-file-setprop file 'vc-state 'edited)) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
379 (vc-file-setprop file |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
380 'vc-checkout-time (nth 5 (file-attributes file)))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
381 (message "Checking out %s...done" filename)))))) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
382 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
383 (defun vc-sccs-update-changelog (files) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
384 (error "Sorry, generating ChangeLog entries is not implemented for SCCS.")) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
385 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
386 (provide 'vc-sccs) |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
387 |
b1e1a94dfc0a
(vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff
changeset
|
388 ;;; vc-sccs.el ends here |