author | Claus Gittinger <cg@exept.de> |
Sun, 17 Dec 1995 16:19:09 +0100 | |
changeset 160 | dacfc2454cc8 |
parent 158 | 27f76f9d8a25 |
child 173 | d73d61190510 |
permissions | -rw-r--r-- |
56
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1 |
" |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3 |
All Rights Reserved |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4 |
|
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5 |
This software is furnished under a license and may be used |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
10 |
hereby transferred. |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
11 |
" |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
12 |
|
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
13 |
Object subclass:#AbstractSourceCodeManager |
147 | 14 |
instanceVariableNames:'' |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
15 |
classVariableNames:'DefaultManager CachingSources CacheDirectoryName UseWorkTree |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
16 |
WorkTreeDirectoryName' |
147 | 17 |
poolDictionaries:'' |
18 |
category:'System-Support' |
|
56
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
19 |
! |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
20 |
|
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
21 |
!AbstractSourceCodeManager class methodsFor:'documentation'! |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
22 |
|
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
23 |
copyright |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
24 |
" |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
25 |
COPYRIGHT (c) 1995 by Claus Gittinger |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
26 |
All Rights Reserved |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
27 |
|
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
28 |
This software is furnished under a license and may be used |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
29 |
only in accordance with the terms of that license and with the |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
30 |
inclusion of the above copyright notice. This software may not |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
31 |
be provided or otherwise made available to, or used by, any |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
32 |
other person. No title to or ownership of the software is |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
33 |
hereby transferred. |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
34 |
" |
71 | 35 |
! |
36 |
||
37 |
documentation |
|
38 |
" |
|
39 |
Abstract superclass for sourceCodeManagers. |
|
40 |
Concrete subclasses provide access to a source repository. |
|
41 |
All protocol here traps into subclassResponsbility errors. |
|
42 |
Please read more documentation in concrete subclasses |
|
43 |
(especially: CVSSourceCodeManager) for how to use this manager. |
|
44 |
" |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
45 |
! ! |
56
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
46 |
|
63 | 47 |
!AbstractSourceCodeManager class methodsFor:'initialization'! |
48 |
||
49 |
initCacheDirPath |
|
50 |
|path| |
|
51 |
||
65
098be8484211
dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents:
64
diff
changeset
|
52 |
path := OperatingSystem getEnvironment:'STX_TMPPATH'. |
63 | 53 |
path isNil ifTrue:[ |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
54 |
path := OperatingSystem getEnvironment:'TMPPATH'. |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
55 |
path isNil ifTrue:[ |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
56 |
path := '/tmp' |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
57 |
] |
63 | 58 |
]. |
64 | 59 |
CacheDirectoryName := path , '/stx_sourceCache'. |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
60 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
61 |
"Modified: 16.12.1995 / 15:39:42 / cg" |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
62 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
63 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
64 |
initialize |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
65 |
CachingSources := UseWorkTree := false. |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
66 |
CacheDirectoryName := WorkTreeDirectoryName := ''. |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
67 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
68 |
"Modified: 16.12.1995 / 15:39:42 / cg" |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
69 |
"Created: 16.12.1995 / 15:41:00 / cg" |
63 | 70 |
! ! |
71 |
||
112 | 72 |
!AbstractSourceCodeManager class methodsFor:'accessing'! |
73 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
74 |
cacheDirectoryName |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
75 |
^ CacheDirectoryName |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
76 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
77 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
78 |
cacheDirectoryName:aStringOrFilename |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
79 |
CacheDirectoryName := aStringOrFilename |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
80 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
81 |
"Created: 16.12.1995 / 15:18:43 / cg" |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
82 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
83 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
84 |
cachingSources |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
85 |
^ CachingSources |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
86 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
87 |
"Created: 16.12.1995 / 15:17:50 / cg" |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
88 |
"Modified: 16.12.1995 / 15:18:03 / cg" |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
89 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
90 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
91 |
cachingSources:aBoolean |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
92 |
CachingSources := aBoolean |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
93 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
94 |
"Created: 16.12.1995 / 15:18:13 / cg" |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
95 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
96 |
|
112 | 97 |
defaultManager |
98 |
^ DefaultManager |
|
99 |
||
100 |
"Created: 7.12.1995 / 17:14:22 / cg" |
|
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
101 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
102 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
103 |
useWorkTree |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
104 |
^ UseWorkTree |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
105 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
106 |
"Created: 16.12.1995 / 15:36:48 / cg" |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
107 |
"Modified: 16.12.1995 / 15:37:17 / cg" |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
108 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
109 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
110 |
useWorkTree:aBoolean |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
111 |
UseWorkTree := aBoolean |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
112 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
113 |
"Modified: 16.12.1995 / 15:18:03 / cg" |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
114 |
"Created: 16.12.1995 / 15:37:29 / cg" |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
115 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
116 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
117 |
workTreeDirectoryName |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
118 |
^ WorkTreeDirectoryName |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
119 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
120 |
"Created: 16.12.1995 / 15:35:21 / cg" |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
121 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
122 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
123 |
workTreeDirectoryName:aStringOrFilename |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
124 |
WorkTreeDirectoryName := aStringOrFilename |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
125 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
126 |
"Created: 16.12.1995 / 15:35:34 / cg" |
112 | 127 |
! ! |
128 |
||
71 | 129 |
!AbstractSourceCodeManager class methodsFor:'private'! |
130 |
||
96 | 131 |
directoryFromContainerPath:containerPath |
148 | 132 |
"given a full path as in an RCS header, extract the directory (i.e. package)." |
133 |
||
96 | 134 |
|path idx| |
135 |
||
136 |
path := self pathInRepositoryFrom:containerPath. |
|
137 |
path notNil ifTrue:[ |
|
148 | 138 |
idx := path indexOf:(Filename separator). |
139 |
idx ~~ 0 ifTrue:[ |
|
140 |
path := path copyFrom:(idx + 1) |
|
141 |
]. |
|
142 |
^ path asFilename directoryName |
|
96 | 143 |
]. |
144 |
^ nil |
|
145 |
||
146 |
" |
|
147 |
SourceCodeManager directoryFromContainerPath:'/files/CVS/stx/libbasic/Array.st' |
|
148 |
" |
|
149 |
||
150 |
"Created: 25.11.1995 / 18:42:20 / cg" |
|
148 | 151 |
"Modified: 13.12.1995 / 13:06:15 / cg" |
96 | 152 |
! |
153 |
||
154 |
filenameFromContainerPath:containerPath |
|
148 | 155 |
"given some path as present in an RCS Header string, extract the containers |
156 |
name. |
|
157 |
OBSOLETE - this is no longer used." |
|
158 |
||
96 | 159 |
|top rest| |
160 |
||
161 |
containerPath notNil ifTrue:[ |
|
148 | 162 |
top := self repositoryTopDirectory. |
163 |
top notNil ifTrue:[ |
|
164 |
(containerPath startsWith:(top , '/')) ifTrue:[ |
|
165 |
rest := containerPath copyFrom:(top size + 2). |
|
166 |
^ rest asFilename baseName |
|
167 |
] |
|
168 |
] |
|
96 | 169 |
]. |
170 |
||
171 |
"Created: 25.11.1995 / 18:42:34 / cg" |
|
148 | 172 |
"Modified: 13.12.1995 / 13:05:14 / cg" |
96 | 173 |
! |
174 |
||
175 |
moduleFromContainerPath:containerPath |
|
148 | 176 |
"given a full path as in an RCS header, extract the module." |
177 |
||
96 | 178 |
|path idx| |
179 |
||
180 |
path := self pathInRepositoryFrom:containerPath. |
|
181 |
path notNil ifTrue:[ |
|
148 | 182 |
idx := path indexOf:(Filename separator). |
183 |
idx == 0 ifTrue:[^ path]. |
|
184 |
^ path copyTo:(idx - 1) |
|
96 | 185 |
]. |
186 |
^ nil |
|
187 |
||
188 |
" |
|
189 |
SourceCodeManager moduleFromContainerPath:'/files/CVS/stx/libbasic/Array.st' |
|
190 |
" |
|
191 |
||
192 |
"Created: 25.11.1995 / 18:42:20 / cg" |
|
148 | 193 |
"Modified: 13.12.1995 / 13:06:03 / cg" |
96 | 194 |
! |
195 |
||
196 |
pathInRepositoryFrom:containerPath |
|
148 | 197 |
"this tries to extract the path within a repository, given some path |
198 |
as present in an RCS Header string. |
|
199 |
Typically, this ought to be that string directly; |
|
200 |
however, if the repository directory is accessed via a symbolic link during |
|
201 |
ci/co, some systems extract different strings with co. |
|
202 |
One such system here had a symbolic link from /phys/ibm/CVS... to /file/CVS, |
|
203 |
and extracted sources had /phys/ibm/CVS in their header. |
|
204 |
Do not depend on the code below to work correctly all the time." |
|
205 |
||
96 | 206 |
|top rest lastTop idx| |
207 |
||
208 |
containerPath notNil ifTrue:[ |
|
148 | 209 |
top := self repositoryTopDirectory. |
210 |
top notNil ifTrue:[ |
|
211 |
(containerPath startsWith:(top , '/')) ifTrue:[ |
|
212 |
^ containerPath copyFrom:(top size + 2). |
|
213 |
]. |
|
214 |
||
215 |
"/ hardcase - the repository-filename in the versionInfo |
|
216 |
"/ does no match my repository top. |
|
217 |
"/ check for mangled prefix (happens with symbolic links) |
|
218 |
||
219 |
lastTop := '/' , top asFilename baseName, '/'. |
|
220 |
idx := containerPath indexOfSubCollection:lastTop. |
|
221 |
idx ~~ 0 ifTrue:[ |
|
222 |
('SOURCEMGR: warning: repository path mismatch: ' , (containerPath copyTo:idx-1) , lastTop , ' vs. ' , top , '/') infoPrintNL. |
|
223 |
'SOURCEMGR: warning: assuming that mismatch is ok.' infoPrintNL. |
|
224 |
^ containerPath copyFrom:(idx + lastTop size). |
|
225 |
] |
|
226 |
] |
|
96 | 227 |
]. |
228 |
^ rest |
|
229 |
||
230 |
" |
|
231 |
SourceCodeManager pathInRepositoryFrom:'/files/CVS/stx/libbasic/Array.st' |
|
232 |
SourceCodeManager pathInRepositoryFrom:'/phys/ibm/CVS/stx/libbasic/Array.st' |
|
233 |
" |
|
234 |
||
235 |
"Created: 25.11.1995 / 18:42:20 / cg" |
|
148 | 236 |
"Modified: 13.12.1995 / 13:03:53 / cg" |
96 | 237 |
! |
238 |
||
239 |
repositoryTopDirectory |
|
240 |
^ nil |
|
241 |
||
242 |
"Created: 25.11.1995 / 18:38:59 / cg" |
|
243 |
! |
|
244 |
||
87 | 245 |
revisionAfter:aRevisionString |
246 |
|idx s| |
|
247 |
||
248 |
idx := aRevisionString lastIndexOf:$.. |
|
249 |
idx == 0 ifTrue:[ |
|
250 |
^ ((Integer readFrom:aRevisionString) + 1) printString |
|
251 |
]. |
|
252 |
||
253 |
^ (aRevisionString copyTo:idx) , ((Integer readFrom:(aRevisionString copyFrom:(idx+1)))+1) printString |
|
254 |
||
255 |
" |
|
256 |
SourceCodeManager revisionAfter:'1.2.3.4' |
|
257 |
SourceCodeManager revisionAfter:'123' |
|
258 |
SourceCodeManager revisionAfter:'1.24' |
|
259 |
" |
|
260 |
||
261 |
"Created: 20.11.1995 / 12:54:05 / cg" |
|
262 |
! |
|
263 |
||
71 | 264 |
sourceCacheDirectory |
265 |
|dir nm| |
|
266 |
||
267 |
(nm := self cacheDirectoryName) isNil ifTrue:[^ nil]. |
|
69 | 268 |
|
71 | 269 |
(dir := nm asFilename) exists ifFalse:[ |
270 |
dir makeDirectory. |
|
271 |
dir asFilename exists ifFalse:[ |
|
272 |
'SOURCEMGR: could not create cache dir ''' , CacheDirectoryName , '''' infoPrintNL. |
|
273 |
^ nil |
|
274 |
]. |
|
275 |
]. |
|
276 |
^ dir |
|
277 |
! |
|
69 | 278 |
|
96 | 279 |
sourceInfoOfClass:aClass |
280 |
"helper: return a classes sourceCodeInfo" |
|
281 |
||
282 |
|cls sourceInfo revInfo actualSourceFileName classFileName |
|
283 |
newInfo revisionInfo container| |
|
284 |
||
285 |
cls := aClass. |
|
286 |
cls isMeta ifTrue:[ |
|
160 | 287 |
cls := cls soleInstance |
96 | 288 |
]. |
289 |
||
290 |
"/ |
|
291 |
"/ the info given by the classes source ... |
|
292 |
"/ |
|
293 |
revInfo := aClass revisionInfo. |
|
294 |
||
295 |
"/ |
|
296 |
"/ the info given by the classes binary ... |
|
297 |
"/ if present, we better trust that one. |
|
298 |
"/ |
|
299 |
sourceInfo := cls packageSourceCodeInfo. |
|
300 |
sourceInfo isNil ifTrue:[ |
|
160 | 301 |
revInfo isNil ifTrue:[ |
302 |
'SOURCEMGR: class has neither source nor compiled-in info' infoPrintNL. |
|
303 |
^ nil |
|
304 |
]. |
|
96 | 305 |
|
160 | 306 |
container := revInfo at:#repositoryPathName ifAbsent:nil. |
307 |
container notNil ifTrue:[ |
|
308 |
sourceInfo := revInfo. |
|
309 |
sourceInfo at:#directory put:(self directoryFromContainerPath:container). |
|
310 |
sourceInfo at:#module put:(self moduleFromContainerPath:container). |
|
311 |
] |
|
96 | 312 |
]. |
313 |
||
314 |
||
315 |
"/ |
|
316 |
"/ the filename I would expect from its name ... |
|
317 |
"/ |
|
318 |
classFileName := Smalltalk fileNameForClass:aClass. |
|
319 |
||
320 |
newInfo := IdentityDictionary new. |
|
321 |
sourceInfo keysAndValuesDo:[:key :value | |
|
160 | 322 |
newInfo at:key put:value |
96 | 323 |
]. |
324 |
||
325 |
"/ check .. |
|
326 |
revInfo notNil ifTrue:[ |
|
160 | 327 |
actualSourceFileName := revInfo at:#fileName ifAbsent:nil. |
328 |
actualSourceFileName notNil ifTrue:[ |
|
329 |
actualSourceFileName ~= (classFileName , '.st') ifTrue:[ |
|
330 |
('SOURCEMGR: source of class ' , aClass name , ' found in ' , actualSourceFileName , ' (expected: ' , classFileName , '.st); renamed ?') infoPrintNL. |
|
331 |
newInfo at:#expectedFileName put:(classFileName). |
|
332 |
newInfo at:#renamed put:true. |
|
333 |
classFileName := actualSourceFileName copyWithoutLast:3 |
|
334 |
] |
|
335 |
] |
|
96 | 336 |
]. |
337 |
||
338 |
newInfo at:#classFileName put:classFileName. |
|
339 |
^ newInfo |
|
340 |
||
341 |
"Created: 25.11.1995 / 12:40:19 / cg" |
|
160 | 342 |
"Modified: 17.12.1995 / 16:03:31 / cg" |
96 | 343 |
! |
344 |
||
71 | 345 |
streamForClass:cls fileName:classFileName revision:revision directory:packageDir module:moduleDir cache:cacheIt |
346 |
self subclassResponsibility. |
|
347 |
^ nil |
|
348 |
||
349 |
"Created: 4.11.1995 / 19:09:12 / cg" |
|
350 |
"Modified: 4.11.1995 / 19:15:43 / cg" |
|
95 | 351 |
! ! |
352 |
||
353 |
!AbstractSourceCodeManager class methodsFor:'source code access'! |
|
354 |
||
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
355 |
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage |
95 | 356 |
"checkin of a class into the source repository. |
357 |
Return true if ok, false if not." |
|
358 |
||
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
359 |
|tempDir tempFile ok| |
71 | 360 |
|
361 |
tempDir := (Filename newTemporaryIn:nil) makeDirectory. |
|
362 |
[ |
|
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
363 |
|aStream| |
75 | 364 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
365 |
tempFile := tempDir construct:classFileName. |
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
366 |
aStream := tempFile writeStream. |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
367 |
aStream isNil ifTrue:[ |
121
a23bb38554ee
trace messages only if Verbose is true
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
368 |
'SOURCEMGR: temporary fileout failed' errorPrintNL. |
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
369 |
^ false |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
370 |
]. |
71 | 371 |
|
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
372 |
Class fileOutErrorSignal handle:[:ex | |
121
a23bb38554ee
trace messages only if Verbose is true
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
373 |
'SOURCEMGR: fileout failed' errorPrintNL. |
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
374 |
aStream close. |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
375 |
^ false |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
376 |
] do:[ |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
377 |
aClass fileOutOn:aStream withTimeStamp:false. |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
378 |
]. |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
379 |
aStream close. |
71 | 380 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
381 |
tempFile exists ifFalse:[ |
121
a23bb38554ee
trace messages only if Verbose is true
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
382 |
'SOURCEMGR: temporary fileout failed' errorPrintNL. |
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
383 |
^ false |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
384 |
]. |
75 | 385 |
|
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
386 |
ok := self |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
387 |
checkinClass:aClass |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
388 |
fileName:classFileName |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
389 |
directory:packageDir |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
390 |
module:moduleDir |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
391 |
source:(tempFile name) |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
392 |
logMessage:logMessage. |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
393 |
|
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
394 |
^ ok |
71 | 395 |
] valueNowOrOnUnwindDo:[ |
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
396 |
tempDir recursiveRemove |
71 | 397 |
]. |
398 |
^ false |
|
399 |
||
400 |
" |
|
401 |
SourceCodeManager checkinClass:Array |
|
402 |
" |
|
403 |
||
404 |
"Created: 6.11.1995 / 18:56:00 / cg" |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
405 |
"Modified: 9.12.1995 / 21:43:35 / cg" |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
406 |
! |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
407 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
408 |
checkinClass:aClass logMessage:logMessage |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
409 |
"checkin of a class into the source repository. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
410 |
Return true if ok, false if not." |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
411 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
412 |
|sourceInfo packageDir moduleDir classFileName| |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
413 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
414 |
sourceInfo := self sourceInfoOfClass:aClass. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
415 |
sourceInfo isNil ifTrue:[ |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
416 |
('SOURCEMGR: no sourceInfo for class: ' , aClass name) errorPrintNL. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
417 |
^ false |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
418 |
]. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
419 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
420 |
packageDir := sourceInfo at:#directory. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
421 |
moduleDir := sourceInfo at:#module. "/ use the modules name as CVS module |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
422 |
classFileName := sourceInfo at:#classFileName. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
423 |
"/ classFileName := Smalltalk fileNameForClass:aClass. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
424 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
425 |
^ self checkinClass:aClass fileName:(classFileName , '.st') directory:packageDir module:moduleDir logMessage:logMessage |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
426 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
427 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
428 |
" |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
429 |
SourceCodeManager checkinClass:Array |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
430 |
" |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
431 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
432 |
"Created: 6.11.1995 / 18:56:00 / cg" |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
433 |
"Modified: 9.12.1995 / 21:40:44 / cg" |
71 | 434 |
! |
435 |
||
133 | 436 |
mostRecentSourceStreamForClassNamed:aClassName |
437 |
|cls sourceInfo classFileName packageDir moduleDir| |
|
71 | 438 |
|
133 | 439 |
cls := Smalltalk classNamed:aClassName. |
440 |
cls notNil ifTrue:[ |
|
441 |
sourceInfo := self sourceInfoOfClass:cls. |
|
442 |
]. |
|
443 |
sourceInfo notNil ifTrue:[ |
|
444 |
packageDir := sourceInfo at:#directory. |
|
445 |
moduleDir := sourceInfo at:#module. "/ use the modules name as CVS module |
|
446 |
classFileName := sourceInfo at:#classFileName. |
|
447 |
] ifFalse:[ |
|
448 |
classFileName := Smalltalk fileNameForClass:aClassName. |
|
449 |
packageDir := Smalltalk sourceDirectoryNameOfClass:aClassName. |
|
450 |
moduleDir := 'stx'. |
|
451 |
]. |
|
452 |
||
453 |
packageDir isNil ifTrue:[ |
|
454 |
'SRCMGR: could not extract packageDir' errorPrintNL. |
|
455 |
^ nil |
|
456 |
]. |
|
71 | 457 |
|
458 |
^ self |
|
133 | 459 |
streamForClass:nil |
460 |
fileName:classFileName |
|
461 |
revision:#newest |
|
462 |
directory:packageDir |
|
463 |
module:moduleDir |
|
464 |
cache:false |
|
71 | 465 |
|
466 |
"Created: 6.11.1995 / 16:09:06 / cg" |
|
133 | 467 |
"Modified: 10.12.1995 / 01:09:06 / cg" |
71 | 468 |
! |
469 |
||
56
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
470 |
sourceStreamFor:aClass |
58 | 471 |
"extract a classes source code and return an open readStream on it. |
472 |
The classes source code is extracted using the revision and the sourceCodeInfo, |
|
473 |
which itself is extracted from the classes packageString." |
|
474 |
||
83
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
475 |
^ self sourceStreamFor:aClass revision:nil |
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
476 |
! |
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
477 |
|
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
478 |
sourceStreamFor:aClass revision:aRevisionStringOrNil |
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
479 |
"extract a classes source code and return an open readStream on it. |
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
480 |
A revision of nil selects the current (in image) revision. |
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
481 |
The classes source code is extracted using the revision and the sourceCodeInfo, |
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
482 |
which itself is extracted from the classes packageString." |
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
483 |
|
96 | 484 |
|classFileName revision |
485 |
packageDir moduleDir sourceInfo revInfo| |
|
58 | 486 |
|
83
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
487 |
aRevisionStringOrNil isNil ifTrue:[ |
109 | 488 |
revision := aClass binaryRevision. |
489 |
revision isNil ifTrue:[ |
|
490 |
'SOURCEMGR: class ' , aClass name , ' has no revision string' infoPrintNL. |
|
491 |
^ nil. |
|
492 |
] |
|
83
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
493 |
] ifFalse:[ |
109 | 494 |
revision := aRevisionStringOrNil |
58 | 495 |
]. |
496 |
||
95 | 497 |
sourceInfo := self sourceInfoOfClass:aClass. |
498 |
sourceInfo isNil ifTrue:[^ nil]. |
|
58 | 499 |
|
500 |
packageDir := sourceInfo at:#directory. |
|
501 |
moduleDir := sourceInfo at:#module. "/ use the modules name as CVS module |
|
96 | 502 |
classFileName := sourceInfo at:#classFileName. |
503 |
||
58 | 504 |
|
505 |
^ self |
|
109 | 506 |
streamForClass:aClass |
507 |
fileName:classFileName |
|
508 |
revision:revision |
|
509 |
directory:packageDir |
|
510 |
module:moduleDir |
|
511 |
cache:true |
|
65
098be8484211
dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents:
64
diff
changeset
|
512 |
|
96 | 513 |
"Modified: 25.11.1995 / 17:04:38 / cg" |
58 | 514 |
! ! |
515 |
||
71 | 516 |
!AbstractSourceCodeManager class methodsFor:'source code administration'! |
59
3bb0b97dffa2
reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents:
58
diff
changeset
|
517 |
|
122
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
518 |
checkForExistingContainerInModule:moduleName package:dirName container:fileName |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
519 |
self subclassResponsibility. |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
520 |
^ false |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
521 |
|
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
522 |
"Created: 9.12.1995 / 19:02:23 / cg" |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
523 |
"Modified: 9.12.1995 / 19:43:39 / cg" |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
524 |
! |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
525 |
|
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
526 |
checkForExistingModule:moduleName |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
527 |
self subclassResponsibility. |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
528 |
^ false |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
529 |
|
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
530 |
"Created: 9.12.1995 / 19:02:23 / cg" |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
531 |
"Modified: 9.12.1995 / 19:43:54 / cg" |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
532 |
! |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
533 |
|
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
534 |
checkForExistingModule:moduleDir package:packageDir |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
535 |
self subclassResponsibility. |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
536 |
^ false |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
537 |
|
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
538 |
"Created: 9.12.1995 / 19:02:23 / cg" |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
539 |
"Modified: 9.12.1995 / 19:44:04 / cg" |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
540 |
! |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
541 |
|
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
542 |
createContainerFor:aClass inModule:moduleName directory:dirName container:fileName |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
543 |
self subclassResponsibility. |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
544 |
^ false |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
545 |
|
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
546 |
"Created: 9.12.1995 / 19:02:47 / cg" |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
547 |
"Modified: 9.12.1995 / 19:28:15 / cg" |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
548 |
! |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
549 |
|
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
550 |
createModule:moduleName |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
551 |
self subclassResponsibility. |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
552 |
^ false |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
553 |
|
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
554 |
"Created: 9.12.1995 / 19:02:23 / cg" |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
555 |
"Modified: 9.12.1995 / 19:53:23 / cg" |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
556 |
! |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
557 |
|
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
558 |
createModule:module package:package |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
559 |
self subclassResponsibility. |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
560 |
^ false |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
561 |
|
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
562 |
"Created: 9.12.1995 / 19:02:23 / cg" |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
563 |
"Modified: 9.12.1995 / 19:54:26 / cg" |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
564 |
! |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
565 |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
566 |
revisionLogOf:aClass |
95 | 567 |
"return info about the repository container and |
568 |
the revisionlog as a collection of revision entries. |
|
569 |
Return nil on failure. |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
570 |
The returned information is a structure (IdentityDictionary) |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
571 |
filled with: |
95 | 572 |
#container -> the RCS container file name |
573 |
#filename -> the actual source file name |
|
574 |
#newestRevision -> the revisionString of the newest revision |
|
575 |
#numberOfRevisions -> the number of revisions in the container |
|
576 |
#revisions -> collection of per-revision info |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
577 |
|
95 | 578 |
per revision info consists of one record per revision: |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
579 |
|
95 | 580 |
#revision -> the revision string |
581 |
#author -> who checked that revision into the repository |
|
582 |
#date -> when was it checked in |
|
583 |
#state -> the RCS state |
|
584 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
585 |
|
95 | 586 |
revisions are ordered newest first |
587 |
(i.e. the last entry is for the initial revision; the first for the most recent one) |
|
588 |
" |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
589 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
590 |
^ self |
95 | 591 |
revisionLogOf:aClass fromRevision:nil toRevision:nil |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
592 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
593 |
" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
594 |
SourceCodeManager revisionLogOf:Array |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
595 |
" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
596 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
597 |
"Created: 25.11.1995 / 11:25:02 / cg" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
598 |
"Modified: 25.11.1995 / 11:56:16 / cg" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
599 |
! |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
600 |
|
110 | 601 |
revisionLogOf:aClass fromRevision:rev1 |
602 |
"return info about the repository container and |
|
603 |
(part of) the revisionlog as a collection of revision entries. |
|
604 |
Return nil on failure. |
|
605 |
||
606 |
The returned information is a structure (IdentityDictionary) |
|
607 |
filled with: |
|
112 | 608 |
#container -> the RCS container file name |
609 |
#filename -> the actual source file name |
|
610 |
#newestRevision -> the revisionString of the newest revision |
|
611 |
#numberOfRevisions -> the number of revisions in the container |
|
612 |
#revisions -> collection of per-revision info (see below) |
|
110 | 613 |
|
112 | 614 |
for some classes, additional info is returned: |
110 | 615 |
|
112 | 616 |
#renamed -> true if the class has been renamed or copied |
617 |
and the sourceInfo is from the previous one |
|
618 |
#expectedFileName -> the filename we would expect (i.e. for the new class) |
|
110 | 619 |
|
112 | 620 |
rev1 / rev2 specify from which revisions a logEntry is wanted: |
621 |
If rev1 is nil, the first revision is the initial revision |
|
622 |
otherwise, the log starts with that revision. |
|
623 |
If rev2 is nil, the last revision is the newest revision |
|
624 |
otherwise, the log ends with that revision. |
|
625 |
If both are nil, no logEntries are extracted (i.e. only the header). |
|
110 | 626 |
|
112 | 627 |
per revision info consists of one record per revision: |
110 | 628 |
|
112 | 629 |
#revision -> the revision string |
630 |
#author -> who checked that revision into the repository |
|
631 |
#date -> when was it checked in |
|
632 |
#state -> the RCS state |
|
633 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
|
110 | 634 |
|
112 | 635 |
revisions are ordered newest first |
636 |
(i.e. the last entry is for the initial revision; the first for the most recent one) |
|
637 |
" |
|
110 | 638 |
|
639 |
^ self revisionLogOf:aClass fromRevision:rev1 toRevision:nil |
|
640 |
||
641 |
" |
|
642 |
SourceCodeManager revisionLogOf:Array fromRevision:'1.40' |
|
643 |
" |
|
644 |
||
645 |
"Created: 6.11.1995 / 18:56:00 / cg" |
|
646 |
"Modified: 7.12.1995 / 11:51:15 / cg" |
|
647 |
! |
|
648 |
||
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
649 |
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 |
95 | 650 |
"return info about the repository container and |
651 |
(part of) the revisionlog as a collection of revision entries. |
|
652 |
Return nil on failure. |
|
653 |
||
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
654 |
The returned information is a structure (IdentityDictionary) |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
655 |
filled with: |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
656 |
#container -> the RCS container file name |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
657 |
#filename -> the actual source file name |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
658 |
#newestRevision -> the revisionString of the newest revision |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
659 |
#numberOfRevisions -> the number of revisions in the container |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
660 |
#revisions -> collection of per-revision info (see below) |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
661 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
662 |
for some classes, additional info is returned: |
96 | 663 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
664 |
#renamed -> true if the class has been renamed or copied |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
665 |
and the sourceInfo is from the previous one |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
666 |
#expectedFileName -> the filename we would expect (i.e. for the new class) |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
667 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
668 |
rev1 / rev2 specify from which revisions a logEntry is wanted: |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
669 |
If rev1 is nil, the first revision is the initial revision |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
670 |
otherwise, the log starts with that revision. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
671 |
If rev2 is nil, the last revision is the newest revision |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
672 |
otherwise, the log ends with that revision. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
673 |
If both are nil, no logEntries are extracted (i.e. only the header). |
96 | 674 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
675 |
per revision info consists of one record per revision: |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
676 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
677 |
#revision -> the revision string |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
678 |
#author -> who checked that revision into the repository |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
679 |
#date -> when was it checked in |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
680 |
#state -> the RCS state |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
681 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
682 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
683 |
revisions are ordered newest first |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
684 |
(i.e. the last entry is for the initial revision; the first for the most recent one) |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
685 |
" |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
686 |
|
96 | 687 |
|cls sourceInfo packageDir moduleDir classFileName info| |
95 | 688 |
|
689 |
sourceInfo := self sourceInfoOfClass:aClass. |
|
690 |
sourceInfo isNil ifTrue:[^ nil]. |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
691 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
692 |
packageDir := sourceInfo at:#directory. |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
693 |
moduleDir := sourceInfo at:#module. "/ use the modules name as CVS module |
96 | 694 |
"/ classFileName := Smalltalk fileNameForClass:aClass. |
695 |
classFileName := sourceInfo at:#classFileName. |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
696 |
|
96 | 697 |
info := self |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
698 |
revisionLogOf:aClass |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
699 |
fromRevision:rev1 |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
700 |
toRevision:rev2 |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
701 |
fileName:(classFileName , '.st') |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
702 |
directory:packageDir |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
703 |
module:moduleDir. |
96 | 704 |
|
705 |
info notNil ifTrue:[ |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
706 |
(sourceInfo includesKey:#renamed) ifTrue:[ |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
707 |
info at:#renamed put:(sourceInfo at:#renamed) |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
708 |
]. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
709 |
(sourceInfo includesKey:#expectedFileName) ifTrue:[ |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
710 |
info at:#expectedFileName put:(sourceInfo at:#expectedFileName) |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
711 |
] |
96 | 712 |
]. |
713 |
^ info |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
714 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
715 |
" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
716 |
SourceCodeManager revisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' |
96 | 717 |
SourceCodeManager revisionLogOf:XtBoxNew |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
718 |
" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
719 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
720 |
"Created: 6.11.1995 / 18:56:00 / cg" |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
721 |
"Modified: 9.12.1995 / 22:04:08 / cg" |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
722 |
! |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
723 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
724 |
revisionLogOf:cls fromRevision:rev1 toRevision:rev2 fileName:classFileName directory:packageDir module:moduleDir |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
725 |
"this must be implemented by a concrete source-code manager" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
726 |
|
87 | 727 |
self subclassResponsibility. |
73 | 728 |
|
87 | 729 |
"Created: 15.11.1995 / 18:12:51 / cg" |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
730 |
"Modified: 25.11.1995 / 11:56:38 / cg" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
731 |
! |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
732 |
|
147 | 733 |
writeHistoryLogSince:timeGoal filterSTSources:filter to:aStream |
734 |
self writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:nil to:aStream |
|
735 |
||
736 |
"Modified: 13.12.1995 / 11:03:01 / cg" |
|
737 |
! |
|
738 |
||
739 |
writeHistoryLogSince:timeGoal to:aStream |
|
740 |
self writeHistoryLogSince:timeGoal filterSTSources:true filterUser:nil to:aStream |
|
741 |
||
742 |
"Created: 13.12.1995 / 10:28:27 / cg" |
|
743 |
"Modified: 13.12.1995 / 11:00:49 / cg" |
|
744 |
! |
|
745 |
||
96 | 746 |
writeRevisionLogMessagesFrom:log to:aStream |
747 |
"helper; send the revisionlog to aStream" |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
748 |
|
138
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
749 |
self writeRevisionLogMessagesFrom:log withHeader:true to:aStream |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
750 |
|
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
751 |
"Created: 10.12.1995 / 16:51:30 / cg" |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
752 |
! |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
753 |
|
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
754 |
writeRevisionLogMessagesFrom:log withHeader:header to:aStream |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
755 |
"helper; send the revisionlog to aStream" |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
756 |
|
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
757 |
header ifTrue:[ |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
758 |
(log at:#renamed ifAbsent:false) ifTrue:[ |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
759 |
aStream nextPutAll:' Class was probably renamed; revision info is from original class.'. |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
760 |
aStream cr; nextPutAll:' You may have to create a new container for it.'. |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
761 |
aStream cr; cr. |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
762 |
]. |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
763 |
|
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
764 |
aStream nextPutAll:' Total revisions: '; nextPutAll:(log at:#numberOfRevisions) printString; cr. |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
765 |
aStream nextPutAll:' Newest revision: '; nextPutAll:(log at:#newestRevision) printString; cr. |
96 | 766 |
]. |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
767 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
768 |
(log at:#revisions) do:[:entry | |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
769 |
|logMsg| |
96 | 770 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
771 |
aStream cr. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
772 |
aStream nextPutAll:' revision '; nextPutAll:(entry at:#revision); tab. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
773 |
aStream nextPutAll:' date: '; nextPutAll:(entry at:#date); tab. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
774 |
aStream nextPutAll:' author: '; nextPutAll:(entry at:#author); tab. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
775 |
aStream cr. |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
776 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
777 |
logMsg := entry at:#logMessage. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
778 |
(logMsg isEmpty or:[logMsg isBlank or:[logMsg withoutSeparators = '.']]) ifTrue:[ |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
779 |
logMsg := '*** empty log message ***' |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
780 |
]. |
138
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
781 |
aStream tab; nextPutAll:logMsg. |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
782 |
aStream cr. |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
783 |
]. |
96 | 784 |
|
785 |
"Created: 16.11.1995 / 13:25:30 / cg" |
|
138
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
786 |
"Modified: 10.12.1995 / 16:51:15 / cg" |
73 | 787 |
! |
788 |
||
77 | 789 |
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 to:aStream |
73 | 790 |
"extract a classes log and append it to aStream." |
791 |
||
96 | 792 |
|log | |
73 | 793 |
|
96 | 794 |
log := self revisionLogOf:aClass fromRevision:rev1 toRevision:rev2. |
795 |
log isNil ifTrue:[^ false]. |
|
796 |
||
797 |
self writeRevisionLogMessagesFrom:log to:aStream. |
|
798 |
^ true |
|
73 | 799 |
|
800 |
" |
|
77 | 801 |
SourceCodeManager writeRevisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' to:Transcript |
73 | 802 |
" |
803 |
||
804 |
"Created: 6.11.1995 / 18:56:00 / cg" |
|
96 | 805 |
"Modified: 25.11.1995 / 17:24:55 / cg" |
77 | 806 |
! |
807 |
||
87 | 808 |
writeRevisionLogOf:aClass to:aStream |
809 |
"extract a classes log and append it to aStream." |
|
810 |
||
811 |
^ self |
|
812 |
writeRevisionLogOf:aClass fromRevision:nil toRevision:nil to:aStream |
|
77 | 813 |
|
87 | 814 |
" |
815 |
SourceCodeManager writeRevisionLogOf:Array to:Transcript |
|
816 |
" |
|
817 |
! ! |
|
77 | 818 |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
819 |
!AbstractSourceCodeManager class methodsFor:'documentation'! |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
820 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
821 |
version |
160 | 822 |
^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.39 1995-12-17 15:18:28 cg Exp $' |
123
9a1dff152656
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
122
diff
changeset
|
823 |
! ! |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
824 |
AbstractSourceCodeManager initialize! |