annotate lisp/vc-sccs.el @ 87594:3d7ab5b38c54

Add --bzip2. Update copyright.
author Romain Francoise <romain@orebokech.com>
date Sat, 05 Jan 2008 13:26:33 +0000
parents 315124ffb889
children 107ccd98fa12 56a72e2bd635
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
64762
41bb365f41c4 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64091
diff changeset
3 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
75347
e3694f1cb928 Add 2007 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 68651
diff changeset
4 ;; 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
6 ;; 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
7 ;; 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
8
56953
2cc3f5b16438 Doc fix.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54467
diff changeset
9 ;; $Id$
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
10
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
11 ;; 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
12
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
13 ;; 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
14 ;; it under the terms of the GNU General Public License as published by
78236
9355f9b7bbff Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents: 75347
diff changeset
15 ;; the Free Software Foundation; either version 3, or (at your option)
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
16 ;; any later version.
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
17
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
18 ;; 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
19 ;; 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
20 ;; 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
21 ;; 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
22
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
23 ;; 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
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64091
6fb026ad601f Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 56953
diff changeset
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
6fb026ad601f Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 56953
diff changeset
26 ;; Boston, MA 02110-1301, USA.
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
27
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
28 ;;; Commentary:
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
29
81989
f9f0d45ce573 Add todo item.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81967
diff changeset
30 ;; TODO:
f9f0d45ce573 Add todo item.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81967
diff changeset
31 ;; - remove call to vc-expand-dirs by implementing our own (which can just
f9f0d45ce573 Add todo item.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81967
diff changeset
32 ;; list the SCCS subdir instead).
f9f0d45ce573 Add todo item.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81967
diff changeset
33
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
34 ;;; Code:
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
35
49597
e88404e8f2cf Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48967
diff changeset
36 (eval-when-compile
35823
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
37 (require 'vc))
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
38
49597
e88404e8f2cf Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48967
diff changeset
39 ;;;
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
40 ;;; Customization options
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
41 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
42
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
43 (defcustom vc-sccs-register-switches nil
31477
1cfec89307a6 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
44 "*Extra switches for registering a file in SCCS.
1cfec89307a6 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
45 A string or list of strings passed to the checkin program by
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
46 \\[vc-sccs-register]."
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
47 :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
48 (string :tag "Argument String")
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
49 (repeat :tag "Argument List"
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
50 :value ("")
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
51 string))
31477
1cfec89307a6 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
52 :version "21.1"
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
53 :group 'vc)
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
54
35823
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
55 (defcustom vc-sccs-diff-switches nil
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
56 "*A string or list of strings specifying extra switches for `vcdiff',
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
57 the diff utility used for SCCS under VC."
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
58 :type '(choice (const :tag "None" nil)
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
59 (string :tag "Argument String")
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
60 (repeat :tag "Argument List"
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
61 :value ("")
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
62 string))
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
63 :version "21.1"
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
64 :group 'vc)
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
65
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
66 (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
67 "*Header keywords to be inserted by `vc-insert-headers'."
35179
1b423e7eb1eb (vc-sccs-header): Fix :type.
Dave Love <fx@gnu.org>
parents: 35134
diff changeset
68 :type '(repeat string)
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
69 :group 'vc)
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
70
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
71 ;;;###autoload
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
72 (defcustom vc-sccs-master-templates
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
73 '("%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
74 "*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
75 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
76 :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
77 ("%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
78 (repeat :tag "User-specified"
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
79 (choice string
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
80 function)))
31477
1cfec89307a6 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
81 :version "21.1"
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
82 :group 'vc)
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
83
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
84
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
85 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
86 ;;; Internal variables
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
87 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
88
31404
f2ab9420390f 2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 31385
diff changeset
89 (defconst vc-sccs-name-assoc-file "VC-names")
f2ab9420390f 2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 31385
diff changeset
90
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
91
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
92 ;;; Properties of the backend
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
93
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
94 (defun vc-sccs-revision-granularity ()
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
95 'file)
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
96
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
97 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
98 ;;; State-querying functions
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
99 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
100
48281
b8e04fa0ebdf (vc-sccs-registered): Improve comment.
André Spiegel <spiegel@gnu.org>
parents: 48264
diff changeset
101 ;;; The autoload cookie below places vc-sccs-registered directly into
b8e04fa0ebdf (vc-sccs-registered): Improve comment.
André Spiegel <spiegel@gnu.org>
parents: 48264
diff changeset
102 ;;; loaddefs.el, so that vc-sccs.el does not need to be loaded for
b8e04fa0ebdf (vc-sccs-registered): Improve comment.
André Spiegel <spiegel@gnu.org>
parents: 48264
diff changeset
103 ;;; every file that is visited. The definition is repeated below
b8e04fa0ebdf (vc-sccs-registered): Improve comment.
André Spiegel <spiegel@gnu.org>
parents: 48264
diff changeset
104 ;;; so that Help and etags can find it.
b8e04fa0ebdf (vc-sccs-registered): Improve comment.
André Spiegel <spiegel@gnu.org>
parents: 48264
diff changeset
105
b8e04fa0ebdf (vc-sccs-registered): Improve comment.
André Spiegel <spiegel@gnu.org>
parents: 48264
diff changeset
106 ;;;###autoload (defun vc-sccs-registered(f) (vc-default-registered 'SCCS f))
48264
63fc09a69c40 (vc-sccs-registered): Handle the autoload cookie so that the
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47806
diff changeset
107 (defun vc-sccs-registered (f) (vc-default-registered 'SCCS f))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
108
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
109 (defun vc-sccs-state (file)
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
110 "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
111 (with-temp-buffer
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
112 (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
113 (let* ((locks (vc-sccs-parse-locks))
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 82140
diff changeset
114 (working-revision (vc-working-revision file))
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 82140
diff changeset
115 (locking-user (cdr (assoc working-revision locks))))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
116 (if (not locking-user)
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
117 (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
118 'up-to-date
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
119 'unlocked-changes)
68416
64e8a95ba226 (vc-sccs-state): Pass FILE to vc-user-login-name.
André Spiegel <spiegel@gnu.org>
parents: 68333
diff changeset
120 (if (string= locking-user (vc-user-login-name file))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
121 'edited
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
122 locking-user)))
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
123 'up-to-date)))
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
124
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
125 (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
126 "SCCS-specific state heuristic."
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
127 (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
128 ;; 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
129 ;; 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
130 ;; 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
131 ;; 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
132 ;; 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
133 ;; group-read and other-read bits, since paranoid users turn them off.
68333
ccad9ac08a6d (vc-sccs-state-heuristic): Use file-attributes with ID-FORMAT
André Spiegel <spiegel@gnu.org>
parents: 66608
diff changeset
134 (let* ((attributes (file-attributes file 'string))
ccad9ac08a6d (vc-sccs-state-heuristic): Use file-attributes with ID-FORMAT
André Spiegel <spiegel@gnu.org>
parents: 66608
diff changeset
135 (owner-name (nth 2 attributes))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
136 (permissions (nth 8 attributes)))
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
137 (if (string-match ".r-..-..-." permissions)
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
138 'up-to-date
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
139 (if (string-match ".rw..-..-." permissions)
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
140 (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
141 'edited
68333
ccad9ac08a6d (vc-sccs-state-heuristic): Use file-attributes with ID-FORMAT
André Spiegel <spiegel@gnu.org>
parents: 66608
diff changeset
142 owner-name)
52179
73faa15ff855 (vc-sccs-state-heuristic): Fix parentheses.
André Spiegel <spiegel@gnu.org>
parents: 50902
diff changeset
143 ;; Strange permissions.
73faa15ff855 (vc-sccs-state-heuristic): Fix parentheses.
André Spiegel <spiegel@gnu.org>
parents: 50902
diff changeset
144 ;; Fall through to real state computation.
73faa15ff855 (vc-sccs-state-heuristic): Fix parentheses.
André Spiegel <spiegel@gnu.org>
parents: 50902
diff changeset
145 (vc-sccs-state file))))
73faa15ff855 (vc-sccs-state-heuristic): Fix parentheses.
André Spiegel <spiegel@gnu.org>
parents: 50902
diff changeset
146 (vc-sccs-state file)))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
147
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 82140
diff changeset
148 (defun vc-sccs-working-revision (file)
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 82140
diff changeset
149 "SCCS-specific version of `vc-working-revision'."
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
150 (with-temp-buffer
85141
b16f7408cd3f Carry through today's big terminology change to a few places where I
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85139
diff changeset
151 ;; The working revision is always the latest revision number.
52179
73faa15ff855 (vc-sccs-state-heuristic): Fix parentheses.
André Spiegel <spiegel@gnu.org>
parents: 50902
diff changeset
152 ;; To find this number, search the entire delta table,
73faa15ff855 (vc-sccs-state-heuristic): Fix parentheses.
André Spiegel <spiegel@gnu.org>
parents: 50902
diff changeset
153 ;; rather than just the first entry, because the
85141
b16f7408cd3f Carry through today's big terminology change to a few places where I
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85139
diff changeset
154 ;; first entry might be a deleted ("R") revision.
52179
73faa15ff855 (vc-sccs-state-heuristic): Fix parentheses.
André Spiegel <spiegel@gnu.org>
parents: 50902
diff changeset
155 (vc-insert-file (vc-name file) "^\001e\n\001[^s]")
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
156 (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
157
31477
1cfec89307a6 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
158 (defun vc-sccs-checkout-model (file)
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
159 "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
160 'locking)
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-workfile-unchanged-p (file)
56953
2cc3f5b16438 Doc fix.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54467
diff changeset
163 "SCCS-specific implementation of `vc-workfile-unchanged-p'."
35823
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
164 (zerop (apply 'vc-do-command nil 1 "vcdiff" (vc-name file)
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
165 (list "--brief" "-q"
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 82140
diff changeset
166 (concat "-r" (vc-working-revision file))))))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
167
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
168
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
169 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
170 ;;; State-changing functions
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
171 ;;;
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
172
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
173 (defun vc-sccs-create-repo ()
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
174 "Create a new SCCS repository."
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
175 ;; SCCS is totally file-oriented, so all we have to do is make the directory
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
176 (make-directory "SCCS"))
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
177
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
178 (defun vc-sccs-register (files &optional rev comment)
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
179 "Register FILES into the SCCS version-control system.
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
180 REV is the optional revision number for the file. COMMENT can be used
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
181 to provide an initial description of FILES.
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
182
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
183 `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
184 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
185
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
186 Automatically retrieve a read-only version of the files with keywords
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
187 expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
188 (dolist (file files)
50902
b12a550504a4 (vc-sccs-register, vc-sccs-checkin)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 49597
diff changeset
189 (let* ((dirname (or (file-name-directory file) ""))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
190 (basename (file-name-nondirectory file))
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
191 (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
192 (let ((vc-name
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
193 (or project-file
50902
b12a550504a4 (vc-sccs-register, vc-sccs-checkin)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 49597
diff changeset
194 (format (car vc-sccs-master-templates) dirname basename))))
37051
92a0a59a48ee (vc-sccs-register): Use relative file names.
André Spiegel <spiegel@gnu.org>
parents: 36713
diff changeset
195 (apply 'vc-do-command nil 0 "admin" vc-name
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
196 (and rev (not (string= rev "")) (concat "-r" rev))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
197 "-fb"
37051
92a0a59a48ee (vc-sccs-register): Use relative file names.
André Spiegel <spiegel@gnu.org>
parents: 36713
diff changeset
198 (concat "-i" (file-relative-name file))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
199 (and comment (concat "-y" comment))
50902
b12a550504a4 (vc-sccs-register, vc-sccs-checkin)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 49597
diff changeset
200 (vc-switches 'SCCS 'register)))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
201 (delete-file file)
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
202 (if vc-keep-workfiles
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
203 (vc-do-command nil 0 "get" (vc-name file))))))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
204
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
205 (defun vc-sccs-responsible-p (file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
206 "Return non-nil if SCCS thinks it would be responsible for registering FILE."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
207 ;; TODO: check for all the patterns in vc-sccs-master-templates
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
208 (or (file-directory-p (expand-file-name "SCCS" (file-name-directory file)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
209 (stringp (vc-sccs-search-project-dir (or (file-name-directory file) "")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
210 (file-name-nondirectory file)))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
211
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
212 (defun vc-sccs-checkin (files rev comment)
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
213 "SCCS-specific version of `vc-backend-checkin'."
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
214 (dolist (file files)
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
215 (apply 'vc-do-command nil 0 "delta" (vc-name file)
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
216 (if rev (concat "-r" rev))
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
217 (concat "-y" comment)
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
218 (vc-switches 'SCCS 'checkin))
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
219 (if vc-keep-workfiles
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
220 (vc-do-command nil 0 "get" (vc-name file)))))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
221
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 82140
diff changeset
222 (defun vc-sccs-find-revision (file rev buffer)
47798
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
223 (apply 'vc-do-command
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
224 buffer 0 "get" (vc-name file)
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
225 "-s" ;; suppress diagnostic output
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
226 "-p"
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
227 (and rev
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
228 (concat "-r"
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
229 (vc-sccs-lookup-triple file rev)))
50902
b12a550504a4 (vc-sccs-register, vc-sccs-checkin)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 49597
diff changeset
230 (vc-switches 'SCCS 'checkout)))
47798
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
231
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
232 (defun vc-sccs-checkout (file &optional editable rev)
85141
b16f7408cd3f Carry through today's big terminology change to a few places where I
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85139
diff changeset
233 "Retrieve a copy of a saved revision of SCCS controlled FILE.
35134
f7a5d39c26f0 (vc-sccs-latest-on-branch-p): Removed.
André Spiegel <spiegel@gnu.org>
parents: 33560
diff changeset
234 EDITABLE non-nil means that the file should be writable and
47798
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
235 locked. REV is the revision to check out."
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
236 (let ((file-buffer (get-file-buffer file))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
237 switches)
47798
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
238 (message "Checking out %s..." file)
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
239 (save-excursion
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
240 ;; 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
241 (if file-buffer (set-buffer file-buffer))
50902
b12a550504a4 (vc-sccs-register, vc-sccs-checkin)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 49597
diff changeset
242 (setq switches (vc-switches 'SCCS 'checkout))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
243 ;; 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
244 ;; 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
245 ;; 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
246 (let ((default-directory default-directory))
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
247 (save-excursion
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
248 ;; 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
249 ;; the file in the right place.
47798
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
250 (setq default-directory (file-name-directory file))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
251
49597
e88404e8f2cf Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48967
diff changeset
252 (and rev (or (string= rev "")
48967
9f461f463a94 (vc-sccs-checkout): Handle t argument for REV.
André Spiegel <spiegel@gnu.org>
parents: 48281
diff changeset
253 (not (stringp rev)))
9f461f463a94 (vc-sccs-checkout): Handle t argument for REV.
André Spiegel <spiegel@gnu.org>
parents: 48281
diff changeset
254 (setq rev nil))
47798
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
255 (apply 'vc-do-command nil 0 "get" (vc-name file)
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
256 (if editable "-e")
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
257 (and rev (concat "-r" (vc-sccs-lookup-triple file rev)))
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
258 switches))))
20dfef584009 (vc-sccs-find-version): New fun.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 44006
diff changeset
259 (message "Checking out %s...done" file)))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
260
85141
b16f7408cd3f Carry through today's big terminology change to a few places where I
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85139
diff changeset
261 (defun vc-sccs-rollback (files)
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
262 "Roll back, undoing the most recent checkins of FILES."
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
263 (if (not files)
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
264 (error "SCCS backend doesn't support directory-level rollback."))
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
265 (dolist (file files)
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 82140
diff changeset
266 (let ((discard (vc-working-revision file)))
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
267 (if (null (yes-or-no-p (format "Remove version %s from %s history? "
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
268 discard file)))
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
269 (error "Aborted"))
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
270 (message "Removing revision %s from %s..." discard file)
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
271 (vc-do-command nil 0 "rmdel" (vc-name file) (concat "-r" discard))
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
272 (vc-do-command nil 0 "get" (vc-name file) nil))))
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
273
39001
d13c2139752b (vc-*-revert-file): Handle new optional arg CONTENTS-DONE.
André Spiegel <spiegel@gnu.org>
parents: 38436
diff changeset
274 (defun vc-sccs-revert (file &optional contents-done)
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
275 "Revert FILE to the version it was based on."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
276 (vc-do-command nil 0 "unget" (vc-name file))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
277 (vc-do-command nil 0 "get" (vc-name file))
85141
b16f7408cd3f Carry through today's big terminology change to a few places where I
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85139
diff changeset
278 ;; Checking out explicit revisions is not supported under SCCS, yet.
b16f7408cd3f Carry through today's big terminology change to a few places where I
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85139
diff changeset
279 ;; We always "revert" to the latest revision; therefore
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 82140
diff changeset
280 ;; vc-working-revision is cleared here so that it gets recomputed.
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 82140
diff changeset
281 (vc-file-setprop file 'vc-working-revision nil))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
282
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
283 (defun vc-sccs-steal-lock (file &optional rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
284 "Steal the lock on the current workfile for FILE and revision REV."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
285 (vc-do-command nil 0 "unget" (vc-name file) "-n" (if rev (concat "-r" rev)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
286 (vc-do-command nil 0 "get" (vc-name file) "-g" (if rev (concat "-r" rev))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
287
87432
315124ffb889 * (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85141
diff changeset
288 (defun vc-sccs-modify-change-comment (files rev comment)
315124ffb889 * (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85141
diff changeset
289 "Modify (actually, append to) the change comments for FILES on a specified REV."
315124ffb889 * (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85141
diff changeset
290 (dolist (file files)
315124ffb889 * (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85141
diff changeset
291 (vc-do-command nil 0 "cdc" (vc-name file)
315124ffb889 * (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85141
diff changeset
292 (concat "-y" comment) (concat "-r" rev))))
315124ffb889 * (vc.el, vc-sccs.el, vc-rcs.el, vc-cs.el, vc-mcvs.el): Put
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85141
diff changeset
293
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
294
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
295 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
296 ;;; History functions
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
297 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
298
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
299 (defun vc-sccs-print-log (files &optional buffer)
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
300 "Get change log associated with FILES."
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
301 (vc-do-command buffer 0 "prs" (mapcar 'vc-name files)))
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
302
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
303 (defun vc-sccs-wash-log ()
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
304 "Remove all non-comment information from log output."
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
305 ;; FIXME: not implemented for SCCS
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
306 nil)
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
307
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
308 (defun vc-sccs-logentry-check ()
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
309 "Check that the log entry in the current buffer is acceptable for SCCS."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
310 (when (>= (buffer-size) 512)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
311 (goto-char 512)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
312 (error "Log must be less than 512 characters; point is now at pos 512")))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
313
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
314 (defun vc-sccs-diff (files &optional oldvers newvers buffer)
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
315 "Get a difference report using SCCS between two filesets."
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
316 (setq oldvers (vc-sccs-lookup-triple file oldvers))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
317 (setq newvers (vc-sccs-lookup-triple file newvers))
81967
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
318 (apply 'vc-do-command (or buffer "*vc-diff*")
6bf2af5a341e Put the lower half (the back-end) of NewVC in place. This commit
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 75347
diff changeset
319 1 "vcdiff" (mapcar 'vc-name (vc-expand-dirs files))
35823
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
320 (append (list "-q"
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
321 (and oldvers (concat "-r" oldvers))
9396894025fa (vc-sccs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35179
diff changeset
322 (and newvers (concat "-r" newvers)))
50902
b12a550504a4 (vc-sccs-register, vc-sccs-checkin)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 49597
diff changeset
323 (vc-switches 'SCCS 'diff))))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
324
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
325
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
326 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
327 ;;; Snapshot system
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
328 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
329
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
330 (defun vc-sccs-assign-name (file name)
85141
b16f7408cd3f Carry through today's big terminology change to a few places where I
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85139
diff changeset
331 "Assign to FILE's latest revision a given NAME."
85139
8ba0e30716a5 Terminology cleanup.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 82140
diff changeset
332 (vc-sccs-add-triple name file (vc-working-revision file)))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
333
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
334
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
335 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
336 ;;; Miscellaneous
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
337 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
338
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
339 (defun vc-sccs-check-headers ()
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
340 "Check if the current file has any headers in it."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
341 (save-excursion
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
342 (goto-char (point-min))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
343 (re-search-forward "%[A-Z]%" nil t)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
344
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
345 (defun vc-sccs-rename-file (old new)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
346 ;; Move the master file (using vc-rcs-master-templates).
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
347 (vc-rename-master (vc-name old) new vc-sccs-master-templates)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
348 ;; Update the snapshot file.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
349 (with-current-buffer
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
350 (find-file-noselect
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
351 (expand-file-name vc-sccs-name-assoc-file
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
352 (file-name-directory (vc-name old))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
353 (goto-char (point-min))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
354 ;; (replace-regexp (concat ":" (regexp-quote old) "$") (concat ":" new))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
355 (while (re-search-forward (concat ":" (regexp-quote old) "$") nil t)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
356 (replace-match (concat ":" new) nil nil))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
357 (basic-save-buffer)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
358 (kill-buffer (current-buffer))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
359
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
360
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
361 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
362 ;;; Internal functions
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
363 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
364
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
365 ;; This function is wrapped with `progn' so that the autoload cookie
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
366 ;; copies the whole function itself into loaddefs.el rather than just placing
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
367 ;; a (autoload 'vc-sccs-search-project-dir "vc-sccs") which would not
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
368 ;; help us avoid loading vc-sccs.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
369 ;;;###autoload
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
370 (progn (defun vc-sccs-search-project-dir (dirname basename)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
371 "Return the name of a master file in the SCCS project directory.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
372 Does not check whether the file exists but returns nil if it does not
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
373 find any project directory."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
374 (let ((project-dir (getenv "PROJECTDIR")) dirs dir)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
375 (when project-dir
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
376 (if (file-name-absolute-p project-dir)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
377 (setq dirs '("SCCS" ""))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
378 (setq dirs '("src/SCCS" "src" "source/SCCS" "source"))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
379 (setq project-dir (expand-file-name (concat "~" project-dir))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
380 (while (and (not dir) dirs)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
381 (setq dir (expand-file-name (car dirs) project-dir))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
382 (unless (file-directory-p dir)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
383 (setq dir nil)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
384 (setq dirs (cdr dirs))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
385 (and dir (expand-file-name (concat "s." basename) dir))))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
386
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
387 (defun vc-sccs-lock-file (file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
388 "Generate lock file name corresponding to FILE."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
389 (let ((master (vc-name file)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
390 (and
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
391 master
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
392 (string-match "\\(.*/\\)\\(s\\.\\)\\(.*\\)" master)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
393 (replace-match "p." t t master 2))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
394
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
395 (defun vc-sccs-parse-locks ()
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
396 "Parse SCCS locks in current buffer.
85141
b16f7408cd3f Carry through today's big terminology change to a few places where I
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85139
diff changeset
397 The result is a list of the form ((REVISION . USER) (REVISION . USER) ...)."
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
398 (let (master-locks)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
399 (goto-char (point-min))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
400 (while (re-search-forward "^\\([0-9.]+\\) [0-9.]+ \\([^ ]+\\) .*\n?"
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
401 nil t)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
402 (setq master-locks
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
403 (cons (cons (match-string 1) (match-string 2)) master-locks)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
404 ;; FIXME: is it really necessary to reverse ?
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
405 (nreverse master-locks)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
406
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
407 (defun vc-sccs-add-triple (name file rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
408 (with-current-buffer
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
409 (find-file-noselect
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
410 (expand-file-name vc-sccs-name-assoc-file
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
411 (file-name-directory (vc-name file))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
412 (goto-char (point-max))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
413 (insert name "\t:\t" file "\t" rev "\n")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
414 (basic-save-buffer)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
415 (kill-buffer (current-buffer))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
416
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
417 (defun vc-sccs-lookup-triple (file name)
85141
b16f7408cd3f Carry through today's big terminology change to a few places where I
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85139
diff changeset
418 "Return the numeric revision corresponding to a named snapshot of FILE.
b16f7408cd3f Carry through today's big terminology change to a few places where I
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 85139
diff changeset
419 If NAME is nil or a revision number string it's just passed through."
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
420 (if (or (null name)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
421 (let ((firstchar (aref name 0)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
422 (and (>= firstchar ?0) (<= firstchar ?9))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
423 name
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
424 (with-temp-buffer
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
425 (vc-insert-file
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
426 (expand-file-name vc-sccs-name-assoc-file
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
427 (file-name-directory (vc-name file))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
428 (vc-parse-buffer (concat name "\t:\t" file "\t\\(.+\\)") 1))))
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
429
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
430 (provide 'vc-sccs)
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
431
56953
2cc3f5b16438 Doc fix.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54467
diff changeset
432 ;; arch-tag: d751dee3-d7b3-47e1-95e3-7ae98c052041
31385
b1e1a94dfc0a (vc-sccs-latest-on-branch-p): Always return t; we
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
433 ;;; vc-sccs.el ends here