annotate lisp/pcl-cvs/pcl-cvs.el @ 142:1856695b1fa9 r20-2b5

Import from CVS: tag r20-2b5
author cvs
date Mon, 13 Aug 2007 09:33:18 +0200
parents 8619ce7e4c50
children 3d6bfa290dbd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;;#ident "@(#)OrigId: pcl-cvs.el,v 1.93 1993/05/31 22:44:00 ceder Exp "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;;
142
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 114
diff changeset
4 ;;;#ident "@(#)cvs/contrib/pcl-cvs:$Name: r20-2b5 $:$Id: pcl-cvs.el,v 1.4 1997/05/09 03:28:08 steve Exp $"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;;; pcl-cvs.el -- A Front-end to CVS 1.3 or later.
142
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 114
diff changeset
7 ;;; Release 1.05-CVS-$Name: r20-2b5 $.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;; Copyright (C) 1991, 1992, 1993 Per Cederqvist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; This program is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; the Free Software Foundation; either version 2 of the License, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; (at your option) any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; This program is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;; along with this program; if not, write to the Free Software
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
22 ;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
23 ;;; 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; See below for installation instructions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; There is an TeXinfo file that describes this package. You should read it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; to get the most from this package.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;; Mail questions and bug reports regarding this version (as included in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;; CVS-1.7 or newer) to the pcl-cvs support team at <pcl-cvs@cyclic.com>.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;; Don't try to use this with CVS 1.2 or earlier. It won't work. Get CVS 1.7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;;; or newer. Use the version of RCS best suited for the version of CVS you're
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;;; using.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
37 (require 'cookie) ; from ELIB-1.0
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (require 'add-log) ; for all the ChangeLog goodies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;;; -------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;;; START OF THINGS TO CHECK WHEN INSTALLING
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; also use $GNU here, since may folks might install CVS as a GNU package
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;;
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
45 (defun cvs-find-program (program)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
46 (let ((path (list (getenv "LOCAL")
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
47 (getenv "GNU")
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
48 "/usr/local/bin"
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
49 "/usr/bin"
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
50 "/bin")))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
51 (while path
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
52 (if (stringp (car path))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
53 (let ((abs-program (expand-file-name program (car path))))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
54 (if (file-executable-p abs-program)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
55 (setq path nil
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
56 program abs-program))))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
57 (setq path (cdr path)))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
58 program))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
59
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
60 (defvar cvs-program (cvs-find-program "cvs")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 "*Full path to the cvs executable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;; SunOS-4.1.1_U1 has "diff.c 1.12 88/08/04 SMI; from UCB 4.6 86/04/03"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;;
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
65 (defvar cvs-diff-program (cvs-find-program "diff")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 "*Full path to the best diff program you've got.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 NOTE: there are some nasty bugs in the context diff variants of some vendor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 versions, such as the one in SunOS-4.1.1_U1")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (defvar cvs-rmdir-program "/bin/rmdir"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 "*Full path to the rmdir program. Typically /bin/rmdir.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (defvar cvs-shell "/bin/sh"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 "*Full path to a shell that can do redirection on stdout.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ;;; Options to control various features:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (defvar cvs-changelog-full-paragraphs t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 "If non-nil, include full ChangeLog paragraphs in the CVS log.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 This may be set in the ``local variables'' section of a ChangeLog, to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 indicate the policy for that ChangeLog.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 A ChangeLog paragraph is a bunch of log text containing no blank lines;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 a paragraph usually describes a set of changes with a single purpose,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 but perhaps spanning several functions in several files. Changes in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 different paragraphs are unrelated.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 You could argue that the CVS log entry for a file should contain the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 full ChangeLog paragraph mentioning the change to the file, even though
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 it may mention other files, because that gives you the full context you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 need to understand the change. This is the behaviour you get when this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 variable is set to t.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 On the other hand, you could argue that the CVS log entry for a change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 should contain only the text for the changes which occurred in that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 file, because the CVS log is per-file. This is the behaviour you get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 when this variable is set to nil.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (defvar cvs-cvsroot-required nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 "*Specifies whether CVS needs to be told where the repository is.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 In CVS 1.3, if your CVSROOT environment variable is not set, and you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 do not set the `cvs-cvsroot' lisp variable, CVS will have no idea
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 where to find the repository, and refuse to run. CVS 1.4 and later
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 store the repository path with the working directories, so most
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 operations don't need to be told where the repository is.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 If you work with multiple repositories with CVS 1.4, it's probably
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 advisable to leave your CVSROOT environment variable unset, set this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 variable to nil, and let CVS figure out where the repository is for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 itself.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (defvar cvs-cvsroot nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 "*Specifies where the (current) cvs master repository is.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 Overrides the $CVSROOT variable by sending \" -d dir\" to all cvs commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 This switch is useful if you have multiple CVS repositories, and are not using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 a modern version of CVS that stores the current repository in CVS/Root.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 ;; Uncomment the following line if you are running on 18.57 or earlier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ;(setq delete-exited-processes nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ;; Emacs version 18.57 and earlier is likely to crash if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ;; delete-exited-processes is t, since the sentinel uses lots of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ;; memory, and 18.57 forgets to GCPROT a variable if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ;; delete-exited-processes is t.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ;;; END OF THINGS TO CHECK WHEN INSTALLING
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ;;; --------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
142
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 114
diff changeset
129 (defconst pcl-cvs-version "1.05-CVS-$Name: r20-2b5 $"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 "A string denoting the current release version of pcl-cvs.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ;; You are NOT allowed to disable this message by default. However, you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ;; are encouraged to inform your users that by adding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ;; (setq cvs-inhibit-copyright-message t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ;; to their .emacs they can get rid of it. Just don't add that line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ;; to your default.el!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (defvar cvs-inhibit-copyright-message nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 "*Non-nil means don't display a Copyright message in the ``*cvs*'' buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (defconst cvs-startup-message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (if cvs-inhibit-copyright-message
142
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 114
diff changeset
142 "PCL-CVS release 1.05-CVS-$Name: r20-2b5 $"
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 114
diff changeset
143 "PCL-CVS release 1.05 from CVS release $Name: r20-2b5 $.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 Copyright (C) 1992, 1993 Per Cederqvist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 Pcl-cvs comes with absolutely no warranty; for details consult the manual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 This is free software, and you are welcome to redistribute it under certain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 conditions; again, consult the TeXinfo manual for details.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 "*Startup message for CVS.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (defconst pcl-cvs-bugs-address "pcl-cvs-auto-bugs@cyclic.com"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 "The destination address used for the default bug report form.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (defvar cvs-stdout-file nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 "Name of the file that holds the output that CVS sends to stdout.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 This variable is buffer local.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (defvar cvs-lock-file nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 "Full path to a lock file that CVS is waiting for (or was waiting for).")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (defvar cvs-bakprefix ".#"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 "The prefix that CVS prepends to files when rcsmerge'ing.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (defvar cvs-erase-input-buffer nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 "*Non-nil if input buffers should be cleared before asking for new info.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (defvar cvs-auto-remove-handled nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 "*Non-nil if cvs-mode-remove-handled should be called automatically.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 If this is set to any non-nil value, entries that do not need to be checked in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 will be removed from the *cvs* buffer after every cvs-mode-commit command.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (defvar cvs-auto-remove-handled-directories nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 "*Non-nil if cvs-mode-remove-handled and cvs-update should automatically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 remove empty directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 If this is set to any non-nil value, directories that do not contain any files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 to be checked in will be removed from the *cvs* buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (defvar cvs-sort-ignore-file t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 "*Non-nil if cvs-mode-ignore should sort the .cvsignore automatically.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (defvar cvs-auto-revert-after-commit t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 "*Non-nil if committed buffers should be automatically reverted.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (defconst cvs-cursor-column 14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 "Column to position cursor in in cvs-mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 Column 0 is left-most column.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (defvar cvs-mode-map nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 "Keymap for the cvs mode.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (defvar cvs-edit-mode-map nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 "Keymap for the cvs edit mode (used when editing cvs log messages).")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (defvar cvs-buffer-name "*cvs*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 "Name of the cvs buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (defvar cvs-commit-prompt-buffer "*cvs-commit-message*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 "Name of buffer in which the user is prompted for a log message when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 committing files.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (defvar cvs-commit-buffer-require-final-newline t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 "*t says silently put a newline at the end of commit log messages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 Non-nil but not t says ask user whether to add a newline in each such case.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 nil means don't add newlines.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (defvar cvs-temp-buffer-name "*cvs-tmp*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 "*Name of the cvs temporary buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 Output from cvs is placed here by synchronous commands.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (defvar cvs-diff-ignore-marks nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 "*Non-nil if cvs-diff and cvs-mode-diff-backup should ignore any marked files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 Normally they run diff on the files that are marked (with cvs-mode-mark),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 or the file under the cursor if no files are marked. If this variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 is set to a non-nil value they will always run diff on the file on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 current line.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 ;;; (setq cvs-status-flags '("-v"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (defvar cvs-status-flags '("-v")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 "*List of flags to pass to ``cvs status''. Default is \"-v\".")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 ;;; (setq cvs-log-flags nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (defvar cvs-log-flags nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 "*List of flags to pass to ``cvs log''. Default is none.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 ;;; (setq cvs-tag-flags nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (defvar cvs-tag-flags nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 "*List of extra flags to pass to ``cvs tag''. Default is none.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 ;;; (setq cvs-rtag-flags nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (defvar cvs-rtag-flags nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 "*List of extra flags to pass to ``cvs rtag''. Default is none.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 ;;; (setq cvs-diff-flags '("-u"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (defvar cvs-diff-flags '("-u")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 "*List of flags to use as flags to pass to ``diff'' and ``cvs diff''.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 Used by cvs-mode-diff-cvs and cvs-mode-diff-backup. Default is \"-u\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 Set this to \"-u\" to get a Unidiff format, or \"-c\" to get context diffs.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ;;; (setq cvs-update-optional-flags nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (defvar cvs-update-optional-flags nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 "*List of strings to use as optional flags to pass to ``cvs update''. Used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 by cvs-do-update, called by cvs-update, cvs-update-other-window,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 cvs-mode-update-no-prompt, and cvs-examine. Default is none.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 For example set this to \"-j VENDOR_PREV_RELEASE -j VENDOR_TOP_RELEASE\" to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 perform an update after a new vendor release has been imported.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 To restrict the update to the current working directory, set this to \"-l\".")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (defvar cvs-update-prog-output-skip-regexp "$"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 "*A regexp that matches the end of the output from all cvs update programs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 That is, output from any programs that are run by CVS (by the flag -u in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 `modules' file - see cvs(5)) when `cvs update' is performed should terminate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 with a line that this regexp matches. It is enough that some part of the line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 is matched.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 The default (a single $) fits programs without output.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 ;;; --------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 ;;; The variables below are used internally by pcl-cvs. You should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 ;;; never change them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (defvar cvs-buffers-to-delete nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 "List of temporary buffers that should be discarded as soon as possible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 Due to a bug in emacs 18.57 the sentinel can't discard them reliably.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (defvar cvs-update-running nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 "This is set to nil when no process is running, and to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 the process when a cvs update process is running.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (defvar cvs-cookie-handle nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 "Handle for the cookie structure that is displayed in the *cvs* buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (defvar cvs-commit-list nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 "Used internally by pcl-cvs.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 ;;; The cvs data structure:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 ;;; When the `cvs update' is ready we parse the output. Every file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 ;;; that is affected in some way is added as a cookie of fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 ;;; (as defined below).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 ;;; cvs-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 ;;; Constructor:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (defun cvs-create-fileinfo (type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 full-log)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 "Create a fileinfo from all parameters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 Arguments: TYPE DIR FILE-NAME FULL-LOG.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 A fileinfo is a vector with the following fields:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 [0] handled True if this file doesn't require further action.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 [1] marked t/nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 [2] type One of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 UPDATED - file copied from repository
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 PATCHED - file update with patch from repository
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 MODIFIED - modified by you, unchanged in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 repository
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 ADDED - added by you, not yet committed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 REMOVED - removed by you, not yet committed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 CVS-REMOVED- removed, since file no longer exists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 in the repository.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 MERGED - successful merge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 CONFLICT - conflict when merging (if pcl-cvs did it)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 REM-CONFLICT-removed in repository, but altered
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 locally.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 MOD-CONFLICT-removed locally, changed in repository.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 REM-EXIST - removed locally, but still exists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 DIRCHANGE - A change of directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 UNKNOWN - An unknown file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 UNKNOWN-DIR- An unknown directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 MOVE-AWAY - A file that is in the way.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 REPOS-MISSING- The directory has vanished from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 repository.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 MESSAGE - This is a special fileinfo that is used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 to display a text that should be in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 full-log.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 [3] dir Directory the file resides in. Should not end with slash.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 [4] file-name The file name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 [5] backup-file The name of a backup file created during a merge.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 Only valid for MERGED and CONFLICT files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 [6] base-revision The revision that the working file was based on.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 Only valid for MERGED and CONFLICT files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 [7] head-revision The revision that the newly merged changes came from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 Only valid for MERGED and CONFLICT files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 [8] backup-revision The revision of the cvs backup file (original working rev.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 Only valid for MERGED and CONFLICT files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 [9] cvs-diff-buffer A buffer that contains a 'cvs diff file'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 [10] vendor-diff-buffer A buffer that contains a 'diff base-file head-file'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 [11] backup-diff-buffer A buffer that contains a 'diff file backup-file'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 [12] full-log The output from cvs, unparsed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 [13] mod-time Modification time of file used for *-diff-buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 'CVS-FILEINFO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (vector nil nil type dir file-name nil nil nil nil nil nil nil full-log nil nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 ;;; Selectors:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (defun cvs-fileinfo->handled (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 "Get the `handled' field from CVS-FILEINFO."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (elt (cdr cvs-fileinfo) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (defun cvs-fileinfo->marked (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 "Check if CVS-FILEINFO is marked."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (elt (cdr cvs-fileinfo) 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (defun cvs-fileinfo->type (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 "Get type from CVS-FILEINFO.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 Type is one of UPDATED, PATCHED, MODIFIED, ADDED, REMOVED, CVS-REMOVED, MERGED,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 CONFLICT, REM-CONFLICT, MOD-CONFLICT, REM-EXIST, DIRCHANGE, UNKNOWN,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 UNKNOWN-DIR, MOVE-AWAY, REPOS-MISSING or MESSAGE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (elt (cdr cvs-fileinfo) 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (defun cvs-fileinfo->dir (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 "Get dir from CVS-FILEINFO.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 The directory name does not end with a slash."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (elt (cdr cvs-fileinfo) 3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (defun cvs-fileinfo->file-name (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 "Get file-name from CVS-FILEINFO."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (elt (cdr cvs-fileinfo) 4))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (defun cvs-fileinfo->backup-file (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 "Get backup-file from CVS-FILEINFO."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (elt (cdr cvs-fileinfo) 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (defun cvs-fileinfo->base-revision (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 "Get the base revision from CVS-FILEINFO."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (elt (cdr cvs-fileinfo) 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (defun cvs-fileinfo->head-revision (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 "Get the head revision from CVS-FILEINFO."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (elt (cdr cvs-fileinfo) 7))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (defun cvs-fileinfo->backup-revision (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 "Get the backup revision from CVS-FILEINFO."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (elt (cdr cvs-fileinfo) 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (defun cvs-fileinfo->cvs-diff-buffer (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 "Get cvs-diff-buffer from CVS-FILEINFO."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (elt (cdr cvs-fileinfo) 9))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (defun cvs-fileinfo->vendor-diff-buffer (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 "Get backup-diff-buffer from CVS-FILEINFO."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (elt (cdr cvs-fileinfo) 10))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (defun cvs-fileinfo->backup-diff-buffer (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 "Get backup-diff-buffer from CVS-FILEINFO."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (elt (cdr cvs-fileinfo) 11))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (defun cvs-fileinfo->full-log (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 "Get full-log from CVS-FILEINFO."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (elt (cdr cvs-fileinfo) 12))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (defun cvs-fileinfo->mod-time (cvs-fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 "Get mod-time from CVS-FILEINFO."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (elt (cdr cvs-fileinfo) 13))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 ;;; Modifiers:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (defun cvs-set-fileinfo->handled (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 "Set handled in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (aset (cdr cvs-fileinfo) 0 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (defun cvs-set-fileinfo->marked (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 "Set marked in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (aset (cdr cvs-fileinfo) 1 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (defun cvs-set-fileinfo->type (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 "Set type in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (aset (cdr cvs-fileinfo) 2 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (defun cvs-set-fileinfo->dir (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 "Set dir in CVS-FILEINFO to NEWVAL.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 The directory should now end with a slash."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (aset (cdr cvs-fileinfo) 3 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (defun cvs-set-fileinfo->file-name (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 "Set file-name in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (aset (cdr cvs-fileinfo) 4 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (defun cvs-set-fileinfo->backup-file (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 "Set backup-file in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (aset (cdr cvs-fileinfo) 5 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (defun cvs-set-fileinfo->base-revision (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 "Set base-revision in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (aset (cdr cvs-fileinfo) 6 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (defun cvs-set-fileinfo->head-revision (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 "Set head-revision in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (aset (cdr cvs-fileinfo) 7 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (defun cvs-set-fileinfo->backup-revision (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 "Set backup-revision in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (aset (cdr cvs-fileinfo) 8 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 (defun cvs-set-fileinfo->cvs-diff-buffer (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 "Set cvs-diff-buffer in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (aset (cdr cvs-fileinfo) 9 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (defun cvs-set-fileinfo->vendor-diff-buffer (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 "Set vendor-diff-buffer in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (aset (cdr cvs-fileinfo) 10 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (defun cvs-set-fileinfo->backup-diff-buffer (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 "Set backup-diff-buffer in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (aset (cdr cvs-fileinfo) 11 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (defun cvs-set-fileinfo->full-log (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 "Set full-log in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (aset (cdr cvs-fileinfo) 12 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (defun cvs-set-fileinfo->mod-time (cvs-fileinfo newval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 "Set full-log in CVS-FILEINFO to NEWVAL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (aset (cdr cvs-fileinfo) 13 newval))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 ;;; Predicate:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (defun cvs-fileinfo-p (object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 "Return t if OBJECT is a cvs-fileinfo."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (eq (car-safe object) 'CVS-FILEINFO))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 ;;;; End of types.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (defun cvs-use-temp-buffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 "Display a temporary buffer in another window and select it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 The selected window will not be changed. The temporary buffer will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 be erased and writable."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (let ((dir default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (display-buffer (get-buffer-create cvs-temp-buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (set-buffer cvs-temp-buffer-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (setq buffer-read-only nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (setq default-directory dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (erase-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (defun cvs-examine (directory &optional local)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 "Run a 'cvs -n update' in the current working directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 That is, check what needs to be done, but don't change the disc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 Feed the output to a *cvs* buffer and run cvs-mode on it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 If optional prefix argument LOCAL is non-nil, 'cvs update -l' is run.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 WARNING: this doesn't work very well yet...."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 ;; TODO: this should do everything cvs-update does...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 ;; for example, for CONFLICT files, it should setup fileinfo appropriately
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (interactive (list (read-file-name "CVS Update (directory): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 nil default-directory nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 current-prefix-arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 (cvs-do-update directory local 'noupdate))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (defun cvs-update (directory &optional local)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 "Run a 'cvs update' in the current working directory. Feed the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 output to a *cvs* buffer and run cvs-mode on it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 If optional prefix argument LOCAL is non-nil, 'cvs update -l' is run."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (interactive (list (read-file-name "CVS Update (directory): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 nil default-directory nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 current-prefix-arg))
142
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 114
diff changeset
510 ;; If the previous prompt was in a dialog box, the save-some-buffers
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 114
diff changeset
511 ;; call in cvs-do-update will lose.
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 114
diff changeset
512 (let ((use-dialog-box nil))
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 114
diff changeset
513 (cvs-do-update directory local nil))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (switch-to-buffer cvs-buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (defun cvs-update-other-window (directory &optional local)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 "Run a 'cvs update' in the current working directory. Feed the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 output to a *cvs* buffer, display it in the other window, and run
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 cvs-mode on it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 If optional prefix argument LOCAL is non-nil, 'cvs update -l' is run."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 (interactive (list (read-file-name "CVS Update other window (directory): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 nil default-directory nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 current-prefix-arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (cvs-do-update directory local nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (switch-to-buffer-other-window cvs-buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (defun cvs-filter (predicate list &rest extra-args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 "Apply PREDICATE to each element on LIST.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 Args: PREDICATE LIST &rest EXTRA-ARGS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 Return a new list consisting of those elements that PREDICATE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 returns non-nil for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 If more than two arguments are given the remaining args are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 passed to PREDICATE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 ;; Avoid recursion - this should work for LONG lists also!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (let* ((head (cons 'dummy-header nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (tail head))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (while list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (if (apply predicate (car list) extra-args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (setq tail (setcdr tail (list (car list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (setq list (cdr list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (cdr head)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (defun cvs-mode-update-no-prompt ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 "Run cvs update in current directory."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (cvs-do-update default-directory nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (defun cvs-do-update (directory local dont-change-disc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 "Do a 'cvs update' in DIRECTORY.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 Args: DIRECTORY LOCAL DONT-CHANGE-DISC.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 If LOCAL is non-nil 'cvs update -l' is executed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 If DONT-CHANGE-DISC is non-nil 'cvs -n update' is executed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 Both LOCAL and DONT-CHANGE-DISC may be non-nil simultaneously.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 *Note*: DONT-CHANGE-DISC does not yet work. The parser gets confused."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (save-some-buffers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 ;; Ensure that it is safe to do an update. If not, ask user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 ;; for confirmation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (if (and (boundp 'cvs-cookie-handle) (collection-buffer cvs-cookie-handle))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (if (collection-collect-tin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 '(lambda (cookie) (eq (cvs-fileinfo->type cookie) 'CONFLICT)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 (if (not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 (yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 "Only update if conflicts have been resolved. Continue? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (error "Update aborted by user request."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (if (not (file-exists-p cvs-program))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (error "%s: file not found (check setting of cvs-program)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 cvs-program))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (let* ((this-dir (file-name-as-directory (expand-file-name directory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 (update-buffer (generate-new-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (concat " " (file-name-nondirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 (substring this-dir 0 -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 "-update")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 (temp-name (make-temp-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 (concat (file-name-as-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 (or (getenv "TMPDIR") "/tmp"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 "pcl-cvs.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 (args nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 ;; Check that this-dir exists and is a directory that is under CVS contr.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 (if (not (file-directory-p this-dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (error "%s is not a directory." this-dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 (if (not (file-directory-p (concat this-dir "CVS")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 (error "%s does not contain CVS controlled files." this-dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 (if (file-readable-p (concat this-dir "CVS/Root"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 (save-excursion ; read CVS/Root into cvs-cvsroot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 (find-file (concat this-dir "CVS/Root"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 (setq cvs-cvsroot (buffer-substring (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 (progn (end-of-line) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 (if (not cvs-cvsroot)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 (error "Invalid contents of %sCVS/Root" this-dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 (kill-buffer (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 (if (and cvs-cvsroot-required
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 (not (or (getenv "CVSROOT") cvs-cvsroot)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 (error "Both cvs-cvsroot and environment variable CVSROOT are unset, and no CVS/Root.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 ;; Check that at most one `cvs update' is run at any time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 (if (and cvs-update-running (process-status cvs-update-running)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 (or (eq (process-status cvs-update-running) 'run)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 (eq (process-status cvs-update-running) 'stop)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 (error "Can't run two `cvs update' simultaneously."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 (if (not (listp cvs-update-optional-flags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 (error "cvs-update-optional-flags should be set using cvs-set-update-optional-flags"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 ;; Generate "-d /master -n update -l".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 (setq args (concat (if cvs-cvsroot (concat " -d " cvs-cvsroot))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 (if dont-change-disc " -n ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 " update "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 (if local " -l ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 (if cvs-update-optional-flags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 (mapconcat 'identity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 (copy-sequence cvs-update-optional-flags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 " "))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 ;; Set up the buffer that receives the stderr output from "cvs update".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 (set-buffer update-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 (setq default-directory this-dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 (make-local-variable 'cvs-stdout-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 (setq cvs-stdout-file temp-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 (setq cvs-update-running
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 (let ((process-connection-type nil)) ; Use a pipe, not a pty.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 (start-process "cvs" update-buffer cvs-shell "-c"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 (concat cvs-program " " args " > " temp-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 (setq mode-line-process
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 (concat ": "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 (symbol-name (process-status cvs-update-running))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 ; XEmacs change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 (redraw-modeline) ; Update the mode line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 (set-process-sentinel cvs-update-running 'cvs-sentinel)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 (set-process-filter cvs-update-running 'cvs-update-filter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 (set-marker (process-mark cvs-update-running) (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 (set-buffer (get-buffer-create cvs-buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 (setq buffer-read-only nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 (cvs-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 (setq cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 (collection-create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 cvs-buffer-name 'cvs-pp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 cvs-startup-message ;See comment above cvs-startup-message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 "---------- End -----"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 (cookie-enter-first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 'MESSAGE nil nil (concat "\n Running `cvs " args "' in " this-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 "...\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 (set-buffer cvs-buffer-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 (setq mode-line-process
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 (concat ": "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 (symbol-name (process-status cvs-update-running))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 ; XEmacs change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 (redraw-modeline) ; Update the mode line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 (setq buffer-read-only t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 ;; Work around a bug in emacs 18.57 and earlier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 (setq cvs-buffers-to-delete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 (cvs-delete-unused-temporary-buffers cvs-buffers-to-delete)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 ;; The following line is said to improve display updates on some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 ;; emacses. It shouldn't be needed, but it does no harm.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 (sit-for 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 (defun cvs-delete-unused-temporary-buffers (list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 "Delete all buffers on LIST that is not visible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 Return a list of all buffers that still is alive."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 ((null list) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 ((get-buffer-window (car list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 (cons (car list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 (cvs-delete-unused-temporary-buffers (cdr list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 (kill-buffer (car list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 (cvs-delete-unused-temporary-buffers (cdr list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 (put 'cvs-mode 'mode-class 'special)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 (defun cvs-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 "\\<cvs-mode-map>Mode used for pcl-cvs, a front-end to CVS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 To get to the \"*cvs*\" buffer you should use ``\\[execute-extended-command] cvs-update''.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 Full documentation is in the Texinfo file. Here are the most useful commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 \\[cvs-mode-previous-line] Move up. \\[cvs-mode-next-line] Move down.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 \\[cvs-mode-commit] Commit file. \\[cvs-mode-update-no-prompt] Re-update directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 \\[cvs-mode-mark] Mark file/dir. \\[cvs-mode-unmark] Unmark file/dir.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 \\[cvs-mode-mark-all-files] Mark all files. \\[cvs-mode-unmark-all-files] Unmark all files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 \\[cvs-mode-find-file] Edit file/run Dired. \\[cvs-mode-find-file-other-window] Find file or run Dired in other window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 \\[cvs-mode-ignore] Add file to ./.cvsignore. \\[cvs-mode-add-change-log-entry-other-window] Write ChangeLog in other window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 \\[cvs-mode-add] Add to repository. \\[cvs-mode-remove-file] Remove file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 \\[cvs-mode-diff-cvs] Diff with base revision. \\[cvs-mode-diff-backup] Diff backup file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 \\[cvs-mode-ediff] Ediff base rev & backup. \\[cvs-mode-diff-vendor] Show merge from vendor branch.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 \\[cvs-mode-emerge] Emerge base rev & backup. \\[cvs-mode-diff-backup] Diff backup file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 \\[cvs-mode-acknowledge] Delete line from buffer. \\[cvs-mode-remove-handled] Remove processed entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 \\[cvs-mode-log] Run ``cvs log''. \\[cvs-mode-status] Run ``cvs status''.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 \\[cvs-mode-tag] Run ``cvs tag''. \\[cvs-mode-rtag] Run ``cvs rtag''.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 \\[cvs-mode-changelog-commit] Like \\[cvs-mode-commit], but get default log text from ChangeLog.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 \\[cvs-mode-undo-local-changes] Revert the last checked in version - discard your changes to the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 Entry to this mode runs cvs-mode-hook.
142
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 114
diff changeset
730 This description is updated for release 1.05-CVS-$Name: r20-2b5 $ of pcl-cvs.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 All bindings:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 \\{cvs-mode-map}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 (setq major-mode 'cvs-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 (setq mode-name "CVS")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 (setq mode-line-process nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 ;; for older v18 emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 ;;(buffer-flush-undo (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 (buffer-disable-undo (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (make-local-variable 'goal-column)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 (setq goal-column cvs-cursor-column)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (use-local-map cvs-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 (run-hooks 'cvs-mode-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 (defun cvs-sentinel (proc msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 "Sentinel for the cvs update process.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 This is responsible for parsing the output from the cvs update when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 it is finished."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 ((null (buffer-name (process-buffer proc)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 ;; buffer killed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 (set-process-buffer proc nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 ((memq (process-status proc) '(signal exit))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 (let* ((obuf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 (omax (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 (opoint (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 ;; save-excursion isn't the right thing if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 ;; process-buffer is current-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 (set-buffer (process-buffer proc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 (setq mode-line-process
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 (concat ": "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 (symbol-name (process-status proc))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 (let* ((out-file cvs-stdout-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 (stdout-buffer (find-file-noselect out-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 (set-buffer stdout-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 (rename-buffer (concat " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 (file-name-nondirectory out-file)) t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 (cvs-parse-update stdout-buffer (process-buffer proc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 (setq cvs-buffers-to-delete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (cons (process-buffer proc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 (cons stdout-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 cvs-buffers-to-delete)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (delete-file out-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 (message "CVS update process has completed.") ; XEmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 (set-buffer-modified-p (buffer-modified-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 (setq cvs-update-running nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 (if (equal obuf (process-buffer proc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 (set-buffer (process-buffer proc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 (if (< opoint omax)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 (goto-char opoint))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 (set-buffer obuf))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 (defun cvs-update-filter (proc string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 "Filter function for pcl-cvs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 This function gets the output that CVS sends to stderr. It inserts it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 into (process-buffer proc) but it also checks if CVS is waiting for a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 lock file. If so, it inserts a message cookie in the *cvs* buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 (let ((old-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 (data (match-data)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (set-buffer (process-buffer proc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 ;; Insert the text, moving the process-marker.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 (goto-char (process-mark proc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 (insert string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 (set-marker (process-mark proc) (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 ;; Delete any old lock message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 (if (tin-nth cvs-cookie-handle 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 (tin-delete cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 (tin-nth cvs-cookie-handle 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 ;; Check if CVS is waiting for a lock.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 (beginning-of-line 0) ;Move to beginning of last
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 ;complete line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 "^cvs \\(update\\|server\\): \\[..:..:..\\] waiting for \\(.*\\)lock in \\(.*\\)$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 (setq cvs-lock-file (buffer-substring (match-beginning 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 (match-end 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 (cookie-enter-last
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 'MESSAGE nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 (concat "\tWaiting for "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 "lock in " cvs-lock-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 ".\n\t (type M-x cvs-delete-lock to delete it)")))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 (store-match-data data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 (set-buffer old-buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 (defun cvs-delete-lock ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 "Delete the lock file that CVS is waiting for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 Note that this can be dangerous. You should only do this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 if you are convinced that the process that created the lock is dead."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 ((not (or (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 (concat (file-name-as-directory cvs-lock-file) "#cvs.lock"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 (cvs-filter (function cvs-lock-file-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 (directory-files cvs-lock-file))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 (error "No lock files found."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 ((yes-or-no-p (concat "Really delete locks in " cvs-lock-file "? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 ;; Re-read the directory -- the locks might have disappeared.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 (let ((locks (cvs-filter (function cvs-lock-file-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 (directory-files cvs-lock-file))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 (while locks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 (delete-file (concat (file-name-as-directory cvs-lock-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 (car locks)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 (setq locks (cdr locks)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 (cvs-remove-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 (concat (file-name-as-directory cvs-lock-file) "#cvs.lock"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 (defun cvs-remove-directory (dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 "Remove a directory."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 (if (file-directory-p dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 (call-process cvs-rmdir-program nil nil nil dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 (error "Not a directory: %s" dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 (if (file-exists-p dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 (error "Could not remove directory %s" dir)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 (defun cvs-lock-file-p (file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 "Return true if FILE looks like a CVS lock file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 (string-match "^#cvs.tfl.[0-9]+$" file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 (string-match "^#cvs.rfl.[0-9]+$" file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 (string-match "^#cvs.wfl.[0-9]+$" file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 (defun cvs-quote-multiword-string (str)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 "Return STR surrounded in single quotes if it contains whitespace."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 (cond ((string-match "[ \t\n]" str)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 (concat "'" str "'"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 str)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 ;; this should be in subr.el or some similar place....
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 (defun parse-string (str &optional regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 "Explode the string STR into a list of words ala strtok(3). Optional REGEXP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 defines regexp matching word separator, which defaults to \"[ \\t\\n]+\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 (let (str-list ; new list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 str-token ; "index" of next token
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 (str-start 0) ; "index" of current token
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 (str-sep (if regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 "[ \t\n]+")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 (while (setq str-token (string-match str-sep str str-start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 (setq str-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 (nconc str-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 (list (substring str str-start str-token))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 (setq str-start (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 ;; tag on the remainder as the final item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 (if (not (>= str-start (length str)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 (setq str-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 (nconc str-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 (list (substring str str-start)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 str-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 (defun cvs-make-list (str)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 "Return list of words made from the string STR."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 (cond ((string-match "[ \t\n]+" str)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 (let ((new-str (parse-string str "[ \t\n]+")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 ;; this is ugly, but assume if the first element is empty, there are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 ;; no more elements.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 (cond ((string= (car new-str) "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 new-str))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 ((string= str "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 (list str))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 (defun cvs-skip-line (stdout stderr regexp &optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 "Like forward-line, but check that the skipped line matches REGEXP.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 Args: STDOUT STDERR REGEXP &optional ARG.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 If it doesn't match REGEXP a bug report is generated and displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 STDOUT and STDERR is only used to do that.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 If optional ARG, a number, is given the ARGth parenthesized expression
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 in the REGEXP is returned as a string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 Point should be in column 1 when this function is called."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 ((looking-at regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 (if arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 (buffer-substring (match-beginning arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 (match-end arg))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 (cvs-parse-error stdout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 stderr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 (if (eq (current-buffer) stdout)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 'STDOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 'STDERR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 regexp))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 (defun cvs-get-current-dir (root-dir dirname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 "Return current working directory, suitable for cvs-parse-update.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 Args: ROOT-DIR DIRNAME.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 Concatenates ROOT-DIR and DIRNAME to form an absolute path."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 (if (string= "." dirname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 (substring root-dir 0 -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 (concat root-dir dirname)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 (defun cvs-compare-fileinfos (a b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 "Compare fileinfo A with fileinfo B and return t if A is `less'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 ;; Sort acording to directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 ((string< (cvs-fileinfo->dir a) (cvs-fileinfo->dir b)) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 ((not (string= (cvs-fileinfo->dir a) (cvs-fileinfo->dir b))) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 ;; The DIRCHANGE entry is always first within the directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 ((and (eq (cvs-fileinfo->type a) 'DIRCHANGE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 (not (eq (cvs-fileinfo->type b) 'DIRCHANGE))) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 ((and (eq (cvs-fileinfo->type b) 'DIRCHANGE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 (not (eq (cvs-fileinfo->type a) 'DIRCHANGE))) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 ;; All files are sorted by file name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 ((string< (cvs-fileinfo->file-name a) (cvs-fileinfo->file-name b)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 (defun cvs-parse-error (stdout-buffer stderr-buffer err-buf pos &optional indicator)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 "Handle a parse error when parsing the output from cvs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 Args: STDOUT-BUFFER STDERR-BUFFER ERR-BUF POS &optional INDICATOR.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 ERR-BUF should be 'STDOUT or 'STDERR."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 (setq pos (1- pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 (set-buffer cvs-buffer-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 (setq buffer-read-only nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 (insert "To: " pcl-cvs-bugs-address "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 (insert "Subject: pcl-cvs release" pcl-cvs-version " parse error.\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 (insert (concat mail-header-separator "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 (insert "This bug report is automatically generated by pcl-cvs\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 (insert "because it doesn't understand some output from CVS. Below\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 (insert "is detailed information about the error. Please send\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 (insert "this, together with any information you think might be\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 (insert "useful for me to fix the bug, to the address above. But\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 (insert "please check the \"known problems\" section of the\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 (insert "documentation first. Note that this buffer contains\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 (insert "information that you might consider confidential. You\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 (insert "are encouraged to read through it before sending it.\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 (insert "Press C-c C-c to send this email.\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 (insert "Please state the version of these programs you are using:\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 (insert "RCS: \ndiff: \n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 (let* ((stdout (save-excursion (set-buffer stdout-buffer) (buffer-string)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 (stderr (save-excursion (set-buffer stderr-buffer) (buffer-string)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 (errstr (if (eq err-buf 'STDOUT) stdout stderr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 (errline-end (string-match "\n" errstr pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 (errline (substring errstr pos errline-end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 (insert (format "Offending line (%d chars): >" (- errline-end pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 (insert errline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 (insert "<\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 (insert "Sent to " (symbol-name err-buf) " at pos " (format "%d\n" pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 (if indicator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 (insert "Optional args: \"" indicator "\".\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 (insert "\nEmacs-version: " (emacs-version) "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016 (insert "Pcl-cvs Version: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 "@(#)OrigId: pcl-cvs.el,v 1.93 1993/05/31 22:44:00 ceder Exp\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018 (insert "CVS Version: "
142
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 114
diff changeset
1019 "@(#)lisp/pcl-cvs:$Name: r20-2b5 $:$Id: pcl-cvs.el,v 1.4 1997/05/09 03:28:08 steve Exp $\n\n")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 (insert (format "--- Contents of stdout buffer (%d chars) ---\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 (length stdout)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022 (insert stdout)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023 (insert "--- End of stdout buffer ---\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 (insert (format "--- Contents of stderr buffer (%d chars) ---\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 (length stderr)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026 (insert stderr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 (insert "--- End of stderr buffer ---\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 (insert "\nEnd of bug report.\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 (require 'sendmail)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 (mail-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 (error "CVS parse error - please report this bug.")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 (defun cvs-parse-update (stdout-buffer stderr-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 "Parse the output from `cvs update'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 Args: STDOUT-BUFFER STDERR-BUFFER.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 This functions parses the from `cvs update' (which should be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 separated in its stdout- and stderr-components) and prints a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041 pretty representation of it in the *cvs* buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 Signals an error if unexpected output was detected in the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 (let* ((head (cons 'dummy nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 (tail (cvs-parse-stderr stdout-buffer stderr-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 head default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 (root-dir default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049 (cvs-parse-stdout stdout-buffer stderr-buffer tail root-dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 (setq head (sort (cdr head) (function cvs-compare-fileinfos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 (collection-clear cvs-cookie-handle)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 (collection-append-cookies cvs-cookie-handle head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 (cvs-remove-stdout-shadows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 (if cvs-auto-remove-handled-directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 (cvs-remove-empty-directories))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 (set-buffer cvs-buffer-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 (cvs-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058 ;; XEmacs - tedium should let you know when it's ended...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 (if (pos-visible-in-window-p (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060 nil ; assume that the user will see it...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 (ding t 'ready)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 (message "CVS update is ready."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 (tin-goto-previous cvs-cookie-handle (point-min) 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 (setq default-directory root-dir)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068 (defun cvs-remove-stdout-shadows ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 "Remove entries in the *cvs* buffer that comes from both stdout and stderr.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 If there is two entries for a single file the second one should be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 deleted. (Remember that sort uses a stable sort algorithm, so one can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 be sure that the stderr entry is always first)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 (collection-filter-tins cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 (lambda (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077 (not (cvs-shadow-entry-p tin))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080 (defun cvs-shadow-entry-p (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 "Return non-nil if TIN is a shadow entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 Args: TIN.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 A TIN is a shadow entry if the previous tin contains the same file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086 (let* ((previous-tin (tin-previous cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087 (curr (tin-cookie cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 (prev (and previous-tin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089 (tin-cookie cvs-cookie-handle previous-tin))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 prev curr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 (string= (cvs-fileinfo->file-name prev)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 (cvs-fileinfo->file-name curr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 (string= (cvs-fileinfo->dir prev)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 (cvs-fileinfo->dir curr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 (and (eq (cvs-fileinfo->type prev) 'CONFLICT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098 (eq (cvs-fileinfo->type curr) 'CONFLICT))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 (and (eq (cvs-fileinfo->type prev) 'MERGED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 (eq (cvs-fileinfo->type curr) 'MODIFIED))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 (and (eq (cvs-fileinfo->type prev) 'REM-EXIST)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 (eq (cvs-fileinfo->type curr) 'REMOVED))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105 (defun cvs-find-backup-file (filename &optional dirname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 "Look for a backup file for FILENAME, optionally in directory DIRNAME, and if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107 there is one, return the name of the first file found as a string."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 (if (eq dirname nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110 (setq dirname default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 (car (directory-files dirname nil (concat "^\\" cvs-bakprefix filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112 "\\."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 (defun cvs-find-backup-revision (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 "Take FILENAME as the name of a cvs backup file and return the revision of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 that file as a string."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 (substring filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 (+ 1 (string-match "\\.\\([0-9.]+\\)$" filename))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 (defun cvs-parse-stderr (stdout-buffer stderr-buffer head dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 "Parse the output from CVS that is written to stderr.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125 Args: STDOUT-BUFFER STDERR-BUFFER HEAD DIR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 STDOUT-BUFFER holds the output that cvs sent to stdout. It is only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128 used to create a bug report in case there is a parse error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129 STDERR-BUFFER is the buffer that holds the output to parse.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 HEAD is a cons-cell, the head of the list that is built.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131 DIR is the directory the `cvs update' was run in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133 This function returns the last cons-cell in the list that is built."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 (set-buffer stderr-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138 (let ((current-dir dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139 (root-dir dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 (while (< (point) (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 ;; CVS is descending a subdirectory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 "^cvs \\(server\\|update\\): Updating \\(.*\\)$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 (setq current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 (cvs-get-current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 root-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 (buffer-substring (match-beginning 2) (match-end 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 (setcdr head (list (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 'DIRCHANGE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 "." ; the old version had nil here???
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 (buffer-substring (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 (match-end 0)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 (setq head (cdr head))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 ;; File removed, since it is removed (by third party) in repository.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 ((or (looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164 "^cvs \\(update\\|server\\): warning: \\(.*\\) is not (any longer) pertinent")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 (looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 "^cvs \\(update\\|server\\): \\(.*\\) is no longer in the repository"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 (setcdr head (list (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 'CVS-REMOVED
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171 (file-name-nondirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 (match-end 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174 (buffer-substring (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 (match-end 0)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 (setq head (cdr head))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 ;; File removed by you, but recreated by cvs. Ignored. Will say
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 ;; "Updated" on the next line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 "^cvs \\(update\\|server\\): warning: .* was lost$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 ;; File unknown for some reason.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 ;; FIXME: is it really a good idea to add this as unknown here?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 "cvs \\(update\\|server\\): nothing known about \\(.*\\)$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191 (let ((filename (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 (match-end 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193 (if (file-directory-p filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 (setcdr head (list (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 'UNKNOWN-DIR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197 "."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 (buffer-substring (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 (match-end 0)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 (setcdr head (list (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 'UNKNOWN
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203 (file-name-nondirectory filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 (buffer-substring (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 (match-end 0)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 (setq head (cdr head))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 ;; A file that has been created by you, but added to the cvs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 ;; repository by another.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 "^cvs \\(update\\|server\\): move away \\(.*\\); it is in the way$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 (setcdr head (list (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215 'MOVE-AWAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216 current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217 (file-name-nondirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218 (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219 (match-end 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220 (buffer-substring (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 (match-end 0)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 (setq head (cdr head))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225 ;; Cvs waits for a lock. Ignore.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 "^cvs \\(update\\|server\\): \\[..:..:..\\] waiting for .*lock in ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 (forward-line 1))
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
1230 ((looking-at
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
1231 "^cvs \\(update\\|server\\): \\[..:..:..\\] obtained lock in ")
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
1232 (forward-line 1))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 ;; File removed in repository, but edited by you.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 "^cvs \\(update\\|server\\): conflict: \\(.*\\) is modified but no longer in the repository$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 (setcdr head (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239 (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 'REM-CONFLICT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242 (file-name-nondirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 (match-end 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 (buffer-substring (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 (match-end 0)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247 (setq head (cdr head))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250 ;; File removed in repository, but edited by someone else.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 "^cvs \\(update\\|server\\): conflict: removed \\(.*\\) was modified by second party")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254 (setcdr head
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256 (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257 'MOD-CONFLICT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 (buffer-substring (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 (match-end 0)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 (setq head (cdr head))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 ;; File removed in repository, but not in local directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269 "^cvs \\(update\\|server\\): \\(.*\\) should be removed and is still there")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270 (setcdr head
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 'REM-EXIST
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274 current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275 (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277 (buffer-substring (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278 (match-end 0)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279 (setq head (cdr head))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282 ;; Error searching for repository
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 "^cvs \\(update\\|server\\): in directory ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 (cvs-skip-line stdout-buffer stderr-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 (regexp-quote "cvs [update aborted]: there is no repository "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290 (setcdr head (list (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 'REPOS-MISSING
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 (buffer-substring start (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 (setq head (cdr head))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297 ;; Silly warning from attempted conflict resolution. Ignored.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 ;; FIXME: Should it be?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299 ;; eg.: "cvs update: cannot find revision APC-web-update in file .cvsignore"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302 "^cvs \\(update\\|server\\): cannot find revision \\(.*\\) in file \\(.*\\)$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 (message "%s" (buffer-substring (match-beginning 0) (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 ;; CVS has decided to merge someone elses changes into this document.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307 ;; About to start an rcsmerge operation...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 "^RCS file: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 ;; skip the "RCS file:" line...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315 (let ((complex-start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316 base-revision ; the first revision retrieved to merge from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317 head-revision ; the second revision retrieved to merge from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 filename ; the name of the file being merged
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319 backup-file ; the name of the backup of the working file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1320 backup-revision) ; the revision of the original working file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322 (setq base-revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323 (cvs-skip-line stdout-buffer stderr-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 "^retrieving revision \\(.*\\)$"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326 (setq head-revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327 (cvs-skip-line stdout-buffer stderr-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 "^retrieving revision \\(.*\\)$"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330 (setq filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331 (cvs-skip-line stdout-buffer stderr-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332 "^Merging differences between [0-9.]+ and [0-9.]+ into \\(.*\\)$"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1334 (setq backup-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1335 (cvs-find-backup-file filename current-dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 (setq backup-revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1337 (cvs-find-backup-revision backup-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 ;; Was there a conflict during the merge?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1341 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343 ;;;; From CVS-1.3 & RCS-5.6.0.1 with GNU-Diffutils-2.5:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1344 ;;;; "cvs update -j OLD-REV -j NEW-REV ."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1345 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1346 ;; RCS file: /big/web-CVS/apc/cmd/Main/logout.sh,v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1347 ;; retrieving revision 1.1.1.1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1348 ;; retrieving revision 1.1.1.2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1349 ;; Merging differences between 1.1.1.1 and 1.1.1.2 into logout.sh
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1350 ;; rcsmerge warning: overlaps during merge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1352 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1353 ;; Allow both RCS 5.5 and 5.6. (5.6 prints "rcs" and " warning").
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
1354 "^\\(rcs\\)?merge[:]*\\( warning\\)?: \\(overlaps\\|conflicts\\) during merge$")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1355
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356 ;; Yes, this is a conflict.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 (cvs-skip-line stdout-buffer stderr-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358 "^\\(rcs\\)?merge[:]*\\( warning\\)?: \\(overlaps\\|conflicts\\) during merge$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360 ;; this line doesn't seem to appear in all cases -- perhaps only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361 ;; in "-j A -j B" usage, in which case this indicates ????
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 (cvs-skip-line stdout-buffer stderr-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 "^cvs \\(update\\|server\\): conflicts found in ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 (let ((fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366 (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 'CONFLICT current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 (buffer-substring complex-start (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371 ;; squirrel away info about the files that were retrieved for merging
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 (cvs-set-fileinfo->base-revision fileinfo base-revision)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 (cvs-set-fileinfo->head-revision fileinfo head-revision)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374 (cvs-set-fileinfo->backup-revision fileinfo backup-revision)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375 (cvs-set-fileinfo->backup-file fileinfo backup-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 (setcdr head (list fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378 (setq head (cdr head))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 ;; Was it a conflict, and was RCS compiled without DIFF3_BIN, in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 ;; which case this is a failed conflict resolution?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 ;; Allow both RCS 5.5 and 5.6. (5.6 prints "rcs" and " warning").
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 "^\\(rcs\\)?merge\\( warning\\)?: overlaps or other problems during merge$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 (cvs-skip-line stdout-buffer stderr-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 "^\\(rcs\\)?merge\\( warning\\)?: overlaps or other problems during merge$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 (cvs-skip-line stdout-buffer stderr-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 "^cvs update: could not merge ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 (cvs-skip-line stdout-buffer stderr-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 "^cvs update: restoring .* from backup file ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 (let ((fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 'CONFLICT current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 (buffer-substring complex-start (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 (setcdr head (list fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 (setq head (cdr head))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 ;; Not a conflict; it must be a succesful merge.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 (let ((fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 'MERGED current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 (buffer-substring complex-start (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 (cvs-set-fileinfo->base-revision fileinfo base-revision)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410 (cvs-set-fileinfo->head-revision fileinfo head-revision)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 (cvs-set-fileinfo->backup-revision fileinfo backup-revision)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412 (cvs-set-fileinfo->backup-file fileinfo backup-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413 (setcdr head (list fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414 (setq head (cdr head)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1416 ;; Patch failure message with CVS client.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1417 ;; Ignore, since a failed patch implies that the file proper
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1418 ;; subsequently will be fetched from the server.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1419 ((looking-at
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1420 "^[0-9]+ out of [0-9]+ hunks failed--saving rejects to ")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1421 (forward-line 1))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1422
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 ;; Error messages from CVS (incomplete)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 "^cvs \\(update\\|server\\): \\(invalid option .*\\)$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 (error "Interface problem with CVS: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428 (buffer-substring (match-beginning 2) (match-end 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430 ;; network errors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 ;; Kerberos connection attempted but failed. This is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 ;; really an error, as CVS will automatically fall back to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434 ;; rsh. Plus it tries kerberos, if available, even when rsh
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 ;; is what you really wanted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438 "^cvs update: kerberos connect:.*$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440 (message "Remote CVS: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 (buffer-substring (match-beginning 0) (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443 ;; And when kerberos *does* fail, cvs prints out some stuff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 ;; as it tries rsh. Ignore that stuff too.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447 "^cvs update: trying to start server using rsh$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 "^\\([^:]*\\) Connection timed out")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 (error "Remote CVS: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453 (buffer-substring (match-beginning 0) (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 "^Permission denied.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 (error "Remote CVS: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 (buffer-substring (match-beginning 0) (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 "^cvs \\[update aborted\\]: premature end of file from server")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 (error "Remote CVS: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 (buffer-substring (match-beginning 0) (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465 ;; Empty line. Probably inserted by mistake by user (or developer :-)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466 ;; Ignore.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 "^$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 ;; top-level parser (cond) default clause
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475 (cvs-skip-line stdout-buffer stderr-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 "^UN-MATCHABLE-OUTPUT"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478 ;; cause this function to return the head of the parser output list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 (defun cvs-parse-stdout (stdout-buffer stderr-buffer head root-dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483 "Parse the output from CVS that is written to stderr.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 Args: STDOUT-BUFFER STDERR-BUFFER HEAD ROOT-DIR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 STDOUT-BUFFER is the buffer that holds the output to parse.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487 STDERR-BUFFER holds the output that cvs sent to stderr. It is only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 used to create a bug report in case there is a parse error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 HEAD is a cons-cell, the head of the list that is built.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491 ROOT-DIR is the directory the `cvs update' was run in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 This function doesn't return anything particular."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 (set-buffer stdout-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 (while (< (point) (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 ;; M: The file is modified by the user, and untouched in the repository.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 ;; A: The file is "cvs add"ed, but not "cvs ci"ed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 ;; R: The file is "cvs remove"ed, but not "cvs ci"ed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 ;; C: Conflict (only useful if a join was done and stderr has info...)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 ;; U: The file is copied from the repository.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 ;; ?: Unknown file or directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 "^\\([MARCUP?]\\) \\(.*\\)$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 (let*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511 ((c (char-after (match-beginning 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 (full-path (concat (file-name-as-directory root-dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514 (match-end 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 (isdir (file-directory-p full-path))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 (fileinfo (cvs-create-fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 (cond ((eq c ?M) 'MODIFIED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 ((eq c ?A) 'ADDED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 ((eq c ?R) 'REMOVED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 ((eq c ?C) 'CONFLICT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 ((eq c ?U) 'UPDATED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 ((eq c ?P) 'PATCHED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 ((eq c ??) (if isdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 'UNKNOWN-DIR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 'UNKNOWN)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 (substring (file-name-directory full-path) 0 -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 (file-name-nondirectory full-path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 (buffer-substring (match-beginning 0) (match-end 0)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 ;; Updated and Patched files require no further action.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 (if (memq c '(?U ?P))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 (cvs-set-fileinfo->handled fileinfo t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 ;; Link this last on the list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 (setcdr head (list fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 (setq head (cdr head))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 (forward-line 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538 ;; Executing a program because of the -u option in modules.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 "^cvs \\(update\\|server\\): Executing")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 ;; Skip by any output the program may generate to stdout.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 ;; Note that pcl-cvs will get seriously confused if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543 ;; program prints anything to stderr.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 (re-search-forward cvs-update-prog-output-skip-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1547 ;; Patch informational message with CVS client.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1548 ;; Ignore, since this simply tells us that the patch in question
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1549 ;; already has been applied to the file.
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1550 ((looking-at
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1551 "^.* already contains the differences between .* and ")
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1552 (forward-line 1))
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
1553
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 (cvs-parse-error stdout-buffer stderr-buffer 'STDOUT (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 "cvs-parse-stdout"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 (defun cvs-pp (fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 "Pretty print FILEINFO. Insert a printed representation in current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 For use by the cookie package."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563 (let ((a (cvs-fileinfo->type fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 (s (if (cvs-fileinfo->marked fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 "*" " "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 (f (cvs-fileinfo->file-name fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 (ci (if (cvs-fileinfo->handled fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 " " "ci")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 (insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 ((eq a 'UPDATED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 (format "%s Updated %s" s f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 ((eq a 'PATCHED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 (format "%s Patched %s" s f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575 ((eq a 'MODIFIED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 (format "%s Modified %s %s" s ci f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 ((eq a 'MERGED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578 (format "%s Merged %s %s" s ci f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 ((eq a 'CONFLICT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 (format "%s Conflict %s" s f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581 ((eq a 'ADDED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 (format "%s Added %s %s" s ci f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583 ((eq a 'REMOVED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584 (format "%s Removed %s %s" s ci f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585 ((eq a 'UNKNOWN)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 (format "%s Unknown %s" s f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 ((eq a 'UNKNOWN-DIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 (format "%s Unknown dir %s" s f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589 ((eq a 'CVS-REMOVED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590 (format "%s Removed from repository: %s" s f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591 ((eq a 'REM-CONFLICT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592 (format "%s Conflict: Removed from repository, changed by you: %s" s f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593 ((eq a 'MOD-CONFLICT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 (format "%s Conflict: Removed by you, changed in repository: %s" s f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 ((eq a 'REM-EXIST)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 (format "%s Conflict: Removed by you, but still exists: %s" s f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597 ((eq a 'DIRCHANGE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 (format "\nIn directory %s:" (cvs-fileinfo->dir fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599 ((eq a 'MOVE-AWAY)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600 (format "%s Move away %s - it is in the way" s f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601 ((eq a 'REPOS-MISSING)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 (format " This repository directory is missing! Remove this directory manually."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 ((eq a 'MESSAGE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604 (cvs-fileinfo->full-log fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 (format "%s Internal error! %s" s f))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1608
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1609 ;;; You can define your own keymap in .emacs. pcl-cvs.el won't overwrite it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1610
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1611 (if cvs-mode-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1612 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613 (setq cvs-mode-map (make-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1614 (suppress-keymap cvs-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1615 (define-prefix-command 'cvs-mode-map-control-c-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1616 (define-key cvs-mode-map "\C-?" 'cvs-mode-unmark-up)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1617 (define-key cvs-mode-map "\C-k" 'cvs-mode-acknowledge)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1618 (define-key cvs-mode-map "\C-n" 'cvs-mode-next-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619 (define-key cvs-mode-map "\C-p" 'cvs-mode-previous-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620 ;; ^C- keys are used to set various flags to control CVS features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 (define-key cvs-mode-map "\C-c" 'cvs-mode-map-control-c-prefix)
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
1622 (define-key cvs-mode-map "\C-c\C-c" 'cvs-change-cvsroot)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
1623 (define-key cvs-mode-map "\C-c\C-d" 'cvs-set-diff-flags)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
1624 (define-key cvs-mode-map "\C-c\C-l" 'cvs-set-log-flags)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
1625 (define-key cvs-mode-map "\C-c\C-s" 'cvs-set-status-flags)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
1626 (define-key cvs-mode-map "\C-c\C-u" 'cvs-set-update-optional-flags)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1627 ;; M- keys are usually those that operate on modules
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1628 (define-key cvs-mode-map "\M-\C-?" 'cvs-mode-unmark-all-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1629 (define-key cvs-mode-map "\M-C" 'cvs-mode-rcs2log) ; i.e. "Create a ChangeLog"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1630 (define-key cvs-mode-map "\M-a" 'cvs-mode-admin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1631 (define-key cvs-mode-map "\M-c" 'cvs-mode-checkout)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1632 (define-key cvs-mode-map "\M-o" 'cvs-mode-checkout-other-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1633 (define-key cvs-mode-map "\M-p" 'cvs-mode-rdiff) ; i.e. "create a Patch"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1634 (define-key cvs-mode-map "\M-r" 'cvs-mode-release)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1635 (define-key cvs-mode-map "\M-t" 'cvs-mode-rtag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636 ;; keys that operate on files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1637 (define-key cvs-mode-map " " 'cvs-mode-next-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1638 (define-key cvs-mode-map "?" 'describe-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1639 (define-key cvs-mode-map "A" 'cvs-mode-add-change-log-entry-other-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640 (define-key cvs-mode-map "B" 'cvs-mode-byte-compile-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641 (define-key cvs-mode-map "C" 'cvs-mode-changelog-commit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642 (define-key cvs-mode-map "E" 'cvs-mode-emerge)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1643 (define-key cvs-mode-map "G" 'cvs-update)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644 (define-key cvs-mode-map "M" 'cvs-mode-mark-all-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1645 (define-key cvs-mode-map "Q" 'cvs-examine)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1646 (define-key cvs-mode-map "R" 'cvs-mode-revert-updated-buffers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1647 (define-key cvs-mode-map "U" 'cvs-mode-undo-local-changes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1648 (define-key cvs-mode-map "a" 'cvs-mode-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649 (define-key cvs-mode-map "b" 'cvs-mode-diff-backup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 (define-key cvs-mode-map "c" 'cvs-mode-commit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651 (define-key cvs-mode-map "d" 'cvs-mode-diff-cvs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652 (define-key cvs-mode-map "e" 'cvs-mode-ediff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653 (define-key cvs-mode-map "f" 'cvs-mode-find-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654 (define-key cvs-mode-map "g" 'cvs-mode-update-no-prompt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655 (define-key cvs-mode-map "i" 'cvs-mode-ignore)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1656 (define-key cvs-mode-map "l" 'cvs-mode-log)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1657 (define-key cvs-mode-map "m" 'cvs-mode-mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1658 (define-key cvs-mode-map "n" 'cvs-mode-next-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1659 (define-key cvs-mode-map "o" 'cvs-mode-find-file-other-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1660 (define-key cvs-mode-map "p" 'cvs-mode-previous-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1661 (define-key cvs-mode-map "q" 'bury-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1662 (define-key cvs-mode-map "r" 'cvs-mode-remove-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1663 (define-key cvs-mode-map "s" 'cvs-mode-status)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1664 (define-key cvs-mode-map "t" 'cvs-mode-tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1665 (define-key cvs-mode-map "u" 'cvs-mode-unmark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666 (define-key cvs-mode-map "v" 'cvs-mode-diff-vendor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1667 (define-key cvs-mode-map "x" 'cvs-mode-remove-handled))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1668
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1669 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1670 (defun cvs-get-marked (&optional ignore-marks ignore-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671 "Return a list of all selected tins.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672 Args: &optional IGNORE-MARKS IGNORE-CONTENTS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674 If there are any marked tins, and IGNORE-MARKS is nil, return them. Otherwise,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1675 if the cursor selects a directory, return all files in it, unless there are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1676 none, in which case just return the directory; or unless IGNORE-CONTENTS is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1677 nil, in which case also just return the directory. Otherwise return (a list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1678 containing) the file the cursor points to, or an empty list if it doesn't point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1679 to a file at all."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1680
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1681 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 ;; Any marked cookies?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1683 ((and (not ignore-marks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684 (collection-collect-tin cvs-cookie-handle 'cvs-fileinfo->marked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685 ;; Nope.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1686 ((and (not ignore-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1687 (let ((sel (tin-locate cvs-cookie-handle (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1688 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1689 ;; If a directory is selected, all it members are returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1690 ((and sel (eq (cvs-fileinfo->type (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691 sel))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692 'DIRCHANGE))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693 (let ((retsel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1694 (collection-collect-tin cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695 'cvs-dir-member-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696 (cvs-fileinfo->dir (tin-cookie
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1697 cvs-cookie-handle sel)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698 (if retsel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699 retsel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 (list sel))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1702 (list sel))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1703 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704 (list (tin-locate cvs-cookie-handle (point))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1707 (defun cvs-dir-member-p (fileinfo dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 "Return true if FILEINFO represents a file in directory DIR."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1710 (and (not (eq (cvs-fileinfo->type fileinfo) 'DIRCHANGE))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1711 (string= (cvs-fileinfo->dir fileinfo) dir)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1712
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1713 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1714 (defun cvs-dir-empty-p (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1715 "Return non-nil if TIN is a directory that is empty.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1716 Args: CVS-BUF TIN."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1717
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718 (and (eq (cvs-fileinfo->type (tin-cookie cvs-cookie-handle tin)) 'DIRCHANGE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719 (or (not (tin-next cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 (eq (cvs-fileinfo->type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721 (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722 (tin-next cvs-cookie-handle tin)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 'DIRCHANGE))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 (defun cvs-mode-revert-updated-buffers ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 "Revert any buffers that are UPDATED, PATCHED, MERGED or CONFLICT."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730 (cookie-map (function cvs-revert-fileinfo) cvs-cookie-handle))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1733 (defun cvs-revert-fileinfo (fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734 "Revert the buffer that holds the file in FILEINFO if it has changed,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735 and if the type is UPDATED, PATCHED, MERGED or CONFLICT."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1737 (let* ((type (cvs-fileinfo->type fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 (file (cvs-fileinfo->full-path fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739 (buffer (get-file-buffer file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740 ;; For a revert to happen...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742 ((and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 ;; ...the type must be one that justifies a revert...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744 (or (eq type 'UPDATED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745 (eq type 'PATCHED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746 (eq type 'MERGED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747 (eq type 'CONFLICT))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 ;; ...and the user must be editing the file...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 ((buffer-modified-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 (error "%s: edited since last cvs-update."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755 (buffer-file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756 ;; Go ahead and revert the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757 (t (revert-buffer 'dont-use-auto-save-file 'dont-ask))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760 (defun cvs-mode-remove-handled ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761 "Remove all lines that are handled.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762 Empty directories are removed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1763
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 ;; Pass one: remove files that are handled.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1766 (collection-filter-cookies cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 (lambda (fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 (not (cvs-fileinfo->handled fileinfo)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770 ;; Pass two: remove empty directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1771 (if cvs-auto-remove-handled-directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772 (cvs-remove-empty-directories)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1774 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1775 (defun cvs-remove-empty-directories ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1776 "Remove empty directories in the *cvs* buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1777
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778 (collection-filter-tins cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1780 (lambda (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1781 (not (cvs-dir-empty-p tin))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1782
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784 (defun cvs-mode-mark (pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785 "Mark a fileinfo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786 Args: POS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788 If the fileinfo is a directory, all the contents of that directory are marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789 instead. A directory can never be marked. POS is a buffer position."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791 (interactive "d")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1792 (let* ((tin (tin-locate cvs-cookie-handle pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1793 (sel (tin-cookie cvs-cookie-handle tin)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1794 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1795 ;; Does POS point to a directory? If so, mark all files in that directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1796 ((eq (cvs-fileinfo->type sel) 'DIRCHANGE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1797 (cookie-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1798 (function (lambda (f dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1799 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1800 ((cvs-dir-member-p f dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1801 (cvs-set-fileinfo->marked f t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802 t)))) ; Tell cookie to redisplay this cookie.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1803 cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1804 (cvs-fileinfo->dir sel)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1805 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1806 (cvs-set-fileinfo->marked sel t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1807 (tin-invalidate cvs-cookie-handle tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1808 (tin-goto-next cvs-cookie-handle pos 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1809
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1810 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1811 (defun cvs-committable (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812 "Check if the TIN is committable.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1813 It is committable if it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814 a) is not handled and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815 b) is either MODIFIED, ADDED, REMOVED, MERGED or CONFLICT."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817 (let* ((fileinfo (tin-cookie cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1818 (type (cvs-fileinfo->type fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1819 (and (not (cvs-fileinfo->handled fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820 (or (eq type 'MODIFIED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 (eq type 'ADDED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 (eq type 'REMOVED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 (eq type 'MERGED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 (eq type 'CONFLICT)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 (defun cvs-mode-commit ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828 "Check in all marked files, or the current file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 The user will be asked for a log message in a buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 If cvs-erase-input-buffer is non-nil that buffer will be erased.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831 Otherwise mark and point will be set around the entire contents of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832 buffer so that it is easy to kill the contents of the buffer with \\[kill-region]."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1835 (let* ((cvs-buf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1836 (marked (cvs-filter (function cvs-committable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1837 (cvs-get-marked))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 (if (null marked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839 (error "Nothing to commit!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1840 (pop-to-buffer (get-buffer-create cvs-commit-prompt-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1842
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843 (if cvs-erase-input-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1844 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1845 (push-mark (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 (cvs-edit-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847 (make-local-variable 'cvs-commit-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 (setq cvs-commit-list marked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 (message "Press C-c C-c when you are done editing."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1851 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1852 (defun cvs-edit-done ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1853 "Commit the files to the repository."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1854
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1855 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1856 (if (null cvs-commit-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1857 (error "You have already committed the files"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1858 (if (and (> (point-max) 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 (/= (char-after (1- (point-max))) ?\n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860 (or (eq cvs-commit-buffer-require-final-newline t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1861 (and cvs-commit-buffer-require-final-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862 (yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863 (format "Buffer %s does not end in newline. Add one? "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1864 (buffer-name))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1865 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1866 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1867 (insert ?\n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868 (save-some-buffers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1869 (let ((cc-list cvs-commit-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1870 (cc-buffer (get-buffer cvs-buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1871 (msg-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1872 (msg (buffer-substring (point-min) (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1873 (pop-to-buffer cc-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1874 (bury-buffer msg-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1875 (cvs-use-temp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876 (message "Committing...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877 (if (cvs-execute-list cc-list cvs-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878 (if cvs-cvsroot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879 (list "-d" cvs-cvsroot "commit" "-m" msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880 (list "commit" "-m" msg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881 "Committing %s...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1882 (error "Something went wrong. Check the %s buffer carefully."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1883 cvs-temp-buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884 ;; FIXME: don't do any of this if the commit fails.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 (let ((ccl cc-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1886 (while ccl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887 (cvs-after-commit-function (tin-cookie cvs-cookie-handle (car ccl)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888 (setq ccl (cdr ccl))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889 (apply 'tin-invalidate cvs-cookie-handle cc-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 (set-buffer msg-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891 (setq cvs-commit-list nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892 (set-buffer cc-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 (if cvs-auto-remove-handled
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 (cvs-mode-remove-handled)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896 (message "Committing... Done."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1898 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899 (defun cvs-after-commit-function (fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900 "Do everything that needs to be done when FILEINFO has been committed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901 The fileinfo->handle is set, and if the buffer is present it is reverted."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903 (cvs-set-fileinfo->handled fileinfo t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 (if cvs-auto-revert-after-commit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1905 (let* ((file (cvs-fileinfo->full-path fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1906 (buffer (get-file-buffer file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907 ;; For a revert to happen...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908 (if buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909 ;; ...the user must be editing the file...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1910 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1911 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912 (if (not (buffer-modified-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1913 ;; ...but it must be unmodified.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914 (revert-buffer 'dont-use-auto-save-file 'dont-ask)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1916 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1917 (defun cvs-execute-list (tin-list program constant-args &optional message-fmt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1918 "Run PROGRAM on all elements on TIN-LIST.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1919 Args: TIN-LIST PROGRAM CONSTANT-ARGS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1920
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1921 The PROGRAM will be called with pwd set to the directory the files reside
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922 in. CONSTANT-ARGS should be a list of strings. The arguments given to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1923 program will be CONSTANT-ARGS followed by all the files (from TIN-LIST) that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1924 resides in that directory. If the files in TIN-LIST resides in different
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 directories the PROGRAM will be run once for each directory (if all files in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1926 the same directory appears after each other).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1927
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1928 Any output from PROGRAM will be inserted in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930 This function return nil if all went well, or the numerical exit status or a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1931 signal name as a string. Note that PROGRAM might be called several times. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1932 will return non-nil if something goes wrong, but there is no way to know which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1933 process that failed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1934
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1935 If MESSAGE-FMT is not nil, then message is called to display progress with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1936 MESSAGE-FMT as the string. MESSAGE-FMT should contain one %s for the arg-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1937 being passed to PROGRAM."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1939 ;; FIXME: something seems wrong with the error checking here....
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1940
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1941 (let ((exitstatus nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1942 (while tin-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943 (let ((current-dir (cvs-fileinfo->dir (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944 (car tin-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1945 arg-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1946 arg-str)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1948 ;; Collect all marked files in this directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1949
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1950 (while (and tin-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1951 (string= current-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1952 (cvs-fileinfo->dir (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1953 (car tin-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1954 (setq arg-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1955 (cons (cvs-fileinfo->file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1956 (tin-cookie cvs-cookie-handle (car tin-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957 arg-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1958 (setq tin-list (cdr tin-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1959
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1960 (setq arg-list (nreverse arg-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1962 ;; Execute the command on all the files that were collected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1963
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1964 (if message-fmt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1965 (message message-fmt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1966 (mapconcat 'cvs-quote-multiword-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1967 arg-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1968 " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1969 (setq default-directory (file-name-as-directory current-dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1970 (insert (format "=== cd %s\n" default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1971 (insert (format "=== %s %s\n\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1972 program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1973 (mapconcat 'cvs-quote-multiword-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1974 (nconc (copy-sequence constant-args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1975 arg-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1976 " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1977 (let ((res (apply 'call-process program nil t t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1978 (nconc (copy-sequence constant-args) arg-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1979 ;; Remember the first, or highest, exitstatus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1980 (if (and (not (and (integerp res) (zerop res)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1981 (or (null exitstatus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1982 (and (integerp exitstatus) (= 1 exitstatus))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1983 (setq exitstatus res)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1984 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1985 (if message-fmt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1986 (message message-fmt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1987 (mapconcat 'cvs-quote-multiword-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1988 (nconc (copy-sequence arg-list) '("Done."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1989 " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1990 exitstatus))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1991
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1992 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1993 ;;;; +++ not currently used!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1994 (defun cvs-execute-single-file-list (tin-list extractor program constant-args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1995 &optional cleanup message-fmt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1996 "Run PROGRAM on all elements on TIN-LIST.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1997 Args: TIN-LIST EXTRACTOR PROGRAM CONSTANT-ARGS &optional CLEANUP.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1998
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1999 The PROGRAM will be called with pwd set to the directory the files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2000 reside in. CONSTANT-ARGS is a list of strings to pass as arguments to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2001 PROGRAM. The arguments given to the program will be CONSTANT-ARGS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2002 followed by the list that EXTRACTOR returns.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2003
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2004 EXTRACTOR will be called once for each file on TIN-LIST. It is given
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2005 one argument, the cvs-fileinfo. It can return t, which means ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2006 this file, or a list of arguments to send to the program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2007
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2008 If CLEANUP is not nil, the filenames returned by EXTRACTOR are deleted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2009
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2010 If MESSAGE-FMT is not nil, then message is called to display progress with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2011 MESSAGE-FMT as the string. MESSAGE-FMT should contain one %s for the arg-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2012 being passed to PROGRAM."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2013
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2014 (while tin-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2015 (let ((current-dir (file-name-as-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2016 (cvs-fileinfo->dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2017 (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2018 (car tin-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2019 (arg-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2020 (funcall extractor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2021 (tin-cookie cvs-cookie-handle (car tin-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2022
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2023 ;; Execute the command unless extractor returned t.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2024
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2025 (if (eq arg-list t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2026 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2027 (setq default-directory current-dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2028 (insert (format "=== cd %s\n" default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2029 (insert (format "=== %s %s\n\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2030 program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2031 (mapconcat 'cvs-quote-multiword-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2032 (nconc (copy-sequence constant-args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2033 arg-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2034 " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2035 (if message-fmt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2036 (message message-fmt (mapconcat 'cvs-quote-multiword-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2037 arg-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2038 " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2039 (apply 'call-process program nil t t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2040 (nconc (copy-sequence constant-args) arg-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2041 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2042 (if message-fmt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2043 (message message-fmt (mapconcat 'cvs-quote-multiword-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2044 (nconc arg-list '("Done."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2045 " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2046 (if cleanup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2047 (while arg-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2048 ;;;; (kill-buffer ?????)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2049 (delete-file (car arg-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2050 (setq arg-list (cdr arg-list))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2051 (setq tin-list (cdr tin-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2052
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2053 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2054 (defun cvs-edit-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2055 "\\<cvs-edit-mode-map>Mode for editing cvs log messages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2056 Commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2057 \\[cvs-edit-done] checks in the file when you are ready.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2058 This mode is based on fundamental mode."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2059
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2060 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2061 (use-local-map cvs-edit-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2062 (setq major-mode 'cvs-edit-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2063 (setq mode-name "CVS Log")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2064 (auto-fill-mode 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2065
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2066 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2067 (if cvs-edit-mode-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2068 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2069 (setq cvs-edit-mode-map (make-sparse-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2070 (define-prefix-command 'cvs-edit-mode-control-c-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2071 (define-key cvs-edit-mode-map "\C-c" 'cvs-edit-mode-control-c-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2072 (define-key cvs-edit-mode-map "\C-c\C-c" 'cvs-edit-done))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2073
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2074 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2075 (defun cvs-diffable (tins)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2076 "Return a list of all tins on TINS that it makes sense to run
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2077 ``cvs diff'' on."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2078
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2079 ;; +++ There is an unnecessary (nreverse) here. Get the list the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2080 ;; other way around instead!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2081 (let ((result nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2082 (while tins
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2083 (let ((type (cvs-fileinfo->type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2084 (tin-cookie cvs-cookie-handle (car tins)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2085 (if (or (eq type 'MODIFIED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2086 (eq type 'UPDATED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2087 (eq type 'PATCHED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2088 (eq type 'MERGED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2089 (eq type 'CONFLICT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2090 (eq type 'REMOVED) ;+++Does this line make sense?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2091 (eq type 'ADDED)) ;+++Does this line make sense?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2092 (setq result (cons (car tins) result)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2093 (setq tins (cdr tins))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2094 (nreverse result)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2096 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2097 (defun cvs-mode-diff-cvs (&optional ignore-marks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2098 "Diff the selected files against the head revisions in the repository.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2099
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2100 If the variable cvs-diff-ignore-marks is non-nil any marked files will not be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2101 considered to be selected. An optional prefix argument will invert the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2102 influence from cvs-diff-ignore-marks.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2104 The flags in the variable cvs-diff-flags will be passed to ``cvs diff''.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2106 The resulting diffs are placed in the cvs-fileinfo->cvs-diff-buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2108 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2109 (if (not (listp cvs-diff-flags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2110 (error "cvs-diff-flags should be set using cvs-set-diff-flags."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2111 (save-some-buffers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2112 (message "cvsdiffing...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2113 (let ((marked-file-list (cvs-diffable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2114 (cvs-get-marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2115 (or (and ignore-marks (not cvs-diff-ignore-marks))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2116 (and (not ignore-marks) cvs-diff-ignore-marks))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2117 (while marked-file-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2118 (let ((fileinfo-to-diff (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2119 (car marked-file-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2120 (local-def-directory (file-name-as-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2121 (cvs-fileinfo->dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2122 (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2123 (car marked-file-list))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2124 (message "cvsdiffing %s..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2125 (cvs-fileinfo->file-name fileinfo-to-diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2127 ;; FIXME: this seems messy to test and set buffer name at this point....
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2128 (if (not (cvs-fileinfo->cvs-diff-buffer fileinfo-to-diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2129 (cvs-set-fileinfo->cvs-diff-buffer fileinfo-to-diff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2130 (concat "*cvs-diff-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2131 (cvs-fileinfo->file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2132 fileinfo-to-diff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2133 "-in-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2134 local-def-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2135 "*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2136 (display-buffer (get-buffer-create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2137 (cvs-fileinfo->cvs-diff-buffer fileinfo-to-diff)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2138 (set-buffer (cvs-fileinfo->cvs-diff-buffer fileinfo-to-diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2139 (setq buffer-read-only nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2140 (setq default-directory local-def-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2141 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2142 (insert (format "=== cd %s\n" default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2143 (insert (format "=== cvs %s\n\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2144 (mapconcat 'cvs-quote-multiword-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2145 (nconc (if cvs-cvsroot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2146 (list "-d" cvs-cvsroot "diff")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2147 '("diff"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2148 (copy-sequence cvs-diff-flags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2149 (list (cvs-fileinfo->file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2150 fileinfo-to-diff)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2151 " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2152 (if (apply 'call-process cvs-program nil t t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2153 (nconc (if cvs-cvsroot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2154 (list "-d" cvs-cvsroot "diff")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2155 '("diff"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2156 (copy-sequence cvs-diff-flags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2157 (list (cvs-fileinfo->file-name fileinfo-to-diff))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2158 (message "cvsdiffing %s... Done."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2159 (cvs-fileinfo->file-name fileinfo-to-diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2160 (message "cvsdiffing %s... No differences found."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2161 (cvs-fileinfo->file-name fileinfo-to-diff)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2162 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2163 (setq marked-file-list (cdr marked-file-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2164 (message "cvsdiffing... Done."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2166 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2167 (defun cvs-mode-diff-backup (&optional ignore-marks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2168 "Diff the files against the backup file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2169 This command can be used on files that are marked with \"Merged\"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2170 or \"Conflict\" in the *cvs* buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2172 If the variable cvs-diff-ignore-marks is non-nil any marked files will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2173 not be considered to be selected. An optional prefix argument will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2174 invert the influence from cvs-diff-ignore-marks.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2176 The flags in cvs-diff-flags will be passed to ``diff''.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2178 The resulting diffs are placed in the cvs-fileinfo->backup-diff-buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2180 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2181 (if (not (listp cvs-diff-flags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2182 (error "cvs-diff-flags should be set using cvs-set-diff-flags."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2183 (save-some-buffers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2184 (let ((marked-file-list (cvs-filter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2185 (function cvs-backup-diffable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2186 (cvs-get-marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2187 (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2188 (and ignore-marks (not cvs-diff-ignore-marks))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2189 (and (not ignore-marks) cvs-diff-ignore-marks))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2190 (if (null marked-file-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 (error "No ``Conflict'' or ``Merged'' file selected!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2192 (message "backup diff...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2193 (while marked-file-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2194 (let ((fileinfo-to-diff (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2195 (car marked-file-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2196 (local-def-directory (file-name-as-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2197 (cvs-fileinfo->dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2198 (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2199 (car marked-file-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2200 (backup-temp-files (cvs-diff-backup-extractor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2201 (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2202 (car marked-file-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203 (message "backup diff %s..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2204 (cvs-fileinfo->file-name fileinfo-to-diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2206 ;; FIXME: this seems messy to test and set buffer name at this point....
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2207 (if (not (cvs-fileinfo->backup-diff-buffer fileinfo-to-diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2208 (cvs-set-fileinfo->backup-diff-buffer fileinfo-to-diff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2209 (concat "*cvs-diff-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210 (cvs-fileinfo->backup-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211 fileinfo-to-diff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2212 "-to-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2213 (cvs-fileinfo->file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2214 fileinfo-to-diff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2215 "-in"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2216 local-def-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2217 "*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218 (display-buffer (get-buffer-create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219 (cvs-fileinfo->backup-diff-buffer fileinfo-to-diff)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 (set-buffer (cvs-fileinfo->backup-diff-buffer fileinfo-to-diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221 (setq buffer-read-only nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222 (setq default-directory local-def-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224 (insert (format "=== cd %s\n" default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2225 (insert (format "=== %s %s\n\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2226 cvs-diff-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2227 (mapconcat 'cvs-quote-multiword-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228 (nconc (copy-sequence cvs-diff-flags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229 backup-temp-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230 " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231 (apply 'call-process cvs-diff-program nil t t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232 (nconc (copy-sequence cvs-diff-flags) backup-temp-files))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 (message "backup diff %s... Done."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2235 (cvs-fileinfo->file-name fileinfo-to-diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2236 (setq marked-file-list (cdr marked-file-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2237 (message "backup diff... Done."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2239 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240 (defun cvs-mode-diff-vendor (&optional ignore-marks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241 "Diff the revisions merged into the current file. I.e. show what changes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242 were merged in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244 This command can be used on files that are marked with \"Merged\"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 or \"Conflict\" in the *cvs* buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2247 If the variable cvs-diff-ignore-marks is non-nil any marked files will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2248 not be considered to be selected. An optional prefix argument will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249 invert the influence from cvs-diff-ignore-marks.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251 The flags in cvs-diff-flags will be passed to ``diff''.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253 The resulting diffs are placed in the cvs-fileinfo->vendor-diff-buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256 (if (not (listp cvs-diff-flags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2257 (error "cvs-diff-flags should be set using cvs-set-diff-flags."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2258 (save-some-buffers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259 (let ((marked-file-list (cvs-filter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260 (function cvs-vendor-diffable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261 (cvs-get-marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262 (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 (and ignore-marks (not cvs-diff-ignore-marks))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264 (and (not ignore-marks) cvs-diff-ignore-marks))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265 (if (null marked-file-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266 (error "No ``Conflict'' or ``Merged'' file selected!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267 (message "vendor diff...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268 (while marked-file-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 (let ((fileinfo-to-diff (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270 (car marked-file-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271 (local-def-directory (file-name-as-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272 (cvs-fileinfo->dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2273 (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2274 (car marked-file-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275 (vendor-temp-files (cvs-diff-vendor-extractor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2276 (tin-cookie cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2277 (car marked-file-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2278 (message "vendor diff %s..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2279 (cvs-fileinfo->file-name fileinfo-to-diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 (if (not (cvs-fileinfo->vendor-diff-buffer fileinfo-to-diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281 (cvs-set-fileinfo->vendor-diff-buffer fileinfo-to-diff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282 (concat "*cvs-diff-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 (cvs-fileinfo->file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284 fileinfo-to-diff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285 "-of-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286 (cvs-fileinfo->base-revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287 fileinfo-to-diff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2288 "-to-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2289 (cvs-fileinfo->head-revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2290 fileinfo-to-diff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2291 "-in-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2292 local-def-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2293 "*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2294 (display-buffer (get-buffer-create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2295 (cvs-fileinfo->vendor-diff-buffer fileinfo-to-diff)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2296 (set-buffer (cvs-fileinfo->vendor-diff-buffer fileinfo-to-diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2297 (setq buffer-read-only nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2298 (setq default-directory local-def-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2299 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2300 (insert (format "=== cd %s\n" default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2301 (insert (format "=== %s %s\n\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2302 cvs-diff-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2303 (mapconcat 'cvs-quote-multiword-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2304 (nconc (copy-sequence cvs-diff-flags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2305 vendor-temp-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2306 " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2307 (apply 'call-process cvs-diff-program nil t t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2308 (nconc (copy-sequence cvs-diff-flags) vendor-temp-files))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2309 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2310 (message "vendor diff %s... Done."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2311 (cvs-fileinfo->file-name fileinfo-to-diff))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2312 (while vendor-temp-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2313 (cvs-kill-buffer-visiting (car vendor-temp-files))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2314 (delete-file (car vendor-temp-files))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2315 (setq vendor-temp-files (cdr vendor-temp-files)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2316 (setq marked-file-list (cdr marked-file-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2317 (message "vendor diff... Done."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2318
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2319 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2320 (defun cvs-backup-diffable (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2321 "Check if the TIN is backup-diffable.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2322 It must have a backup file to be diffable."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2323
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2324 (file-readable-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2325 (cvs-fileinfo->backup-file (tin-cookie cvs-cookie-handle tin))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2327 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2328 (defun cvs-vendor-diffable (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2329 "Check if the TIN is vendor-diffable.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2330 It must have head and base revision info to be diffable."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2331
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2332 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2333 (cvs-fileinfo->base-revision (tin-cookie cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2334 (cvs-fileinfo->head-revision (tin-cookie cvs-cookie-handle tin))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2335
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2336 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2337 (defun cvs-diff-backup-extractor (fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2338 "Return the filename and the name of the backup file as a list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2339 Signal an error if there is no backup file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2341 (if (not (file-readable-p (cvs-fileinfo->backup-file fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2342 (error "%s has no backup file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2343 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2344 (file-name-as-directory (cvs-fileinfo->dir fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2345 (cvs-fileinfo->file-name fileinfo))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2346 (list (cvs-fileinfo->backup-file fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2347 (cvs-fileinfo->file-name fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2348
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2349 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2350 (defun cvs-diff-vendor-extractor (fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2351 "Retrieve and return the filenames of the vendor branch revisions as a list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2352 Signal an error if there is no info for the vendor revisions."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2353
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2354 (list (cvs-retrieve-revision-to-tmpfile fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2355 (cvs-fileinfo->base-revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2356 fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2357 (cvs-retrieve-revision-to-tmpfile fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2358 (cvs-fileinfo->head-revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359 fileinfo))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 (defun cvs-mode-find-file-other-window (pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363 "Select a buffer containing the file in another window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364 Args: POS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366 (interactive "d")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2367 (let ((tin (tin-locate cvs-cookie-handle pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2368 (if tin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2369 (let ((type (cvs-fileinfo->type (tin-cookie cvs-cookie-handle tin))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2370 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2371 ((or (eq type 'REMOVED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2372 (eq type 'CVS-REMOVED))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2373 (error "Can't visit a removed file."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2374 ((eq type 'DIRCHANGE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2375 (let ((obuf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2376 (odir default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2377 (setq default-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378 (file-name-as-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2379 (cvs-fileinfo->dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2380 (tin-cookie cvs-cookie-handle tin))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2381 (dired-other-window default-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2382 (set-buffer obuf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2383 (setq default-directory odir)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2384 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2385 (find-file-other-window (cvs-full-path tin)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2386 (error "There is no file to find."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2387
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2388 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2389 (defun cvs-fileinfo->full-path (fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2390 "Return the full path for the file that is described in FILEINFO."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2391
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2392 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2393 (file-name-as-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 (cvs-fileinfo->dir fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395 (cvs-fileinfo->file-name fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2396
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2397 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2398 (defun cvs-full-path (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2399 "Return the full path for the file that is described in TIN."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2401 (cvs-fileinfo->full-path (tin-cookie cvs-cookie-handle tin)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2403 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404 (defun cvs-mode-find-file (pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405 "Select a buffer containing the file in another window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2406 Args: POS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2407
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2408 (interactive "d")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2409 (let* ((cvs-buf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410 (tin (tin-locate cvs-cookie-handle pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411 (if tin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2412 (let* ((fileinfo (tin-cookie cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2413 (type (cvs-fileinfo->type fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2414 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415 ((or (eq type 'REMOVED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2416 (eq type 'CVS-REMOVED))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2417 (error "Can't visit a removed file."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418 ((eq type 'DIRCHANGE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419 (let ((odir default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420 (setq default-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421 (file-name-as-directory (cvs-fileinfo->dir fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 (dired default-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 (set-buffer cvs-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424 (setq default-directory odir)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426 (find-file (cvs-full-path tin)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427 (error "There is no file to find."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430 (defun cvs-mode-mark-all-files ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431 "Mark all files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432 Directories are not marked."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2434 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2435 (cookie-map (function (lambda (cookie)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2436 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2437 ((not (eq (cvs-fileinfo->type cookie) 'DIRCHANGE))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2438 (cvs-set-fileinfo->marked cookie t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439 t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 cvs-cookie-handle))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2441
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443 (defun cvs-mode-unmark (pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444 "Unmark a fileinfo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2445 Args: POS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447 (interactive "d")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448 (let* ((tin (tin-locate cvs-cookie-handle pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449 (sel (tin-cookie cvs-cookie-handle tin)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451 ((eq (cvs-fileinfo->type sel) 'DIRCHANGE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452 (cookie-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 (function (lambda (f dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455 ((cvs-dir-member-p f dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456 (cvs-set-fileinfo->marked f nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458 cvs-cookie-handle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459 (cvs-fileinfo->dir sel)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461 (cvs-set-fileinfo->marked sel nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462 (tin-invalidate cvs-cookie-handle tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463 (tin-goto-next cvs-cookie-handle pos 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2465 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2466 (defun cvs-mode-unmark-all-files ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467 "Unmark all files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468 Directories are also unmarked, but that doesn't matter, since
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469 they should always be unmarked."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2471 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2472 (cookie-map (function (lambda (cookie)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2473 (cvs-set-fileinfo->marked cookie nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474 t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475 cvs-cookie-handle))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2476
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2477 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 (defun cvs-do-removal (tins)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 "Remove files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480 Args: TINS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482 TINS is a list of tins that the user wants to delete. The files are deleted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483 If the type of the tin is 'UNKNOWN or 'UNKNOWN-DIR the tin is removed from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484 buffer. If it is anything else the file is added to a list that should be `cvs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485 remove'd and the tin is changed to be of type 'REMOVED.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487 Returns a list of tins files that should be `cvs remove'd."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489 (cvs-use-temp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490 (mapcar 'cvs-insert-full-path tins)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2492 ((and tins (yes-or-no-p (format "Delete %d files? " (length tins))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2493 (let (files-to-remove)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494 (while tins
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495 (let* ((tin (car tins))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2496 (fileinfo (tin-cookie cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2497 (filepath (cvs-full-path tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2498 (type (cvs-fileinfo->type fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2499 (if (or (eq type 'REMOVED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 (eq type 'CVS-REMOVED))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502 ;; if it doesn't exist, as a file or directory, ignore it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503 (cond ((file-directory-p filepath)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 (call-process cvs-rmdir-program nil nil nil filepath))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505 ((file-exists-p filepath)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2506 (delete-file filepath)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507 (if (or (eq type 'UNKNOWN)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2508 (eq type 'UNKNOWN-DIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2509 (eq type 'MOVE-AWAY))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2510 (tin-delete cvs-cookie-handle tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2511 (setq files-to-remove (cons tin files-to-remove))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512 (cvs-set-fileinfo->type fileinfo 'REMOVED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2513 (cvs-set-fileinfo->handled fileinfo nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2514 (tin-invalidate cvs-cookie-handle tin))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515 (setq tins (cdr tins)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2516 files-to-remove))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517 (t nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2518
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2519 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520 (defun cvs-mode-remove-file ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 "Remove all marked files."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2523 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524 (let ((files-to-remove (cvs-do-removal (cvs-get-marked))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525 (if (null files-to-remove)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2527 (cvs-use-temp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2528 (message "removing from repository...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2529 (if (cvs-execute-list files-to-remove cvs-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530 (if cvs-cvsroot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 (list "-d" cvs-cvsroot "remove")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2532 '("remove"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2533 "removing %s from repository...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2534 (error "CVS exited with non-zero exit status.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2535 (message "removing from repository... Done.")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2538 (defun cvs-mode-undo-local-changes ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539 "Undo local changes to all marked files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540 The file is removed and `cvs update FILE' is run."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2542 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2543 (let ((tins-to-undo (cvs-get-marked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544 (cvs-use-temp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545 (mapcar 'cvs-insert-full-path tins-to-undo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547 ((and tins-to-undo (yes-or-no-p (format "Undo changes to %d files? "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548 (length tins-to-undo))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549 (let (files-to-update)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2550 (while tins-to-undo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2551 (let* ((tin (car tins-to-undo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2552 (fileinfo (tin-cookie cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2553 (type (cvs-fileinfo->type fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2554 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2555 ((or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2556 (eq type 'UPDATED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2557 (eq type 'PATCHED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2558 (eq type 'MODIFIED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2559 (eq type 'MERGED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2560 (eq type 'CONFLICT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2561 (eq type 'CVS-REMOVED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2562 (eq type 'REM-CONFLICT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2563 (eq type 'MOVE-AWAY)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2564 (eq type 'REMOVED))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2565 (if (not (eq type 'REMOVED))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2566 (delete-file (cvs-full-path tin)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2567 (setq files-to-update (cons tin files-to-update))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2568 (cvs-set-fileinfo->type fileinfo 'UPDATED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2569 (cvs-set-fileinfo->handled fileinfo t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2570 (tin-invalidate cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2572 ((eq type 'MOD-CONFLICT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2573 (error "Use cvs-mode-add instead on %s."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2574 (cvs-fileinfo->file-name fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2576 ((eq type 'REM-CONFLICT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2577 (error "Can't deal with a file you have removed and recreated."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2578
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2579 ((eq type 'DIRCHANGE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2580 (error "Undo on directories not supported (yet)."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2581
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2582 ((eq type 'ADDED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2583 (error "There is no old revision to get for %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2584 (cvs-fileinfo->file-name fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2585 (t (error "cvs-mode-undo-local-changes: can't handle an %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2586 type)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2587
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2588 (setq tins-to-undo (cdr tins-to-undo))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2589 (cvs-use-temp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2590 (message "Re-getting files from repository...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2591 (if (cvs-execute-list files-to-update cvs-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2592 (if cvs-cvsroot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2593 (list "-d" cvs-cvsroot "update")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594 '("update"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595 "Re-getting %s from repository...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2596 (error "CVS exited with non-zero exit status.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2597 (message "Re-getting files from repository... Done.")))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2599 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2600 (defun cvs-mode-acknowledge ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2601 "Remove all marked files from the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2602
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2603 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604 (mapcar (function (lambda (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605 (tin-delete cvs-cookie-handle tin)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2606 (cvs-get-marked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2608 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609 (defun cvs-mode-unmark-up (pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610 "Unmark the file on the previous line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 Takes one argument POS, a buffer position."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2612
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613 (interactive "d")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2614 (let ((tin (tin-goto-previous cvs-cookie-handle pos 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2615 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2616 (tin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2617 (cvs-set-fileinfo->marked (tin-cookie cvs-cookie-handle tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2618 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2619 (tin-invalidate cvs-cookie-handle tin)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2620
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2621 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2622 (defun cvs-mode-previous-line (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2623 "Go to the previous line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2624 If a prefix argument is given, move by that many lines."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2625
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2626 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2627 (tin-goto-previous cvs-cookie-handle (point) arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2628
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2629 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2630 (defun cvs-mode-next-line (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2631 "Go to the next line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2632 If a prefix argument is given, move by that many lines."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2633
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2634 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2635 (tin-goto-next cvs-cookie-handle (point) arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2636
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2637 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2638 (defun cvs-add-file-update-buffer (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2639 "Sub-function to cvs-mode-add. Internal use only. Update the display. Return
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2640 non-nil if `cvs add' should be called on this file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2641 Args: TIN.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2642
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2643 Returns 'DIR, 'ADD, 'ADD-DIR, or 'RESURRECT."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2644
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2645 (let ((fileinfo (tin-cookie cvs-cookie-handle tin)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2646 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2647 ((eq (cvs-fileinfo->type fileinfo) 'UNKNOWN-DIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2648 (cvs-set-fileinfo->full-log fileinfo "new directory added with cvs-mode-add")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2649 'ADD-DIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2650 ((eq (cvs-fileinfo->type fileinfo) 'UNKNOWN)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2651 (cvs-set-fileinfo->type fileinfo 'ADDED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2652 (cvs-set-fileinfo->full-log fileinfo "new file added with cvs-mode-add")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2653 (tin-invalidate cvs-cookie-handle tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2654 'ADD)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2655 ((eq (cvs-fileinfo->type fileinfo) 'REMOVED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2656 (cvs-set-fileinfo->type fileinfo 'UPDATED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2657 (cvs-set-fileinfo->full-log fileinfo "file resurrected with cvs-mode-add")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2658 (cvs-set-fileinfo->handled fileinfo t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2659 (tin-invalidate cvs-cookie-handle tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2660 'RESURRECT))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2661
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2662 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2663 (defun cvs-add-sub (cvs-buf candidates)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2664 "Internal use only.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2665 Args: CVS-BUF CANDIDATES.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2666
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2667 CANDIDATES is a list of tins. Updates the CVS-BUF and returns a list of lists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2668 The first list is unknown tins that shall be `cvs add -m msg'ed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2669 The second list is unknown directory tins that shall be `cvs add -m msg'ed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2670 The third list is removed files that shall be `cvs add'ed (resurrected)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2672 (let (add add-dir resurrect)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2673 (while candidates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2674 (let ((type (cvs-add-file-update-buffer (car candidates))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2675 (cond ((eq type 'ADD)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2676 (setq add (cons (car candidates) add)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2677 ((eq type 'ADD-DIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2678 (setq add-dir (cons (car candidates) add-dir)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2679 ((eq type 'RESURRECT)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2680 (setq resurrect (cons (car candidates) resurrect)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2681 (setq candidates (cdr candidates)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2682 (list add add-dir resurrect)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2683
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2684 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2685 (defun cvs-mode-add ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2686 "Add marked files to the cvs repository."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2687
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2688 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2689 (let* ((buf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2690 (marked (cvs-get-marked))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2691 (result (cvs-add-sub buf marked))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2692 (added (car result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2693 (newdirs (car (cdr result)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2694 (resurrect (car (cdr (cdr result))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2695 (msg (if (or added newdirs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2696 (read-from-minibuffer "Enter description: "))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2697
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2698 (if (or resurrect (or added newdirs))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2699 (cvs-use-temp-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2700
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2701 (cond (resurrect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2702 (message "Resurrecting files from repository...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2703 (if (cvs-execute-list resurrect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2704 cvs-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2705 (if cvs-cvsroot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2706 (list "-d" cvs-cvsroot "add")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2707 '("add"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2708 "Resurrecting %s from repository...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2709 (error "CVS exited with non-zero exit status.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2710 (message "Resurrecting files from repository... Done."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2711
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2712 (cond (added
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2713 (message "Adding new files to repository...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2714 (if (cvs-execute-list added
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2715 cvs-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2716 (if cvs-cvsroot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2717 (list "-d" cvs-cvsroot "add" "-m" msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2718 (list "add" "-m" msg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2719 "Adding %s to repository...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2720 (error "CVS exited with non-zero exit status.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2721 (message "Adding new files to repository... Done."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2722
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2723 (cond (newdirs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2724 (message "Adding new directories to repository...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2725 (if (cvs-execute-list newdirs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2726 cvs-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2727 (if cvs-cvsroot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2728 (list "-d" cvs-cvsroot "add" "-m" msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2729 (list "add" "-m" msg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2730 "Adding %s to repository...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2731 (error "CVS exited with non-zero exit status.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2732 (while newdirs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2733 (let* ((tin (car newdirs))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2734 (fileinfo (tin-cookie cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2735 (newdir (cvs-fileinfo->file-name fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2736 (cvs-set-fileinfo->dir fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2737 (concat (cvs-fileinfo->dir fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2738 "/"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2739 newdir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2740 (cvs-set-fileinfo->type fileinfo 'DIRCHANGE)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2741 (cvs-set-fileinfo->file-name fileinfo ".")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2742 (tin-invalidate cvs-cookie-handle tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2743 (setq newdirs (cdr newdirs))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2744 ;; FIXME: this should really run cvs-update-no-prompt on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2745 ;; subdir and insert everthing in the current list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2746 (message "You must re-update to visit the new directories."))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2748 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2749 (defun cvs-mode-ignore ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2750 "Arrange so that CVS ignores the selected files and directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2751 This command ignores files/dirs that are flagged as `Unknown'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2754 (mapcar (function (lambda (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2755 (let* ((fileinfo (tin-cookie cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2756 (type (cvs-fileinfo->type fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2757 (cond ((or (eq type 'UNKNOWN)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2758 (eq type 'UNKNOWN-DIR))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2759 (cvs-append-to-ignore fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2760 (tin-delete cvs-cookie-handle tin))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2761 (cvs-get-marked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2762
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2763 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2764 (defun cvs-append-to-ignore (fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2765 "Append the file in fileinfo to the .cvsignore file"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2766
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2767 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2768 (set-buffer (find-file-noselect (concat (file-name-as-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2769 (cvs-fileinfo->dir fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2770 ".cvsignore")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2771 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2772 (if (not (zerop (current-column)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2773 (insert "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2774 (insert (cvs-fileinfo->file-name fileinfo) "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2775 (if cvs-sort-ignore-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2776 (sort-lines nil (point-min) (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2777 (save-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2778
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2779 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2780 (defun cvs-mode-status ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2781 "Show cvs status for all marked files."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2782
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2783 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2784 (save-some-buffers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2785 (if (not (listp cvs-status-flags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2786 (error "cvs-status-flags should be set using cvs-set-status-flags."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2787 (let ((marked (cvs-get-marked nil t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2788 (cvs-use-temp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2789 (message "Running cvs status ...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2790 (if (cvs-execute-list marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2791 cvs-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2792 (append (if cvs-cvsroot (list "-d" cvs-cvsroot))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793 (list "-Q" "status")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794 cvs-status-flags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2795 "Running cvs -Q status %s...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2796 (error "CVS exited with non-zero exit status.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2797 (message "Running cvs -Q status ... Done."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2799 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2800 (defun cvs-mode-log ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2801 "Display the cvs log of all selected files."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2802
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2803 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2804 (if (not (listp cvs-log-flags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2805 (error "cvs-log-flags should be set using cvs-set-log-flags."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2806 (let ((marked (cvs-get-marked nil t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2807 (cvs-use-temp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2808 (message "Running cvs log ...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2809 (if (cvs-execute-list marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2810 cvs-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2811 (append (if cvs-cvsroot (list "-d" cvs-cvsroot))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2812 (list "log")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2813 cvs-log-flags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2814 "Running cvs log %s...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2815 (error "CVS exited with non-zero exit status.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2816 (message "Running cvs log ... Done."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2817
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2818 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2819 (defun cvs-mode-tag ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2820 "Run 'cvs tag' on all selected files."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2821
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2822 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2823 (if (not (listp cvs-tag-flags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2824 (error "cvs-tag-flags should be set using cvs-set-tag-flags."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2825 (let ((marked (cvs-get-marked nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2826 (tag-args (cvs-make-list (read-string "Tag name (and flags): "))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2827 (cvs-use-temp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2828 (message "Running cvs tag ...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2829 (if (cvs-execute-list marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2830 cvs-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2831 (append (if cvs-cvsroot (list "-d" cvs-cvsroot))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2832 (list "tag")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2833 cvs-tag-flags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2834 tag-args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2835 "Running cvs tag %s...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2836 (error "CVS exited with non-zero exit status.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2837 (message "Running cvs tag ... Done."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2838
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2839 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2840 (defun cvs-mode-rtag ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2841 "Run 'cvs rtag' on all selected files."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2842
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2843 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2844 (if (not (listp cvs-rtag-flags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2845 (error "cvs-rtag-flags should be set using cvs-set-rtag-flags."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2846 (let ((marked (cvs-get-marked nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2847 ;; FIXME: should give selection from the modules file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2848 (module-name (read-string "Module name: "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2849 ;; FIXME: should also ask for an existing tag *or* date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2850 (rtag-args (cvs-make-list (read-string "Tag name (and flags): "))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2851 (cvs-use-temp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2852 (message "Running cvs rtag ...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2853 (if (cvs-execute-list marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2854 cvs-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2855 (append (if cvs-cvsroot (list "-d" cvs-cvsroot))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2856 (list "rtag")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2857 cvs-rtag-flags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2858 rtag-args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2859 (list module-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2860 "Running cvs rtag %s...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2861 (error "CVS rtag exited with non-zero exit status.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2862 (message "Running cvs rtag ... Done."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2863
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2864 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2865 (defun cvs-mode-byte-compile-files ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2866 "Run byte-compile-file on all selected files that end in '.el'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2867
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2868 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2869 (let ((marked (cvs-get-marked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2870 (while marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2871 (let ((filename (cvs-full-path (car marked))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2872 (if (string-match "\\.el$" filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2873 (byte-compile-file filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2874 (setq marked (cdr marked)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2875
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2876 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2877 (defun cvs-insert-full-path (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2878 "Insert full path to the file described in TIN in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2879
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2880 (insert (format "%s\n" (cvs-full-path tin))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2881
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2882 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2883 (defun cvs-mode-add-change-log-entry-other-window (pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2884 "Add a ChangeLog entry in the ChangeLog of the current directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2885 Args: POS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2886
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2887 (interactive "d")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2888 (let* ((cvs-buf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2889 (odir default-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2890 (obfname buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2891 (tin (tin-locate cvs-cookie-handle pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2892 (fileinfo (tin-cookie cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2893 (fname (cvs-fileinfo->file-name fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2894 (dname (file-name-as-directory (cvs-fileinfo->dir fileinfo))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2895 (setq change-log-default-name nil) ; this rarely correct in 19.28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2896 (setq buffer-file-name (cond (fname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2897 fname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2898 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2899 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2900 (setq default-directory (cond (dname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2901 dname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2902 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2903 odir)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2904 (add-change-log-entry-other-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2905 (set-buffer cvs-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2906 (setq default-directory odir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2907 (setq buffer-file-name obfname)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2908
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2909 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2910 (defun print-cvs-tin (foo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2911 "Debug utility."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2912
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2913 (let ((cookie (tin-cookie cvs-cookie-handle foo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2914 (stream (get-buffer-create "pcl-cvs-debug")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2915 (princ "==============\n" stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2916 (princ (cvs-fileinfo->file-name cookie) stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2917 (princ "\n" stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2918 (princ (cvs-fileinfo->dir cookie) stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2919 (princ "\n" stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2920 (princ (cvs-fileinfo->full-log cookie) stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2921 (princ "\n" stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2922 (princ (cvs-fileinfo->marked cookie) stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2923 (princ "\n" stream)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2924
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2925 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2926 ;; NOTE: the variable cvs-emerge-tmp-head-file will be "free" when compiling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2927 (defun cvs-mode-emerge (pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2928 "Emerge appropriate revisions of the selected file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2929 Args: POS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2930
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2931 (interactive "d")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2932 (let* ((cvs-buf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2933 (tin (tin-locate cvs-cookie-handle pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2934 (if (boundp 'cvs-emerge-tmp-head-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2935 (error "There can only be one emerge session active at a time."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2936 (if tin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2937 (let* ((fileinfo (tin-cookie cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2938 (type (cvs-fileinfo->type fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2939 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2940 ((eq type 'MODIFIED) ; merge repository head rev. with working file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2941 (require 'emerge)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2942 (setq cvs-emerge-tmp-head-file ; trick to prevent multiple runs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2943 (cvs-retrieve-revision-to-tmpfile fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2944 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2945 (if (not (emerge-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2946 t ; arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2947 (cvs-fileinfo->full-path fileinfo) ; file-A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2948 ;; this is an un-avoidable compiler reference to a free variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2949 cvs-emerge-tmp-head-file ; file-B
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2950 (cvs-fileinfo->full-path fileinfo) ; file-out
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2951 nil ; start-hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2952 '(lambda () ; quit-hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2953 (delete-file cvs-emerge-tmp-head-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2954 (makunbound 'cvs-emerge-tmp-head-file))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2955 (error "Emerge session failed"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2956
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2957 ;; re-do the same merge rcsmerge supposedly just did....
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2958 ((or (eq type 'MERGED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2959 (eq type 'CONFLICT)) ; merge backup-working=A, head=B, base=ancestor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2960 (require 'emerge)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2961 (setq cvs-emerge-tmp-head-file ; trick to prevent multiple runs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2962 (cvs-retrieve-revision-to-tmpfile fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2963 (cvs-fileinfo->head-revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2964 fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2965 (let ((cvs-emerge-tmp-backup-working-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2966 (cvs-fileinfo->backup-file fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2967 (cvs-emerge-tmp-ancestor-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2968 (cvs-retrieve-revision-to-tmpfile fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2969 (cvs-fileinfo->base-revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2970 fileinfo))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2971 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2972 (if (not (emerge-files-with-ancestor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2973 t ; arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2974 cvs-emerge-tmp-backup-working-file ; file-A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2975 ;; this is an un-avoidable compiler reference to a free variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2976 cvs-emerge-tmp-head-file ; file-B
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2977 cvs-emerge-tmp-ancestor-file ; file-ancestor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2978 (cvs-fileinfo->full-path fileinfo) ; file-out
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2979 nil ; start-hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2980 '(lambda () ; quit-hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2981 (delete-file cvs-emerge-tmp-backup-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2982 (delete-file cvs-emerge-tmp-ancestor-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2983 (delete-file cvs-emerge-tmp-head-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2984 (makunbound 'cvs-emerge-tmp-head-file))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2985 (error "Emerge session failed")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2986 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2987 (error "Can only e-merge \"Modified\", \"Merged\" or \"Conflict\" files"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2988 (error "There is no file to e-merge."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2989
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2990 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2991 ;; NOTE: the variable ediff-version may be "free" when compiling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2992 (defun cvs-mode-ediff (pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2993 "Ediff appropriate revisions of the selected file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2994 Args: POS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2995
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2996 (interactive "d")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2997 (if (boundp 'cvs-ediff-tmp-head-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2998 (error "There can only be one ediff session active at a time."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2999 (require 'ediff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3000 (if (and (boundp 'ediff-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3001 (>= (string-to-number ediff-version) 2.0)) ; FIXME real number?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3002 (run-ediff-from-cvs-buffer pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3003 (cvs-old-ediff-interface pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3004
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3005 (defun cvs-old-ediff-interface (pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3006 "Emerge like interface for older ediffs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3007 Args: POS"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3008
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3009 (let* ((cvs-buf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3010 (tin (tin-locate cvs-cookie-handle pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3011 (if tin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3012 (let* ((fileinfo (tin-cookie cvs-cookie-handle tin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3013 (type (cvs-fileinfo->type fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3014 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3015 ((eq type 'MODIFIED) ; diff repository head rev. with working file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3016 ;; should this be inside the unwind-protect, and should the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3017 ;; makeunbound be an unwindform?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3018 (setq cvs-ediff-tmp-head-file ; trick to prevent multiple runs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3019 (cvs-retrieve-revision-to-tmpfile fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3020 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3021 (if (not (ediff-files ; check correct ordering of args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3022 (cvs-fileinfo->full-path fileinfo) ; file-A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3023 ;; this is an un-avoidable compiler reference to a free variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3024 cvs-ediff-tmp-head-file ; file-B
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3025 '(lambda () ; startup-hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3026 (make-local-hook 'ediff-cleanup-hooks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3027 (add-hook 'ediff-cleanup-hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3028 '(lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3029 (ediff-janitor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3030 (delete-file cvs-ediff-tmp-head-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3031 (makunbound 'cvs-ediff-tmp-head-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3032 nil t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3033 (error "Ediff session failed"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3034
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3035 ;; look at the merge rcsmerge supposedly just did....
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3036 ((or (eq type 'MERGED)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3037 (eq type 'CONFLICT)) ; diff backup-working=A, head=B, base=ancestor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3038 (if (not (boundp 'ediff-version))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3039 (error "ediff version way too old for 3-way diff"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3040 (if (<= (string-to-number ediff-version) 1.9) ; FIXME real number?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3041 (error "ediff version %s too old for 3-way diff" ediff-version))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3042 (setq cvs-ediff-tmp-head-file ; trick to prevent multiple runs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3043 (cvs-retrieve-revision-to-tmpfile fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3044 (cvs-fileinfo->head-revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3045 fileinfo)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3046 (let ((cvs-ediff-tmp-backup-working-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3047 (cvs-fileinfo->backup-file fileinfo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3048 (cvs-ediff-tmp-ancestor-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3049 (cvs-retrieve-revision-to-tmpfile fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3050 (cvs-fileinfo->base-revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3051 fileinfo))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3052 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3053 (if (not (ediff-files3 ; check correct ordering of args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3054 cvs-ediff-tmp-backup-working-file ; file-A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3055 ;; this is an un-avoidable compiler reference to a free variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3056 cvs-ediff-tmp-head-file ; file-B
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3057 cvs-ediff-tmp-ancestor-file ; file-ancestor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3058 '(lambda () ; start-hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3059 (make-local-hook 'ediff-cleanup-hooks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3060 (add-hook 'ediff-cleanup-hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3061 '(lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3062 (ediff-janitor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3063 (delete-file cvs-ediff-tmp-backup-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3064 (delete-file cvs-ediff-tmp-ancestor-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3065 (delete-file cvs-ediff-tmp-head-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3066 (makunbound 'cvs-ediff-tmp-head-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3067 nil t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3068 (error "Ediff session failed")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3069
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3070 ((not (or (eq type 'UNKNOWN)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3071 (eq type 'UNKNOWN-DIR))) ; i.e. UPDATED or PATCHED ????
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3072 ;; this should really diff the current working file with the previous
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3073 ;; rev. on the current branch (i.e. not the head, since that's what
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3074 ;; the current file should be)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3075 (setq cvs-ediff-tmp-head-file ; trick to prevent multiple runs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3076 (cvs-retrieve-revision-to-tmpfile fileinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3077 (read-string "Rev #/tag to diff against: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3078 (cvs-fileinfo->head-revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3079 fileinfo))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3080 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3081 (if (not (ediff-files ; check correct ordering of args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3082 (cvs-fileinfo->full-path fileinfo) ; file-A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3083 ;; this is an un-avoidable compiler reference to a free variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3084 cvs-ediff-tmp-head-file ; file-B
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3085 '(lambda () ; startup-hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3086 (make-local-hook 'ediff-cleanup-hooks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3087 (add-hook 'ediff-cleanup-hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3088 '(lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3089 (ediff-janitor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3090 (delete-file cvs-ediff-tmp-head-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3091 (makunbound 'cvs-ediff-tmp-head-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3092 nil t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3093 (error "Ediff session failed"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3094 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3095 (error "Can not ediff \"Unknown\" files"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3096 (error "There is no file to ediff."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3097
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3098 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3099 (defun cvs-retrieve-revision-to-tmpfile (fileinfo &optional revision)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3100 "Retrieve the latest revision of the file in FILEINFO to a temporary file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3101 If second optional argument REVISION is given, retrieve that revision instead."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3103 (let
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3104 ((temp-name (make-temp-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3105 (concat (file-name-as-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3106 (or (getenv "TMPDIR") "/tmp"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3107 "pcl-cvs." revision))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3108 (cvs-kill-buffer-visiting temp-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3109 (if (and revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3110 (stringp revision)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3111 (not (string= revision "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3112 (message "Retrieving revision %s..." revision)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3113 (message "Retrieving latest revision..."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3114 (let ((res (call-process cvs-shell nil nil nil "-c"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3115 (concat cvs-program " update -p "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3116 (if (and revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3117 (stringp revision)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3118 (not (string= revision "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3119 (concat "-r " revision " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3120 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3121 (cvs-fileinfo->full-path fileinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3122 " > " temp-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3123 (if (and res (not (and (integerp res) (zerop res))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3124 (error "Something went wrong retrieving revision %s: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3125 revision res))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3127 (if revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3128 (message "Retrieving revision %s... Done." revision)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3129 (message "Retrieving latest revision... Done."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3130 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3131 (set-buffer (find-file-noselect temp-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3132 (rename-buffer (concat " " (file-name-nondirectory temp-name)) t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3133 temp-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3135 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3136 (defun cvs-kill-buffer-visiting (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3137 "If there is any buffer visiting FILENAME, kill it (without confirmation)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3139 (let ((l (buffer-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3140 (while l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3141 (if (string= (buffer-file-name (car l)) filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3142 (kill-buffer (car l)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3143 (setq l (cdr l)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3145 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3146 (defun cvs-change-cvsroot ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3147 "Ask for a new cvsroot."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3149 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3150 (cvs-set-cvsroot (read-file-name "New CVSROOT: " cvs-cvsroot)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3152 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3153 (defun cvs-set-cvsroot (newroot)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3154 "Change the cvsroot."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3156 (if (or (file-directory-p (expand-file-name "CVSROOT" newroot))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3157 (y-or-n-p (concat "Warning: no CVSROOT found inside repository."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3158 " Change cvs-cvsroot anyhow?")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3159 (setq cvs-cvsroot newroot)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3161 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3162 (defun cvs-set-diff-flags ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3163 "Ask for new setting of cvs-diff-flags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3164
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3165 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3166 (let ((old-value (mapconcat 'identity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3167 (copy-sequence cvs-diff-flags) " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3168 (setq cvs-diff-flags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3169 (cvs-make-list (read-string "Diff flags: " old-value)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3171 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3172 (defun cvs-set-update-optional-flags ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3173 "Ask for new setting of cvs-update-optional-flags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3175 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3176 (let ((old-value (mapconcat 'identity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3177 (copy-sequence cvs-update-optional-flags) " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3178 (setq cvs-update-optional-flags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3179 (cvs-make-list (read-string "Update optional flags: " old-value)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3181 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3182 (defun cvs-set-status-flags ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3183 "Ask for new setting of cvs-status-flags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3185 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3186 (let ((old-value (mapconcat 'identity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3187 (copy-sequence cvs-status-flags) " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3188 (setq cvs-status-flags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3189 (cvs-make-list (read-string "Status flags: " old-value)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3191 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3192 (defun cvs-set-log-flags ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3193 "Ask for new setting of cvs-log-flags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3195 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3196 (let ((old-value (mapconcat 'identity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3197 (copy-sequence cvs-log-flags) " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3198 (setq cvs-log-flags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3199 (cvs-make-list (read-string "Log flags: " old-value)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3201 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3202 (defun cvs-set-tag-flags ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3203 "Ask for new setting of cvs-tag-flags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3205 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3206 (let ((old-value (mapconcat 'identity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3207 (copy-sequence cvs-tag-flags) " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3208 (setq cvs-tag-flags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3209 (cvs-make-list (read-string "Tag flags: " old-value)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3211 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3212 (defun cvs-set-rtag-flags ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3213 "Ask for new setting of cvs-rtag-flags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3215 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3216 (let ((old-value (mapconcat 'identity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3217 (copy-sequence cvs-rtag-flags) " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3218 (setq cvs-rtag-flags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3219 (cvs-make-list (read-string "Rtag flags: " old-value)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3221 ;;----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3222 (if (string-match "XEmacs" emacs-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3223 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3224 ;; now marked to autload in pcl-cvs-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3225 ;(autoload 'pcl-cvs-fontify "pcl-cvs-xemacs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3226 (add-hook 'cvs-mode-hook 'pcl-cvs-fontify)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3228 (defun cvs-changelog-name (directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3229 "Return the name of the ChangeLog file that handles DIRECTORY.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3230 This is in DIRECTORY or one of its parents.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3231 Signal an error if we can't find an appropriate ChangeLog file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3232 (let ((dir (file-name-as-directory directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3233 file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3234 (while (and dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3235 (not (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3236 (setq file (expand-file-name "ChangeLog" dir)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3237 (let ((last dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3238 (setq dir (file-name-directory (directory-file-name dir)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3239 (if (equal last dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3240 (setq dir nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3241 (or dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3242 (error "Can't find ChangeLog for %s" directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3243 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3245 (defun cvs-narrow-changelog ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3246 "Narrow to the top page of the current buffer, a ChangeLog file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3247 Actually, the narrowed region doesn't include the date line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3248 A \"page\" in a ChangeLog file is the area between two dates."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3249 (or (eq major-mode 'change-log-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3250 (error "cvs-narrow-changelog: current buffer isn't a ChangeLog"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3252 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3254 ;; Skip date line and subsequent blank lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3255 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3256 (if (looking-at "[ \t\n]*\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3257 (goto-char (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3259 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3260 (forward-page 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3261 (narrow-to-region start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3262 (goto-char (point-min))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3263
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3264 (defun cvs-changelog-paragraph ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3265 "Return the bounds of the ChangeLog paragraph containing point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3266 If we are between paragraphs, return the previous paragraph."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3267 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3268 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3269 (if (looking-at "^[ \t]*$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3270 (skip-chars-backward " \t\n" (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3271 (list (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3272 (if (re-search-backward "^[ \t]*\n" nil 'or-to-limit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3273 (goto-char (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3274 (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3275 (if (re-search-forward "^[ \t\n]*$" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3276 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3277 (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3279 (defun cvs-changelog-subparagraph ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3280 "Return the bounds of the ChangeLog subparagraph containing point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3281 A subparagraph is a block of non-blank lines beginning with an asterisk.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3282 If we are between sub-paragraphs, return the previous subparagraph."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3283 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3284 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3285 (if (search-backward "*" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3286 (list (progn (beginning-of-line) (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3287 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3288 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3289 (if (re-search-forward "^[ \t]*[\n*]" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3290 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3291 (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3292 (list (point) (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3294 (defun cvs-changelog-entry ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3295 "Return the bounds of the ChangeLog entry containing point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3296 The variable `cvs-changelog-full-paragraphs' decides whether an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3297 \"entry\" is a paragraph or a subparagraph; see its documentation string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3298 for more details."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3299 (if cvs-changelog-full-paragraphs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3300 (cvs-changelog-paragraph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3301 (cvs-changelog-subparagraph)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3302
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3303 ;; NOTE: the variable user-full-name may be "free" when compiling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3304 (defun cvs-changelog-ours-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3305 "See if ChangeLog entry at point is for the current user, today.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3306 Return non-nil iff it is."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3307 ;; Code adapted from add-change-log-entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3308 (looking-at (concat (regexp-quote (substring (current-time-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3309 0 10))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3310 ".* "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3311 (regexp-quote (substring (current-time-string) -4))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3312 "[ \t]+"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3313 (regexp-quote (if (and (boundp 'add-log-full-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3314 add-log-full-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3315 add-log-full-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3316 user-full-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3317 " <"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3318 (regexp-quote (if (and (boundp 'add-log-mailing-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3319 add-log-mailing-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3320 add-log-mailing-address
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 76
diff changeset
3321 (user-mail-address))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3323 (defun cvs-relative-path (base child)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3324 "Return a directory path relative to BASE for CHILD.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3325 If CHILD doesn't seem to be in a subdirectory of BASE, just return
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3326 the full path to CHILD."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3327 (let ((base (file-name-as-directory (expand-file-name base)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3328 (child (expand-file-name child)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3329 (or (string= base (substring child 0 (length base)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3330 (error "cvs-relative-path: %s isn't in %s" child base))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3331 (substring child (length base))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3333 (defun cvs-changelog-entries (file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3334 "Return the ChangeLog entries for FILE, and the ChangeLog they came from.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3335 The return value looks like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3336 (LOGBUFFER (ENTRYSTART . ENTRYEND) ...)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3337 where LOGBUFFER is the name of the ChangeLog buffer, and each
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3338 \(ENTRYSTART . ENTRYEND\) pair is a buffer region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3339 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3340 (set-buffer (find-file-noselect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3341 (cvs-changelog-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3342 (file-name-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3343 (expand-file-name file)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3344 (or (eq major-mode 'change-log-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3345 (change-log-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3346 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3347 (if (looking-at "[ \t\n]*\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3348 (goto-char (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3349 (if (not (cvs-changelog-ours-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3350 (list (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3351 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3352 (cvs-narrow-changelog)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3353 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3354
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3355 ;; Search for the name of FILE relative to the ChangeLog. If that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3356 ;; doesn't occur anywhere, they're not using full relative
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3357 ;; filenames in the ChangeLog, so just look for FILE; we'll accept
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3358 ;; some false positives.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3359 (let ((pattern (cvs-relative-path
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3360 (file-name-directory buffer-file-name) file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3361 (if (or (string= pattern "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3362 (not (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3363 (search-forward pattern nil t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3364 (setq pattern file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3366 (let (texts)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3367 (while (search-forward pattern nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3368 (let ((entry (cvs-changelog-entry)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3369 (setq texts (cons entry texts))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3370 (goto-char (elt entry 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3372 (cons (current-buffer) texts)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3373
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3374 (defun cvs-changelog-insert-entries (buffer regions)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3375 "Insert those regions in BUFFER specified in REGIONS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3376 Sort REGIONS front-to-back first."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3377 (let ((regions (sort regions 'car-less-than-car))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3378 (last))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3379 (while regions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3380 (if (and last (< last (car (car regions))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3381 (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3382 (setq last (elt (car regions) 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3383 (apply 'insert-buffer-substring buffer (car regions))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3384 (setq regions (cdr regions)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3385
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3386 (defun cvs-union (set1 set2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3387 "Return the union of SET1 and SET2, according to `equal'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3388 (while set2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3389 (or (member (car set2) set1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3390 (setq set1 (cons (car set2) set1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3391 (setq set2 (cdr set2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3392 set1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3393
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3394 (defun cvs-insert-changelog-entries (files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3395 "Given a list of files FILES, insert the ChangeLog entries for them."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3396 (let ((buffer-entries nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3398 ;; Add each buffer to buffer-entries, and associate it with the list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3399 ;; of entries we want from that file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3400 (while files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3401 (let* ((entries (cvs-changelog-entries (car files)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3402 (pair (assq (car entries) buffer-entries)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3403 (if pair
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3404 (setcdr pair (cvs-union (cdr pair) (cdr entries)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3405 (setq buffer-entries (cons entries buffer-entries))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3406 (setq files (cdr files)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3407
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3408 ;; Now map over each buffer in buffer-entries, sort the entries for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3409 ;; each buffer, and extract them as strings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3410 (while buffer-entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3411 (cvs-changelog-insert-entries (car (car buffer-entries))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3412 (cdr (car buffer-entries)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3413 (if (and (cdr buffer-entries) (cdr (car buffer-entries)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3414 (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3415 (setq buffer-entries (cdr buffer-entries)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3417 (defun cvs-edit-delete-common-indentation ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3418 "Unindent the current buffer rigidly until at least one line is flush left."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3419 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3420 (let ((common 100000))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3421 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3422 (while (< (point) (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3423 (if (not (looking-at "^[ \t]*$"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3424 (setq common (min common (current-indentation))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3425 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3426 (indent-rigidly (point-min) (point-max) (- common)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3427
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3428 (defun cvs-mode-changelog-commit ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3429 "Check in all marked files, or the current file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3430 Ask the user for a log message in a buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3432 This is just like `\\[cvs-mode-commit]', except that it tries to provide
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3433 appropriate default log messages by looking at the ChangeLog. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3434 idea is to write your ChangeLog entries first, and then use this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3435 command to commit your changes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3436
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3437 To select default log text, we:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3438 - find the ChangeLog entries for the files to be checked in,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3439 - verify that the top entry in the ChangeLog is on the current date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3440 and by the current user; if not, we don't provide any default text,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3441 - search the ChangeLog entry for paragraphs containing the names of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3442 the files we're checking in, and finally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3443 - use those paragraphs as the log text."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3444
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3445 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3447 (let* ((cvs-buf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3448 (marked (cvs-filter (function cvs-committable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3449 (cvs-get-marked))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3450 (if (null marked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3451 (error "Nothing to commit!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3452 (pop-to-buffer (get-buffer-create cvs-commit-prompt-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3453 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3454
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3455 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3456 (cvs-insert-changelog-entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3457 (mapcar (lambda (tin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3458 (let ((cookie (tin-cookie cvs-cookie-handle tin)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3459 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3460 (cvs-fileinfo->file-name cookie)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3461 (cvs-fileinfo->dir cookie))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3462 marked))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3463 (cvs-edit-delete-common-indentation)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3464
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3465 (cvs-edit-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3466 (make-local-variable 'cvs-commit-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3467 (setq cvs-commit-list marked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3468 (message "Press C-c C-c when you are done editing."))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3469
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
3470 (provide 'pcl-cvs)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
3471
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
3472 ;;; pcl-cvs.el ends here