annotate lisp/vc-rcs.el @ 37086:07200bf360ab

(Language Environments): Fix the description of locale settings during startup. From Paul Eggert.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 30 Mar 2001 10:49:02 +0000
parents 551ff6f7ef12
children b174db545cfd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1 ;;; vc-rcs.el --- support for RCS version-control
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2
35830
037d66685778 Copyright up-date.
Dave Love <fx@gnu.org>
parents: 35822
diff changeset
3 ;; Copyright (C) 1992,93,94,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5 ;; Author: FSF (see vc.el for full credits)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
7
36712
551ff6f7ef12 (vc-rcs-print-log): Output to buffer *vc*, not the current buffer.
André Spiegel <spiegel@gnu.org>
parents: 35830
diff changeset
8 ;; $Id: vc-rcs.el,v 1.18 2001/02/01 17:42:03 fx Exp $
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
9
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
11
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
15 ;; any later version.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
16
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
21
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
25 ;; Boston, MA 02111-1307, USA.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
26
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
27 ;;; Commentary: see vc.el
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
28
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
29 ;;; Code:
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
30
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
31 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
32 ;;; Customization options
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
33 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
34
31840
a05558c54226 (toplevel): Require `vc' when compiling.
Gerd Moellmann <gerd@gnu.org>
parents: 31835
diff changeset
35 (eval-when-compile
35822
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
36 (require 'cl)
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
37 (require 'vc))
31840
a05558c54226 (toplevel): Require `vc' when compiling.
Gerd Moellmann <gerd@gnu.org>
parents: 31835
diff changeset
38
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
39 (defcustom vc-rcs-release nil
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
40 "*The release number of your RCS installation, as a string.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
41 If nil, VC itself computes this value when it is first needed."
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
42 :type '(choice (const :tag "Auto" nil)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
43 (string :tag "Specified")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
44 (const :tag "Unknown" unknown))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
45 :group 'vc)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
46
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
47 (defcustom vc-rcs-register-switches nil
31476
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
48 "*Extra switches for registering a file in RCS.
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
49 A string or list of strings. These are passed to the checkin program
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
50 by \\[vc-rcs-register]."
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
51 :type '(choice (const :tag "None" nil)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
52 (string :tag "Argument String")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
53 (repeat :tag "Argument List"
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
54 :value ("")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
55 string))
31476
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
56 :version "21.1"
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
57 :group 'vc)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
58
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
59 (defcustom vc-rcs-checkin-switches nil
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
60 "*A string or list of strings specifying extra switches for RCS checkin.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
61 These are passed to the checkin program by \\[vc-rcs-checkin]."
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
62 :type '(choice (const :tag "None" nil)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
63 (string :tag "Argument String")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
64 (repeat :tag "Argument List"
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
65 :value ("")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
66 string))
31476
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
67 :version "21.1"
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
68 :group 'vc)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
69
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
70 (defcustom vc-rcs-checkout-switches nil
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
71 "*A string or list of strings specifying extra switches for RCS checkout.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
72 These are passed to the checkout program by \\[vc-rcs-checkout]."
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
73 :type '(choice (const :tag "None" nil)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
74 (string :tag "Argument String")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
75 (repeat :tag "Argument List"
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
76 :value ("")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
77 string))
31476
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
78 :version "21.1"
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
79 :group 'vc)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
80
35822
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
81 (defcustom vc-rcs-diff-switches nil
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
82 "*A string or list of strings specifying extra switches for rcsdiff under VC."
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
83 :type '(choice (const :tag "None" nil)
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
84 (string :tag "Argument String")
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
85 (repeat :tag "Argument List"
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
86 :value ("")
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
87 string))
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
88 :version "21.1"
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
89 :group 'vc)
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
90
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
91 (defcustom vc-rcs-header (or (cdr (assoc 'RCS vc-header-alist)) '("\$Id\$"))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
92 "*Header keywords to be inserted by `vc-insert-headers'."
35178
ae1b8d0257a7 (vc-rcs-header): Fix :type.
Dave Love <fx@gnu.org>
parents: 35133
diff changeset
93 :type '(repeat string)
31476
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
94 :version "21.1"
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
95 :group 'vc)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
96
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
97 (defcustom vc-rcsdiff-knows-brief nil
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
98 "*Indicates whether rcsdiff understands the --brief option.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
99 The value is either `yes', `no', or nil. If it is nil, VC tries
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
100 to use --brief and sets this variable to remember whether it worked."
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
101 :type '(choice (const :tag "Work out" nil) (const yes) (const no))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
102 :group 'vc)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
103
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
104 ;;;###autoload
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
105 (defcustom vc-rcs-master-templates
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
106 '("%sRCS/%s,v" "%s%s,v" "%sRCS/%s")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
107 "*Where to look for RCS master files.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
108 For a description of possible values, see `vc-check-master-templates'."
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
109 :type '(choice (const :tag "Use standard RCS file names"
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
110 '("%sRCS/%s,v" "%s%s,v" "%sRCS/%s"))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
111 (repeat :tag "User-specified"
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
112 (choice string
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
113 function)))
31476
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
114 :version "21.1"
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
115 :group 'vc)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
116
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
117
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
118 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
119 ;;; State-querying functions
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
120 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
121
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
122 ;;;###autoload
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
123 (progn (defun vc-rcs-registered (f) (vc-default-registered 'RCS f)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
124
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
125 (defun vc-rcs-state (file)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
126 "Implementation of `vc-state' for RCS."
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
127 (or (boundp 'vc-rcs-headers-result)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
128 (and vc-consult-headers
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
129 (vc-rcs-consult-headers file)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
130 (let ((state
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
131 ;; vc-workfile-version might not be known; in that case the
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
132 ;; property is nil. vc-rcs-fetch-master-state knows how to
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
133 ;; handle that.
31476
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
134 (vc-rcs-fetch-master-state file
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
135 (vc-file-getprop file
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
136 'vc-workfile-version))))
33636
2c1708b98891 (vc-rcs-state): Before calling vc-workfile-unchanged-p, require vc.
André Spiegel <spiegel@gnu.org>
parents: 33610
diff changeset
137 (if (not (eq state 'up-to-date))
2c1708b98891 (vc-rcs-state): Before calling vc-workfile-unchanged-p, require vc.
André Spiegel <spiegel@gnu.org>
parents: 33610
diff changeset
138 state
2c1708b98891 (vc-rcs-state): Before calling vc-workfile-unchanged-p, require vc.
André Spiegel <spiegel@gnu.org>
parents: 33610
diff changeset
139 (require 'vc)
2c1708b98891 (vc-rcs-state): Before calling vc-workfile-unchanged-p, require vc.
André Spiegel <spiegel@gnu.org>
parents: 33610
diff changeset
140 (if (vc-workfile-unchanged-p file)
2c1708b98891 (vc-rcs-state): Before calling vc-workfile-unchanged-p, require vc.
André Spiegel <spiegel@gnu.org>
parents: 33610
diff changeset
141 'up-to-date
2c1708b98891 (vc-rcs-state): Before calling vc-workfile-unchanged-p, require vc.
André Spiegel <spiegel@gnu.org>
parents: 33610
diff changeset
142 (if (eq (vc-checkout-model file) 'locking)
2c1708b98891 (vc-rcs-state): Before calling vc-workfile-unchanged-p, require vc.
André Spiegel <spiegel@gnu.org>
parents: 33610
diff changeset
143 'unlocked-changes
2c1708b98891 (vc-rcs-state): Before calling vc-workfile-unchanged-p, require vc.
André Spiegel <spiegel@gnu.org>
parents: 33610
diff changeset
144 'edited)))))
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
145
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
146 (defun vc-rcs-state-heuristic (file)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
147 "State heuristic for RCS."
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
148 (let (vc-rcs-headers-result)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
149 (if (and vc-consult-headers
31476
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
150 (setq vc-rcs-headers-result
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
151 (vc-rcs-consult-headers file))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
152 (eq vc-rcs-headers-result 'rev-and-lock))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
153 (let ((state (vc-file-getprop file 'vc-state)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
154 ;; If the headers say that the file is not locked, the
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
155 ;; permissions can tell us whether locking is used for
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
156 ;; the file or not.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
157 (if (and (eq state 'up-to-date)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
158 (not (vc-mistrust-permissions file)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
159 (cond
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
160 ((string-match ".rw..-..-." (nth 8 (file-attributes file)))
31809
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
161 (vc-file-setprop file 'vc-checkout-model 'implicit)
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
162 (setq state
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
163 (if (vc-rcs-workfile-is-newer file)
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
164 'edited
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
165 'up-to-date)))
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
166 ((string-match ".r-..-..-." (nth 8 (file-attributes file)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
167 (vc-file-setprop file 'vc-checkout-model 'locking))))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
168 state)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
169 (if (not (vc-mistrust-permissions file))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
170 (let* ((attributes (file-attributes file))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
171 (owner-uid (nth 2 attributes))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
172 (permissions (nth 8 attributes)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
173 (cond ((string-match ".r-..-..-." permissions)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
174 (vc-file-setprop file 'vc-checkout-model 'locking)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
175 'up-to-date)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
176 ((string-match ".rw..-..-." permissions)
31809
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
177 (if (eq (vc-checkout-model file) 'locking)
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
178 (if (file-ownership-preserved-p file)
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
179 'edited
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
180 (vc-user-login-name owner-uid))
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
181 (if (vc-rcs-workfile-is-newer file)
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
182 'edited
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
183 'up-to-date)))
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
184 (t
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
185 ;; Strange permissions. Fall through to
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
186 ;; expensive state computation.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
187 (vc-rcs-state file))))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
188 (vc-rcs-state file)))))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
189
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
190 (defun vc-rcs-workfile-version (file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
191 "RCS-specific version of `vc-workfile-version'."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
192 (or (and vc-consult-headers
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
193 (vc-rcs-consult-headers file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
194 (vc-file-getprop file 'vc-workfile-version))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
195 (progn
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
196 (vc-rcs-fetch-master-state file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
197 (vc-file-getprop file 'vc-workfile-version))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
198
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
199 (defun vc-rcs-latest-on-branch-p (file &optional version)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
200 "Return non-nil if workfile version of FILE is the latest on its branch.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
201 When VERSION is given, perform check for that version."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
202 (unless version (setq version (vc-workfile-version file)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
203 (with-temp-buffer
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
204 (string= version
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
205 (if (vc-rcs-trunk-p version)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
206 (progn
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
207 ;; Compare VERSION to the head version number.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
208 (vc-insert-file (vc-name file) "^[0-9]")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
209 (vc-parse-buffer "^head[ \t\n]+\\([^;]+\\);" 1))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
210 ;; If we are not on the trunk, we need to examine the
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
211 ;; whole current branch.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
212 (vc-insert-file (vc-name file) "^desc")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
213 (vc-rcs-find-most-recent-rev (vc-rcs-branch-part version))))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
214
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
215 (defun vc-rcs-checkout-model (file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
216 "RCS-specific version of `vc-checkout-model'."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
217 (vc-rcs-consult-headers file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
218 (or (vc-file-getprop file 'vc-checkout-model)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
219 (progn (vc-rcs-fetch-master-state file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
220 (vc-file-getprop file 'vc-checkout-model))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
221
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
222 (defun vc-rcs-workfile-unchanged-p (file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
223 "RCS-specific implementation of vc-workfile-unchanged-p."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
224 ;; Try to use rcsdiff --brief. If rcsdiff does not understand that,
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
225 ;; do a double take and remember the fact for the future
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
226 (let* ((version (concat "-r" (vc-workfile-version file)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
227 (status (if (eq vc-rcsdiff-knows-brief 'no)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
228 (vc-do-command nil 1 "rcsdiff" file version)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
229 (vc-do-command nil 2 "rcsdiff" file "--brief" version))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
230 (if (eq status 2)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
231 (if (not vc-rcsdiff-knows-brief)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
232 (setq vc-rcsdiff-knows-brief 'no
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
233 status (vc-do-command nil 1 "rcsdiff" file version))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
234 (error "rcsdiff failed"))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
235 (if (not vc-rcsdiff-knows-brief) (setq vc-rcsdiff-knows-brief 'yes)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
236 ;; The workfile is unchanged if rcsdiff found no differences.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
237 (zerop status)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
238
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
239
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
240 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
241 ;;; State-changing functions
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
242 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
243
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
244 (defun vc-rcs-register (file &optional rev comment)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
245 "Register FILE into the RCS version-control system.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
246 REV is the optional revision number for the file. COMMENT can be used
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
247 to provide an initial description of FILE.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
248
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
249 `vc-register-switches' and `vc-rcs-register-switches' are passed to
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
250 the RCS command (in that order).
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
251
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
252 Automatically retrieve a read-only version of the file with keywords
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
253 expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
254 (let ((subdir (expand-file-name "RCS" (file-name-directory file)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
255 (switches (list
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
256 (if (stringp vc-register-switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
257 (list vc-register-switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
258 vc-register-switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
259 (if (stringp vc-rcs-register-switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
260 (list vc-rcs-register-switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
261 vc-rcs-register-switches))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
262
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
263 (and (not (file-exists-p subdir))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
264 (not (directory-files (file-name-directory file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
265 nil ".*,v$" t))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
266 (yes-or-no-p "Create RCS subdirectory? ")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
267 (make-directory subdir))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
268 (apply 'vc-do-command nil 0 "ci" file
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
269 ;; if available, use the secure registering option
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
270 (and (vc-rcs-release-p "5.6.4") "-i")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
271 (concat (if vc-keep-workfiles "-u" "-r") rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
272 (and comment (concat "-t-" comment))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
273 switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
274 ;; parse output to find master file name and workfile version
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
275 (with-current-buffer "*vc*"
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
276 (goto-char (point-min))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
277 (let ((name (if (looking-at (concat "^\\(.*\\) <-- "
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
278 (file-name-nondirectory file)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
279 (match-string 1))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
280 (if (not name)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
281 ;; if we couldn't find the master name,
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
282 ;; run vc-rcs-registered to get it
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
283 ;; (will be stored into the vc-name property)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
284 (vc-rcs-registered file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
285 (vc-file-setprop file 'vc-name
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
286 (if (file-name-absolute-p name)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
287 name
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
288 (expand-file-name
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
289 name
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
290 (file-name-directory file))))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
291 (vc-file-setprop file 'vc-workfile-version
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
292 (if (re-search-forward
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
293 "^initial revision: \\([0-9.]+\\).*\n"
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
294 nil t)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
295 (match-string 1))))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
296
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
297 (defun vc-rcs-responsible-p (file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
298 "Return non-nil if RCS thinks it would be responsible for registering FILE."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
299 ;; TODO: check for all the patterns in vc-rcs-master-templates
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
300 (file-directory-p (expand-file-name "RCS" (file-name-directory file))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
301
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
302 (defun vc-rcs-receive-file (file rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
303 "Implementation of receive-file for RCS."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
304 (let ((checkout-model (vc-checkout-model file)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
305 (vc-rcs-register file rev "")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
306 (when (eq checkout-model 'implicit)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
307 (vc-rcs-set-non-strict-locking file))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
308 (vc-rcs-set-default-branch file (concat rev ".1"))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
309
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
310 (defun vc-rcs-unregister (file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
311 "Unregister FILE from RCS.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
312 If this leaves the RCS subdirectory empty, ask the user
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
313 whether to remove it."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
314 (let* ((master (vc-name file))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
315 (dir (file-name-directory master))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
316 (backup-info (find-backup-file-name master)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
317 (if (not backup-info)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
318 (delete-file master)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
319 (rename-file master (car backup-info) 'ok-if-already-exists)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
320 (dolist (f (cdr backup-info)) (ignore-errors (delete-file f))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
321 (and (string= (file-name-nondirectory (directory-file-name dir)) "RCS")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
322 ;; check whether RCS dir is empty, i.e. it does not
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
323 ;; contain any files except "." and ".."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
324 (not (directory-files dir nil
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
325 "^\\([^.]\\|\\.[^.]\\|\\.\\.[^.]\\).*"))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
326 (yes-or-no-p (format "Directory %s is empty; remove it? " dir))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
327 (delete-directory dir))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
328
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
329 (defun vc-rcs-checkin (file rev comment)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
330 "RCS-specific version of `vc-backend-checkin'."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
331 (let ((switches (if (stringp vc-checkin-switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
332 (list vc-checkin-switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
333 vc-checkin-switches)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
334 (let ((old-version (vc-workfile-version file)) new-version
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
335 (default-branch (vc-file-getprop file 'vc-rcs-default-branch)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
336 ;; Force branch creation if an appropriate
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
337 ;; default branch has been set.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
338 (and (not rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
339 default-branch
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
340 (string-match (concat "^" (regexp-quote old-version) "\\.")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
341 default-branch)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
342 (setq rev default-branch)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
343 (setq switches (cons "-f" switches)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
344 (apply 'vc-do-command nil 0 "ci" (vc-name file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
345 ;; if available, use the secure check-in option
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
346 (and (vc-rcs-release-p "5.6.4") "-j")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
347 (concat (if vc-keep-workfiles "-u" "-r") rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
348 (concat "-m" comment)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
349 switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
350 (vc-file-setprop file 'vc-workfile-version nil)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
351
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
352 ;; determine the new workfile version
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
353 (set-buffer "*vc*")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
354 (goto-char (point-min))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
355 (when (or (re-search-forward
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
356 "new revision: \\([0-9.]+\\);" nil t)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
357 (re-search-forward
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
358 "reverting to previous revision \\([0-9.]+\\)" nil t))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
359 (setq new-version (match-string 1))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
360 (vc-file-setprop file 'vc-workfile-version new-version))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
361
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
362 ;; if we got to a different branch, adjust the default
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
363 ;; branch accordingly
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
364 (cond
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
365 ((and old-version new-version
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
366 (not (string= (vc-rcs-branch-part old-version)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
367 (vc-rcs-branch-part new-version))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
368 (vc-rcs-set-default-branch file
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
369 (if (vc-rcs-trunk-p new-version) nil
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
370 (vc-rcs-branch-part new-version)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
371 ;; If this is an old RCS release, we might have
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
372 ;; to remove a remaining lock.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
373 (if (not (vc-rcs-release-p "5.6.2"))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
374 ;; exit status of 1 is also accepted.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
375 ;; It means that the lock was removed before.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
376 (vc-do-command nil 1 "rcs" (vc-name file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
377 (concat "-u" old-version))))))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
378
35133
1b45907ef7a8 (vc-rcs-checkout, vc-rcs-cancel-version): Renamed arg WRITABLE to EDITABLE.
André Spiegel <spiegel@gnu.org>
parents: 33636
diff changeset
379 (defun vc-rcs-checkout (file &optional editable rev workfile)
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
380 "Retrieve a copy of a saved version of FILE into a workfile."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
381 (let ((filename (or workfile file))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
382 (file-buffer (get-file-buffer file))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
383 switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
384 (message "Checking out %s..." filename)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
385 (save-excursion
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
386 ;; Change buffers to get local value of vc-checkout-switches.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
387 (if file-buffer (set-buffer file-buffer))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
388 (setq switches (if (stringp vc-checkout-switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
389 (list vc-checkout-switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
390 vc-checkout-switches))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
391 ;; Save this buffer's default-directory
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
392 ;; and use save-excursion to make sure it is restored
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
393 ;; in the same buffer it was saved in.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
394 (let ((default-directory default-directory))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
395 (save-excursion
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
396 ;; Adjust the default-directory so that the check-out creates
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
397 ;; the file in the right place.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
398 (setq default-directory (file-name-directory filename))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
399 (if workfile ;; RCS
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
400 ;; RCS can't check out into arbitrary file names directly.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
401 ;; Use `co -p' and make stdout point to the correct file.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
402 (let ((vc-modes (logior (file-modes (vc-name file))
35133
1b45907ef7a8 (vc-rcs-checkout, vc-rcs-cancel-version): Renamed arg WRITABLE to EDITABLE.
André Spiegel <spiegel@gnu.org>
parents: 33636
diff changeset
403 (if editable 128 0)))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
404 (failed t))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
405 (unwind-protect
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
406 (progn
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
407 (let ((coding-system-for-read 'no-conversion)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
408 (coding-system-for-write 'no-conversion))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
409 (with-temp-file filename
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
410 (apply 'vc-do-command
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
411 (current-buffer) 0 "co" (vc-name file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
412 "-q" ;; suppress diagnostic output
35133
1b45907ef7a8 (vc-rcs-checkout, vc-rcs-cancel-version): Renamed arg WRITABLE to EDITABLE.
André Spiegel <spiegel@gnu.org>
parents: 33636
diff changeset
413 (if editable "-l")
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
414 (concat "-p" rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
415 switches)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
416 (set-file-modes filename
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
417 (logior (file-modes (vc-name file))
35133
1b45907ef7a8 (vc-rcs-checkout, vc-rcs-cancel-version): Renamed arg WRITABLE to EDITABLE.
André Spiegel <spiegel@gnu.org>
parents: 33636
diff changeset
418 (if editable 128 0)))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
419 (setq failed nil))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
420 (and failed (file-exists-p filename)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
421 (delete-file filename))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
422 (let (new-version)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
423 ;; if we should go to the head of the trunk,
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
424 ;; clear the default branch first
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
425 (and rev (string= rev "")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
426 (vc-rcs-set-default-branch file nil))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
427 ;; now do the checkout
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
428 (apply 'vc-do-command
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
429 nil 0 "co" (vc-name file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
430 ;; If locking is not strict, force to overwrite
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
431 ;; the writable workfile.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
432 (if (eq (vc-checkout-model file) 'implicit) "-f")
35133
1b45907ef7a8 (vc-rcs-checkout, vc-rcs-cancel-version): Renamed arg WRITABLE to EDITABLE.
André Spiegel <spiegel@gnu.org>
parents: 33636
diff changeset
433 (if editable "-l")
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
434 (if rev (concat "-r" rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
435 ;; if no explicit revision was specified,
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
436 ;; check out that of the working file
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
437 (let ((workrev (vc-workfile-version file)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
438 (if workrev (concat "-r" workrev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
439 nil)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
440 switches)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
441 ;; determine the new workfile version
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
442 (with-current-buffer "*vc*"
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
443 (setq new-version
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
444 (vc-parse-buffer "^revision \\([0-9.]+\\).*\n" 1)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
445 (vc-file-setprop file 'vc-workfile-version new-version)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
446 ;; if necessary, adjust the default branch
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
447 (and rev (not (string= rev ""))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
448 (vc-rcs-set-default-branch
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
449 file
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
450 (if (vc-rcs-latest-on-branch-p file new-version)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
451 (if (vc-rcs-trunk-p new-version) nil
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
452 (vc-rcs-branch-part new-version))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
453 new-version))))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
454 (message "Checking out %s...done" filename)))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
455
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
456 (defun vc-rcs-revert (file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
457 "Revert FILE to the version it was based on."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
458 (vc-do-command nil 0 "co" (vc-name file) "-f"
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
459 (concat "-u" (vc-workfile-version file))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
460
35133
1b45907ef7a8 (vc-rcs-checkout, vc-rcs-cancel-version): Renamed arg WRITABLE to EDITABLE.
André Spiegel <spiegel@gnu.org>
parents: 33636
diff changeset
461 (defun vc-rcs-cancel-version (file editable)
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
462 "Undo the most recent checkin of FILE.
35133
1b45907ef7a8 (vc-rcs-checkout, vc-rcs-cancel-version): Renamed arg WRITABLE to EDITABLE.
André Spiegel <spiegel@gnu.org>
parents: 33636
diff changeset
463 EDITABLE non-nil means previous version should be locked."
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
464 (let* ((target (vc-workfile-version file))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
465 (previous (if (vc-trunk-p target) "" (vc-branch-part target)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
466 (config (current-window-configuration))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
467 (done nil))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
468 (vc-do-command nil 0 "rcs" (vc-name file) (concat "-o" target))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
469 ;; Check out the most recent remaining version. If it fails, because
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
470 ;; the whole branch got deleted, do a double-take and check out the
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
471 ;; version where the branch started.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
472 (while (not done)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
473 (condition-case err
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
474 (progn
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
475 (vc-do-command nil 0 "co" (vc-name file) "-f"
35133
1b45907ef7a8 (vc-rcs-checkout, vc-rcs-cancel-version): Renamed arg WRITABLE to EDITABLE.
André Spiegel <spiegel@gnu.org>
parents: 33636
diff changeset
476 (concat (if editable "-l" "-u") previous))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
477 (setq done t))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
478 (error (set-buffer "*vc*")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
479 (goto-char (point-min))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
480 (if (search-forward "no side branches present for" nil t)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
481 (progn (setq previous (vc-branch-part previous))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
482 (vc-rcs-set-default-branch file previous)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
483 ;; vc-do-command popped up a window with
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
484 ;; the error message. Get rid of it, by
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
485 ;; restoring the old window configuration.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
486 (set-window-configuration config))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
487 ;; No, it was some other error: re-signal it.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
488 (signal (car err) (cdr err))))))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
489
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
490 (defun vc-rcs-merge (file first-version &optional second-version)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
491 "Merge changes into current working copy of FILE.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
492 The changes are between FIRST-VERSION and SECOND-VERSION."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
493 (vc-do-command nil 1 "rcsmerge" (vc-name file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
494 "-kk" ; ignore keyword conflicts
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
495 (concat "-r" first-version)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
496 (if second-version (concat "-r" second-version))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
497
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
498 (defun vc-rcs-steal-lock (file &optional rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
499 "Steal the lock on the current workfile for FILE and revision REV.
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
500 Needs RCS 5.6.2 or later for -M."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
501 (vc-do-command nil 0 "rcs" (vc-name file) "-M"
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
502 (concat "-u" rev) (concat "-l" rev)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
503
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
504
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
505
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
506 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
507 ;;; History functions
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
508 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
509
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
510 (defun vc-rcs-print-log (file)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
511 "Get change log associated with FILE."
36712
551ff6f7ef12 (vc-rcs-print-log): Output to buffer *vc*, not the current buffer.
André Spiegel <spiegel@gnu.org>
parents: 35830
diff changeset
512 (vc-do-command nil 0 "rlog" (vc-name file)))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
513
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
514 (defun vc-rcs-show-log-entry (version)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
515 (when (re-search-forward
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
516 ;; also match some context, for safety
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
517 (concat "----\nrevision " version
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
518 "\\(\tlocked by:.*\n\\|\n\\)date: ") nil t)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
519 ;; set the display window so that
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
520 ;; the whole log entry is displayed
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
521 (let (start end lines)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
522 (beginning-of-line) (forward-line -1) (setq start (point))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
523 (if (not (re-search-forward "^----*\nrevision" nil t))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
524 (setq end (point-max))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
525 (beginning-of-line) (forward-line -1) (setq end (point)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
526 (setq lines (count-lines start end))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
527 (cond
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
528 ;; if the global information and this log entry fit
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
529 ;; into the window, display from the beginning
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
530 ((< (count-lines (point-min) end) (window-height))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
531 (goto-char (point-min))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
532 (recenter 0)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
533 (goto-char start))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
534 ;; if the whole entry fits into the window,
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
535 ;; display it centered
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
536 ((< (1+ lines) (window-height))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
537 (goto-char start)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
538 (recenter (1- (- (/ (window-height) 2) (/ lines 2)))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
539 ;; otherwise (the entry is too large for the window),
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
540 ;; display from the start
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
541 (t
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
542 (goto-char start)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
543 (recenter 0))))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
544
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
545 (defun vc-rcs-diff (file &optional oldvers newvers)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
546 "Get a difference report using RCS between two versions of FILE."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
547 (if (not oldvers) (setq oldvers (vc-workfile-version file)))
36712
551ff6f7ef12 (vc-rcs-print-log): Output to buffer *vc*, not the current buffer.
André Spiegel <spiegel@gnu.org>
parents: 35830
diff changeset
548 (apply 'vc-do-command "*vc-diff*" 1 "rcsdiff" file
35822
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
549 (append (list "-q"
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
550 (concat "-r" oldvers)
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
551 (and newvers (concat "-r" newvers)))
cd59c63d4aac (vc-rcs-diff-switches): New customization option.
André Spiegel <spiegel@gnu.org>
parents: 35178
diff changeset
552 (vc-diff-switches-list rcs))))
33560
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
553
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
554
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
555 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
556 ;;; Snapshot system
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
557 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
558
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
559 (defun vc-rcs-assign-name (file name)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
560 "Assign to FILE's latest version a given NAME."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
561 (vc-do-command nil 0 "rcs" (vc-name file) (concat "-n" name ":")))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
562
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
563
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
564 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
565 ;;; Miscellaneous
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
566 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
567
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
568 (defun vc-rcs-check-headers ()
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
569 "Check if the current file has any headers in it."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
570 (save-excursion
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
571 (goto-char (point-min))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
572 (re-search-forward "\\$[A-Za-z\300-\326\330-\366\370-\377]+\
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
573 \\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
574
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
575 (defun vc-rcs-clear-headers ()
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
576 "Implementation of vc-clear-headers for RCS."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
577 (let ((case-fold-search nil))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
578 (goto-char (point-min))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
579 (while (re-search-forward
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
580 (concat "\\$\\(Author\\|Date\\|Header\\|Id\\|Locker\\|Name\\|"
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
581 "RCSfile\\|Revision\\|Source\\|State\\): [^$\n]+\\$")
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
582 nil t)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
583 (replace-match "$\\1$"))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
584
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
585 (defun vc-rcs-rename-file (old new)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
586 ;; Just move the master file (using vc-rcs-master-templates).
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
587 (vc-rename-master (vc-name old) new vc-rcs-master-templates))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
588
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
589
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
590 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
591 ;;; Internal functions
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
592 ;;;
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
593
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
594 (defun vc-rcs-trunk-p (rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
595 "Return t if REV is an RCS revision on the trunk."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
596 (not (eq nil (string-match "\\`[0-9]+\\.[0-9]+\\'" rev))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
597
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
598 (defun vc-rcs-branch-part (rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
599 "Return the branch part of an RCS revision number REV"
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
600 (substring rev 0 (string-match "\\.[0-9]+\\'" rev)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
601
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
602 (defun vc-rcs-branch-p (rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
603 "Return t if REV is an RCS branch revision"
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
604 (not (eq nil (string-match "\\`[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*\\'" rev))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
605
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
606 (defun vc-rcs-minor-part (rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
607 "Return the minor version number of an RCS revision number REV."
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
608 (string-match "[0-9]+\\'" rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
609 (substring rev (match-beginning 0) (match-end 0)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
610
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
611 (defun vc-rcs-previous-version (rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
612 "Guess the previous RCS version number"
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
613 (let ((branch (vc-rcs-branch-part rev))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
614 (minor-num (string-to-number (vc-rcs-minor-part rev))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
615 (if (> minor-num 1)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
616 ;; version does probably not start a branch or release
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
617 (concat branch "." (number-to-string (1- minor-num)))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
618 (if (vc-rcs-trunk-p rev)
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
619 ;; we are at the beginning of the trunk --
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
620 ;; don't know anything to return here
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
621 ""
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
622 ;; we are at the beginning of a branch --
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
623 ;; return version of starting point
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
624 (vc-rcs-branch-part branch)))))
da206bbad86b Functions reordered.
André Spiegel <spiegel@gnu.org>
parents: 32096
diff changeset
625
31809
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
626 (defun vc-rcs-workfile-is-newer (file)
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
627 "Return non-nil if FILE is newer than its RCS master.
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
628 This likely means that FILE has been changed with respect
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
629 to its master version."
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
630 (let ((file-time (nth 5 (file-attributes file)))
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
631 (master-time (nth 5 (file-attributes (vc-name file)))))
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
632 (or (> (nth 0 file-time) (nth 0 master-time))
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
633 (and (= (nth 0 file-time) (nth 0 master-time))
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
634 (> (nth 1 file-time) (nth 1 master-time))))))
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
635
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
636 (defun vc-rcs-find-most-recent-rev (branch)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
637 "Find most recent revision on BRANCH."
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
638 (goto-char (point-min))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
639 (let ((latest-rev -1) value)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
640 (while (re-search-forward (concat "^\\(" (regexp-quote branch)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
641 "\\.\\([0-9]+\\)\\)\ndate[ \t]+[0-9.]+;")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
642 nil t)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
643 (let ((rev (string-to-number (match-string 2))))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
644 (when (< latest-rev rev)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
645 (setq latest-rev rev)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
646 (setq value (match-string 1)))))
31809
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
647 (or value
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
648 (vc-rcs-branch-part branch))))
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
649
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
650 (defun vc-rcs-fetch-master-state (file &optional workfile-version)
31476
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
651 "Compute the master file's idea of the state of FILE.
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
652 If a WORKFILE-VERSION is given, compute the state of that version,
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
653 otherwise determine the workfile version based on the master file.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
654 This function sets the properties `vc-workfile-version' and
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
655 `vc-checkout-model' to their correct values, based on the master
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
656 file."
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
657 (with-temp-buffer
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
658 (vc-insert-file (vc-name file) "^[0-9]")
32094
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
659 (let ((workfile-is-latest nil)
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
660 (default-branch (vc-parse-buffer "^branch[ \t\n]+\\([^;]*\\);" 1)))
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
661 (vc-file-setprop file 'vc-rcs-default-branch default-branch)
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
662 (unless workfile-version
32094
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
663 ;; Workfile version not known yet. Determine that first. It
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
664 ;; is either the head of the trunk, the head of the default
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
665 ;; branch, or the "default branch" itself, if that is a full
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
666 ;; revision number.
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
667 (cond
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
668 ;; no default branch
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
669 ((or (not default-branch) (string= "" default-branch))
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
670 (setq workfile-version
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
671 (vc-parse-buffer "^head[ \t\n]+\\([^;]+\\);" 1))
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
672 (setq workfile-is-latest t))
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
673 ;; default branch is actually a revision
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
674 ((string-match "^[0-9]+\\.[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*$"
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
675 default-branch)
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
676 (setq workfile-version default-branch))
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
677 ;; else, search for the head of the default branch
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
678 (t (vc-insert-file (vc-name file) "^desc")
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
679 (setq workfile-version
32094
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
680 (vc-rcs-find-most-recent-rev default-branch))
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
681 (setq workfile-is-latest t)))
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
682 (vc-file-setprop file 'vc-workfile-version workfile-version))
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
683 ;; Check strict locking
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
684 (goto-char (point-min))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
685 (vc-file-setprop file 'vc-checkout-model
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
686 (if (re-search-forward ";[ \t\n]*strict;" nil t)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
687 'locking 'implicit))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
688 ;; Compute state of workfile version
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
689 (goto-char (point-min))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
690 (let ((locking-user
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
691 (vc-parse-buffer (concat "^locks[ \t\n]+[^;]*[ \t\n]+\\([^:]+\\):"
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
692 (regexp-quote workfile-version)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
693 "[^0-9.]")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
694 1)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
695 (cond
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
696 ;; not locked
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
697 ((not locking-user)
31476
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
698 (if (or workfile-is-latest
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
699 (vc-rcs-latest-on-branch-p file workfile-version))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
700 ;; workfile version is latest on branch
33610
32bcc6e27e02 (vc-rcs-state): Call vc-workfile-unchanged-p only here, and
André Spiegel <spiegel@gnu.org>
parents: 33560
diff changeset
701 'up-to-date
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
702 ;; workfile version is not latest on branch
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
703 'needs-patch))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
704 ;; locked by the calling user
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
705 ((and (stringp locking-user)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
706 (string= locking-user (vc-user-login-name)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
707 (if (or (eq (vc-checkout-model file) 'locking)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
708 workfile-is-latest
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
709 (vc-rcs-latest-on-branch-p file workfile-version))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
710 'edited
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
711 ;; Locking is not used for the file, but the owner does
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
712 ;; have a lock, and there is a higher version on the current
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
713 ;; branch. Not sure if this can occur, and if it is right
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
714 ;; to use `needs-merge' in this case.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
715 'needs-merge))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
716 ;; locked by somebody else
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
717 ((stringp locking-user)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
718 locking-user)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
719 (t
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
720 (error "Error getting state of RCS file")))))))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
721
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
722 (defun vc-rcs-consult-headers (file)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
723 "Search for RCS headers in FILE, and set properties accordingly.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
724
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
725 Returns: nil if no headers were found
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
726 'rev if a workfile revision was found
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
727 'rev-and-lock if revision and lock info was found"
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
728 (cond
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
729 ((not (get-file-buffer file)) nil)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
730 ((let (status version locking-user)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
731 (save-excursion
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
732 (set-buffer (get-file-buffer file))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
733 (goto-char (point-min))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
734 (cond
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
735 ;; search for $Id or $Header
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
736 ;; -------------------------
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
737 ;; The `\ 's below avoid an RCS 5.7 bug when checking in this file.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
738 ((or (and (search-forward "$Id\ : " nil t)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
739 (looking-at "[^ ]+ \\([0-9.]+\\) "))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
740 (and (progn (goto-char (point-min))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
741 (search-forward "$Header\ : " nil t))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
742 (looking-at "[^ ]+ \\([0-9.]+\\) ")))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
743 (goto-char (match-end 0))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
744 ;; if found, store the revision number ...
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
745 (setq version (match-string-no-properties 1))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
746 ;; ... and check for the locking state
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
747 (cond
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
748 ((looking-at
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
749 (concat "[0-9]+[/-][01][0-9][/-][0-3][0-9] " ; date
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
750 "[0-2][0-9]:[0-5][0-9]+:[0-6][0-9]+\\([+-][0-9:]+\\)? " ; time
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
751 "[^ ]+ [^ ]+ ")) ; author & state
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
752 (goto-char (match-end 0)) ; [0-6] in regexp handles leap seconds
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
753 (cond
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
754 ;; unlocked revision
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
755 ((looking-at "\\$")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
756 (setq locking-user 'none)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
757 (setq status 'rev-and-lock))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
758 ;; revision is locked by some user
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
759 ((looking-at "\\([^ ]+\\) \\$")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
760 (setq locking-user (match-string-no-properties 1))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
761 (setq status 'rev-and-lock))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
762 ;; everything else: false
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
763 (nil)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
764 ;; unexpected information in
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
765 ;; keyword string --> quit
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
766 (nil)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
767 ;; search for $Revision
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
768 ;; --------------------
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
769 ((re-search-forward (concat "\\$"
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
770 "Revision: \\([0-9.]+\\) \\$")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
771 nil t)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
772 ;; if found, store the revision number ...
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
773 (setq version (match-string-no-properties 1))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
774 ;; and see if there's any lock information
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
775 (goto-char (point-min))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
776 (if (re-search-forward (concat "\\$" "Locker:") nil t)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
777 (cond ((looking-at " \\([^ ]+\\) \\$")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
778 (setq locking-user (match-string-no-properties 1))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
779 (setq status 'rev-and-lock))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
780 ((looking-at " *\\$")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
781 (setq locking-user 'none)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
782 (setq status 'rev-and-lock))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
783 (t
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
784 (setq locking-user 'none)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
785 (setq status 'rev-and-lock)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
786 (setq status 'rev)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
787 ;; else: nothing found
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
788 ;; -------------------
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
789 (t nil)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
790 (if status (vc-file-setprop file 'vc-workfile-version version))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
791 (and (eq status 'rev-and-lock)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
792 (vc-file-setprop file 'vc-state
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
793 (cond
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
794 ((eq locking-user 'none) 'up-to-date)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
795 ((string= locking-user (vc-user-login-name)) 'edited)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
796 (t locking-user)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
797 ;; If the file has headers, we don't want to query the
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
798 ;; master file, because that would eliminate all the
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
799 ;; performance gain the headers brought us. We therefore
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
800 ;; use a heuristic now to find out whether locking is used
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
801 ;; for this file. If we trust the file permissions, and the
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
802 ;; file is not locked, then if the file is read-only we
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
803 ;; assume that locking is used for the file, otherwise
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
804 ;; locking is not used.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
805 (not (vc-mistrust-permissions file))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
806 (vc-up-to-date-p file)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
807 (if (string-match ".r-..-..-." (nth 8 (file-attributes file)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
808 (vc-file-setprop file 'vc-checkout-model 'locking)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
809 (vc-file-setprop file 'vc-checkout-model 'implicit)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
810 status))))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
811
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
812 (defun vc-release-greater-or-equal (r1 r2)
31476
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
813 "Compare release numbers, represented as strings.
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
814 Release components are assumed cardinal numbers, not decimal fractions
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
815 \(5.10 is a higher release than 5.9\). Omitted fields are considered
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
816 lower \(5.6.7 is earlier than 5.6.7.1\). Comparison runs till the end
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
817 of the string is found, or a non-numeric component shows up \(5.6.7 is
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
818 earlier than \"5.6.7 beta\", which is probably not what you want in
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
819 some cases\). This code is suitable for existing RCS release numbers.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
820 CVS releases are handled reasonably, too \(1.3 < 1.4* < 1.5\)."
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
821 (let (v1 v2 i1 i2)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
822 (catch 'done
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
823 (or (and (string-match "^\\.?\\([0-9]+\\)" r1)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
824 (setq i1 (match-end 0))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
825 (setq v1 (string-to-number (match-string 1 r1)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
826 (or (and (string-match "^\\.?\\([0-9]+\\)" r2)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
827 (setq i2 (match-end 0))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
828 (setq v2 (string-to-number (match-string 1 r2)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
829 (if (> v1 v2) (throw 'done t)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
830 (if (< v1 v2) (throw 'done nil)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
831 (throw 'done
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
832 (vc-release-greater-or-equal
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
833 (substring r1 i1)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
834 (substring r2 i2)))))))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
835 (throw 'done t)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
836 (or (and (string-match "^\\.?\\([0-9]+\\)" r2)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
837 (throw 'done nil))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
838 (throw 'done t)))))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
839
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
840 (defun vc-rcs-release-p (release)
31476
18bf0c070870 Doc fixes.
Dave Love <fx@gnu.org>
parents: 31404
diff changeset
841 "Return t if we have RELEASE or better."
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
842 (let ((installation (vc-rcs-system-release)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
843 (if (and installation
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
844 (not (eq installation 'unknown)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
845 (vc-release-greater-or-equal installation release))))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
846
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
847
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
848 (defun vc-rcs-system-release ()
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
849 "Return the RCS release installed on this system, as a string.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
850 Return symbol UNKNOWN if the release cannot be deducted. The user can
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
851 override this using variable `vc-rcs-release'.
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
852
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
853 If the user has not set variable `vc-rcs-release' and it is nil,
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
854 variable `vc-rcs-release' is set to the returned value."
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
855 (or vc-rcs-release
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
856 (setq vc-rcs-release
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
857 (or (and (zerop (vc-do-command nil nil "rcs" nil "-V"))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
858 (with-current-buffer (get-buffer "*vc*")
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
859 (vc-parse-buffer "^RCS version \\([0-9.]+ *.*\\)" 1)))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
860 'unknown))))
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
861
31809
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
862 (defun vc-rcs-set-non-strict-locking (file)
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
863 (vc-do-command nil 0 "rcs" file "-U")
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
864 (vc-file-setprop file 'vc-checkout-model 'implicit)
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
865 (set-file-modes file (logior (file-modes file) 128)))
a2c432c6b343 (vc-rcs-workfile-is-newer): New function.
André Spiegel <spiegel@gnu.org>
parents: 31520
diff changeset
866
32094
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
867 (defun vc-rcs-set-default-branch (file branch)
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
868 (vc-do-command nil 0 "rcs" (vc-name file) (concat "-b" branch))
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
869 (vc-file-setprop file 'vc-rcs-default-branch branch))
027fb880735d (vc-rcs-fetch-master-state): Parse and remember default branch
André Spiegel <spiegel@gnu.org>
parents: 32058
diff changeset
870
31383
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
871 (provide 'vc-rcs)
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
872
860d7ac182e3 (vc-rcs-show-log-entry): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
873 ;;; vc-rcs.el ends here