author | Claus Gittinger <cg@exept.de> |
Tue, 14 Jan 1997 21:25:01 +0100 | |
changeset 545 | 198957db4e32 |
parent 537 | 240d5b2ab16c |
child 549 | 8b4035c43732 |
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:'' |
218 | 18 |
category:'System-SourceCodeManagement' |
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 |
|
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
21 |
!AbstractSourceCodeManager class methodsFor:'documentation'! |
56
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. |
|
236 | 44 |
|
45 |
[author:] |
|
46 |
Claus Gittinger |
|
71 | 47 |
" |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
48 |
! ! |
56
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
49 |
|
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
50 |
!AbstractSourceCodeManager class methodsFor:'initialization'! |
63 | 51 |
|
52 |
initCacheDirPath |
|
472 | 53 |
"initialize the name of the cacheDirectory. |
54 |
This is one of: |
|
55 |
STX_TMPPATH/stx_sourceCache |
|
56 |
TMPPATH/stx_sourceCache |
|
57 |
TMPDIR/stx_sourceCache |
|
58 |
/tmp/stx_sourceCache. |
|
59 |
whichever variable is first found to be nonEmpty." |
|
60 |
||
63 | 61 |
|path| |
62 |
||
65
098be8484211
dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents:
64
diff
changeset
|
63 |
path := OperatingSystem getEnvironment:'STX_TMPPATH'. |
63 | 64 |
path isNil ifTrue:[ |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
65 |
path := OperatingSystem getEnvironment:'TMPPATH'. |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
66 |
path isNil ifTrue:[ |
472 | 67 |
path := OperatingSystem getEnvironment:'TMPDIR'. |
68 |
path isNil ifTrue:[ |
|
69 |
path := '/tmp' |
|
70 |
] |
|
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
71 |
] |
63 | 72 |
]. |
64 | 73 |
CacheDirectoryName := path , '/stx_sourceCache'. |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
74 |
|
472 | 75 |
"Modified: 12.9.1996 / 02:27:48 / cg" |
158
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 |
initialize |
472 | 79 |
"setup for no caching and no workTree" |
80 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
81 |
CachingSources := UseWorkTree := false. |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
82 |
CacheDirectoryName := WorkTreeDirectoryName := ''. |
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 |
"Created: 16.12.1995 / 15:41:00 / cg" |
472 | 85 |
"Modified: 12.9.1996 / 02:28:11 / cg" |
63 | 86 |
! ! |
87 |
||
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
88 |
!AbstractSourceCodeManager class methodsFor:'accessing'! |
112 | 89 |
|
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
90 |
cacheDirectoryName |
472 | 91 |
"return the name of the cache directory, where checked out class |
92 |
sources are kept for faster access. The default is '/tmp/stx_sourceCache'. |
|
93 |
This cache is shared among all ST/X users on a system." |
|
94 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
95 |
^ CacheDirectoryName |
472 | 96 |
|
97 |
"Modified: 12.9.1996 / 02:20:45 / cg" |
|
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
98 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
99 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
100 |
cacheDirectoryName:aStringOrFilename |
472 | 101 |
"set the name of the cache directory, where checked out class |
102 |
sources are kept for faster access. The default is '/tmp/stx_sourceCache'. |
|
103 |
This cache is shared among all ST/X users on a system. |
|
104 |
The directory is typically set via the launchers setting menu, or |
|
105 |
from a startup rc-file." |
|
106 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
107 |
CacheDirectoryName := aStringOrFilename |
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 |
"Created: 16.12.1995 / 15:18:43 / cg" |
472 | 110 |
"Modified: 12.9.1996 / 02:21:35 / cg" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
111 |
! |
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 |
cachingSources |
472 | 114 |
"return true, if source caching is enabled. |
115 |
(see cacheDirectoryName for what that means)" |
|
116 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
117 |
^ CachingSources |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
118 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
119 |
"Created: 16.12.1995 / 15:17:50 / cg" |
472 | 120 |
"Modified: 12.9.1996 / 02:22:19 / cg" |
158
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 |
cachingSources:aBoolean |
472 | 124 |
"enable/disable the caching of source files. |
125 |
(see cacheDirectoryName for what that means)" |
|
126 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
127 |
CachingSources := aBoolean |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
128 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
129 |
"Created: 16.12.1995 / 15:18:13 / cg" |
472 | 130 |
"Modified: 12.9.1996 / 02:22:42 / cg" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
131 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
132 |
|
112 | 133 |
defaultManager |
472 | 134 |
"return the default sourceCodeManager class" |
135 |
||
112 | 136 |
^ DefaultManager |
137 |
||
138 |
"Created: 7.12.1995 / 17:14:22 / cg" |
|
472 | 139 |
"Modified: 12.9.1996 / 02:22:56 / cg" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
140 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
141 |
|
482
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
142 |
repositoryName |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
143 |
"return the name of the repository. |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
144 |
Since this is an abstract class, return nil (i.e. none)" |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
145 |
|
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
146 |
^ nil |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
147 |
|
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
148 |
"Modified: 12.9.1996 / 02:20:45 / cg" |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
149 |
"Created: 14.9.1996 / 13:21:37 / cg" |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
150 |
! |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
151 |
|
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
152 |
useWorkTree |
472 | 153 |
"return the setting of useWorkTree, which (eventually) |
154 |
controls if an up-to-date view of a CVS working tree should be |
|
155 |
kept in sync. This is not yet implemented." |
|
156 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
157 |
^ UseWorkTree |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
158 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
159 |
"Created: 16.12.1995 / 15:36:48 / cg" |
472 | 160 |
"Modified: 12.9.1996 / 02:24:01 / cg" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
161 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
162 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
163 |
useWorkTree:aBoolean |
472 | 164 |
"enable/disable the useWorkTree feature, which (eventually) |
165 |
controls if an up-to-date view of a CVS working tree should be |
|
166 |
kept in sync. This is not yet implemented." |
|
167 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
168 |
UseWorkTree := aBoolean |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
169 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
170 |
"Created: 16.12.1995 / 15:37:29 / cg" |
472 | 171 |
"Modified: 12.9.1996 / 02:24:38 / cg" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
172 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
173 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
174 |
workTreeDirectoryName |
472 | 175 |
"return the name of the workTree, which is kept in sync |
176 |
with the current class versions. This is not yet implemented" |
|
177 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
178 |
^ WorkTreeDirectoryName |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
179 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
180 |
"Created: 16.12.1995 / 15:35:21 / cg" |
472 | 181 |
"Modified: 12.9.1996 / 02:25:13 / cg" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
182 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
183 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
184 |
workTreeDirectoryName:aStringOrFilename |
472 | 185 |
"set the name of the workTree, which is kept in sync |
186 |
with the current class versions. This is not yet implemented" |
|
187 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
188 |
WorkTreeDirectoryName := aStringOrFilename |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
189 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
190 |
"Created: 16.12.1995 / 15:35:34 / cg" |
472 | 191 |
"Modified: 12.9.1996 / 02:25:19 / cg" |
112 | 192 |
! ! |
193 |
||
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
194 |
!AbstractSourceCodeManager class methodsFor:'basic access'! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
195 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
196 |
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir source:sourceFile logMessage:logMessage force:force |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
197 |
"checkin of a class into the source repository. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
198 |
Return true if ok, false if not." |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
199 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
200 |
^ self subclassResponsibility. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
201 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
202 |
"Created: 14.2.1997 / 21:17:33 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
203 |
"Modified: 14.2.1997 / 21:18:48 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
204 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
205 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
206 |
streamForClass:aClass fileName:classFileName revision:revision directory:packageDir module:moduleDir cache:doCache |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
207 |
"extract a classes source code and return an open readStream on it. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
208 |
A revision of nil selects the current (in image) revision. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
209 |
The classes source code is extracted using the revision and the sourceCodeInfo, |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
210 |
which itself is extracted from the classes packageString." |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
211 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
212 |
^ self subclassResponsibility |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
213 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
214 |
"Modified: 14.2.1997 / 21:18:35 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
215 |
! ! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
216 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
217 |
!AbstractSourceCodeManager class methodsFor:'basic administration'! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
218 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
219 |
checkForExistingContainerInModule:moduleName package:dirName container:fileName |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
220 |
"check for a container to be present" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
221 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
222 |
^ self subclassResponsibility. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
223 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
224 |
"Created: 9.12.1995 / 19:02:23 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
225 |
"Modified: 14.2.1997 / 21:18:56 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
226 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
227 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
228 |
checkForExistingModule:moduleName |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
229 |
"check for a module directory to be present" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
230 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
231 |
^ self subclassResponsibility. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
232 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
233 |
"Created: 9.12.1995 / 19:02:23 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
234 |
"Modified: 14.2.1997 / 21:19:01 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
235 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
236 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
237 |
checkForExistingModule:moduleDir package:packageDir |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
238 |
"check for a package directory to be present" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
239 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
240 |
^ self subclassResponsibility. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
241 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
242 |
"Created: 9.12.1995 / 19:02:23 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
243 |
"Modified: 14.2.1997 / 21:19:06 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
244 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
245 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
246 |
createContainerFor:aClass inModule:moduleName directory:dirName container:fileName |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
247 |
"create a new container & check into it an initial version of aClass" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
248 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
249 |
^ self subclassResponsibility. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
250 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
251 |
"Created: 9.12.1995 / 19:02:47 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
252 |
"Modified: 14.2.1997 / 21:19:11 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
253 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
254 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
255 |
createModule:moduleName |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
256 |
"create a new module directory" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
257 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
258 |
^ self subclassResponsibility. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
259 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
260 |
"Created: 9.12.1995 / 19:02:23 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
261 |
"Modified: 14.2.1997 / 21:19:16 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
262 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
263 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
264 |
createModule:module package:package |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
265 |
"create a new package directory" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
266 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
267 |
^ self subclassResponsibility. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
268 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
269 |
"Created: 9.12.1995 / 19:02:23 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
270 |
"Modified: 14.2.1997 / 21:19:21 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
271 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
272 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
273 |
initialRevisionStringFor:aClass inModule:moduleDir package:packageDir container:fileName |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
274 |
"return a string usable as initial revision string" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
275 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
276 |
^ self subclassResponsibility |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
277 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
278 |
"Created: 14.2.1997 / 21:01:41 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
279 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
280 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
281 |
removeContainerFor:aClass inModule:moduleName directory:dirName container:fileName |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
282 |
"remove a container" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
283 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
284 |
^ self subclassResponsibility. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
285 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
286 |
"Created: 11.9.1996 / 13:18:33 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
287 |
"Modified: 14.2.1997 / 21:19:28 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
288 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
289 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
290 |
revisionLogOf:cls fromRevision:rev1 toRevision:rev2 fileName:classFileName directory:packageDir module:moduleDir |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
291 |
"actually do return a revisionLog. The main worker method. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
292 |
This must be implemented by a concrete source-code manager" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
293 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
294 |
^ self subclassResponsibility. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
295 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
296 |
"Created: 15.11.1995 / 18:12:51 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
297 |
"Modified: 14.2.1997 / 21:14:01 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
298 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
299 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
300 |
writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter to:aStream |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
301 |
"send a full historyLog to some stream. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
302 |
Must be implemented by a concrete subclass." |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
303 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
304 |
^ self subclassResponsibility |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
305 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
306 |
"Modified: 14.2.1997 / 21:13:51 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
307 |
! ! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
308 |
|
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
309 |
!AbstractSourceCodeManager class methodsFor:'private'! |
71 | 310 |
|
179 | 311 |
containerFromSourceInfo:info |
472 | 312 |
"given a sourceInfo, return the classes container" |
313 |
||
179 | 314 |
(info includesKey:#fileName) ifTrue:[ |
315 |
^ info at:#fileName |
|
316 |
]. |
|
317 |
(info includesKey:#expectedFileName) ifTrue:[ |
|
318 |
^ info at:#expectedFileName |
|
319 |
]. |
|
320 |
^ (info at:#classFileNameBase) , '.st' |
|
321 |
||
472 | 322 |
"Modified: 12.9.1996 / 02:31:52 / cg" |
179 | 323 |
! |
324 |
||
96 | 325 |
directoryFromContainerPath:containerPath |
148 | 326 |
"given a full path as in an RCS header, extract the directory (i.e. package)." |
327 |
||
96 | 328 |
|path idx| |
329 |
||
330 |
path := self pathInRepositoryFrom:containerPath. |
|
331 |
path notNil ifTrue:[ |
|
148 | 332 |
idx := path indexOf:(Filename separator). |
333 |
idx ~~ 0 ifTrue:[ |
|
334 |
path := path copyFrom:(idx + 1) |
|
335 |
]. |
|
336 |
^ path asFilename directoryName |
|
96 | 337 |
]. |
338 |
^ nil |
|
339 |
||
340 |
" |
|
341 |
SourceCodeManager directoryFromContainerPath:'/files/CVS/stx/libbasic/Array.st' |
|
342 |
" |
|
343 |
||
344 |
"Created: 25.11.1995 / 18:42:20 / cg" |
|
148 | 345 |
"Modified: 13.12.1995 / 13:06:15 / cg" |
96 | 346 |
! |
347 |
||
348 |
filenameFromContainerPath:containerPath |
|
148 | 349 |
"given some path as present in an RCS Header string, extract the containers |
350 |
name. |
|
351 |
OBSOLETE - this is no longer used." |
|
352 |
||
96 | 353 |
|top rest| |
354 |
||
355 |
containerPath notNil ifTrue:[ |
|
148 | 356 |
top := self repositoryTopDirectory. |
357 |
top notNil ifTrue:[ |
|
358 |
(containerPath startsWith:(top , '/')) ifTrue:[ |
|
359 |
rest := containerPath copyFrom:(top size + 2). |
|
360 |
^ rest asFilename baseName |
|
516
183dae704f70
oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents:
515
diff
changeset
|
361 |
]. |
183dae704f70
oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents:
515
diff
changeset
|
362 |
(containerPath startsWith:(top)) ifTrue:[ |
183dae704f70
oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents:
515
diff
changeset
|
363 |
rest := containerPath copyFrom:(top size + 1). |
183dae704f70
oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents:
515
diff
changeset
|
364 |
^ rest asFilename baseName |
148 | 365 |
] |
366 |
] |
|
96 | 367 |
]. |
185 | 368 |
^ containerPath |
96 | 369 |
|
370 |
"Created: 25.11.1995 / 18:42:34 / cg" |
|
516
183dae704f70
oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents:
515
diff
changeset
|
371 |
"Modified: 11.11.1996 / 16:04:39 / cg" |
96 | 372 |
! |
373 |
||
374 |
moduleFromContainerPath:containerPath |
|
148 | 375 |
"given a full path as in an RCS header, extract the module." |
376 |
||
96 | 377 |
|path idx| |
378 |
||
379 |
path := self pathInRepositoryFrom:containerPath. |
|
380 |
path notNil ifTrue:[ |
|
148 | 381 |
idx := path indexOf:(Filename separator). |
382 |
idx == 0 ifTrue:[^ path]. |
|
383 |
^ path copyTo:(idx - 1) |
|
96 | 384 |
]. |
385 |
^ nil |
|
386 |
||
387 |
" |
|
388 |
SourceCodeManager moduleFromContainerPath:'/files/CVS/stx/libbasic/Array.st' |
|
389 |
" |
|
390 |
||
391 |
"Created: 25.11.1995 / 18:42:20 / cg" |
|
148 | 392 |
"Modified: 13.12.1995 / 13:06:03 / cg" |
96 | 393 |
! |
394 |
||
179 | 395 |
moduleFromSourceInfo:info |
472 | 396 |
"given a sourceInfo, return the classes module directory" |
397 |
||
179 | 398 |
^ info at:#module. "/ use the modules name as CVS module |
399 |
||
400 |
"Created: 6.2.1996 / 17:26:38 / cg" |
|
472 | 401 |
"Modified: 12.9.1996 / 02:32:23 / cg" |
179 | 402 |
! |
403 |
||
404 |
packageFromSourceInfo:info |
|
472 | 405 |
"given a sourceInfo, return the classes package directory" |
406 |
||
179 | 407 |
^ info at:#directory. |
408 |
||
409 |
"Created: 6.2.1996 / 17:26:23 / cg" |
|
472 | 410 |
"Modified: 12.9.1996 / 02:32:19 / cg" |
179 | 411 |
! |
412 |
||
96 | 413 |
pathInRepositoryFrom:containerPath |
148 | 414 |
"this tries to extract the path within a repository, given some path |
415 |
as present in an RCS Header string. |
|
416 |
Typically, this ought to be that string directly; |
|
417 |
however, if the repository directory is accessed via a symbolic link during |
|
418 |
ci/co, some systems extract different strings with co. |
|
419 |
One such system here had a symbolic link from /phys/ibm/CVS... to /file/CVS, |
|
420 |
and extracted sources had /phys/ibm/CVS in their header. |
|
421 |
Do not depend on the code below to work correctly all the time." |
|
422 |
||
501 | 423 |
|top lastTop idx| |
96 | 424 |
|
425 |
containerPath notNil ifTrue:[ |
|
148 | 426 |
top := self repositoryTopDirectory. |
427 |
top notNil ifTrue:[ |
|
428 |
(containerPath startsWith:(top , '/')) ifTrue:[ |
|
429 |
^ containerPath copyFrom:(top size + 2). |
|
430 |
]. |
|
515
74ee7c511219
oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents:
514
diff
changeset
|
431 |
(containerPath startsWith:(top)) ifTrue:[ |
74ee7c511219
oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents:
514
diff
changeset
|
432 |
^ containerPath copyFrom:(top size + 1). |
74ee7c511219
oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents:
514
diff
changeset
|
433 |
]. |
148 | 434 |
|
435 |
"/ hardcase - the repository-filename in the versionInfo |
|
436 |
"/ does no match my repository top. |
|
437 |
"/ check for mangled prefix (happens with symbolic links) |
|
438 |
||
439 |
lastTop := '/' , top asFilename baseName, '/'. |
|
440 |
idx := containerPath indexOfSubCollection:lastTop. |
|
441 |
idx ~~ 0 ifTrue:[ |
|
535 | 442 |
('SourceCodeManager [warning]: warning: repository path mismatch: ' , (containerPath copyTo:idx-1) , lastTop , ' vs. ' , top , '/') infoPrintCR. |
443 |
'SourceCodeManager [info]: warning: assuming that mismatch is ok.' infoPrintCR. |
|
148 | 444 |
^ containerPath copyFrom:(idx + lastTop size). |
445 |
] |
|
446 |
] |
|
96 | 447 |
]. |
501 | 448 |
^ nil |
96 | 449 |
|
450 |
" |
|
451 |
SourceCodeManager pathInRepositoryFrom:'/files/CVS/stx/libbasic/Array.st' |
|
452 |
SourceCodeManager pathInRepositoryFrom:'/phys/ibm/CVS/stx/libbasic/Array.st' |
|
453 |
" |
|
454 |
||
455 |
"Created: 25.11.1995 / 18:42:20 / cg" |
|
535 | 456 |
"Modified: 10.1.1997 / 15:13:25 / cg" |
96 | 457 |
! |
458 |
||
459 |
repositoryTopDirectory |
|
472 | 460 |
"return the name of the repository" |
461 |
||
96 | 462 |
^ nil |
463 |
||
464 |
"Created: 25.11.1995 / 18:38:59 / cg" |
|
472 | 465 |
"Modified: 12.9.1996 / 02:32:40 / cg" |
96 | 466 |
! |
467 |
||
87 | 468 |
revisionAfter:aRevisionString |
472 | 469 |
"generate the next revision number after the given number" |
470 |
||
501 | 471 |
|idx| |
87 | 472 |
|
473 |
idx := aRevisionString lastIndexOf:$.. |
|
474 |
idx == 0 ifTrue:[ |
|
472 | 475 |
^ ((Integer readFrom:aRevisionString) + 1) printString |
87 | 476 |
]. |
477 |
||
478 |
^ (aRevisionString copyTo:idx) , ((Integer readFrom:(aRevisionString copyFrom:(idx+1)))+1) printString |
|
479 |
||
480 |
" |
|
481 |
SourceCodeManager revisionAfter:'1.2.3.4' |
|
482 |
SourceCodeManager revisionAfter:'123' |
|
483 |
SourceCodeManager revisionAfter:'1.24' |
|
484 |
" |
|
485 |
||
486 |
"Created: 20.11.1995 / 12:54:05 / cg" |
|
472 | 487 |
"Modified: 12.9.1996 / 02:33:03 / cg" |
87 | 488 |
! |
489 |
||
71 | 490 |
sourceCacheDirectory |
472 | 491 |
"return the sourceCache directories name" |
492 |
||
71 | 493 |
|dir nm| |
494 |
||
495 |
(nm := self cacheDirectoryName) isNil ifTrue:[^ nil]. |
|
69 | 496 |
|
71 | 497 |
(dir := nm asFilename) exists ifFalse:[ |
173
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
498 |
dir makeDirectory. |
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
499 |
dir exists ifFalse:[ |
535 | 500 |
'SourceCodeManager [warning]: could not create cache dir ''' , CacheDirectoryName , '''' infoPrintCR. |
173
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
501 |
^ nil |
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
502 |
]. |
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
503 |
"/ |
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
504 |
"/ make it read/writable for everyone |
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
505 |
"/ |
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
506 |
dir makeReadableForAll. |
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
507 |
dir makeWritableForAll. |
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
508 |
dir makeExecutableForAll. |
71 | 509 |
]. |
510 |
^ dir |
|
173
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
511 |
|
535 | 512 |
"Modified: 10.1.1997 / 15:13:20 / cg" |
71 | 513 |
! |
69 | 514 |
|
96 | 515 |
sourceInfoOfClass:aClass |
516 |
"helper: return a classes sourceCodeInfo" |
|
517 |
||
183 | 518 |
|cls binaryInfo revInfo actualSourceFileName classFileNameBase |
501 | 519 |
newInfo container expectedFileName |
179 | 520 |
directoryFromRev moduleFromRev fileNameFromRev directoryFromBin moduleFromBin| |
96 | 521 |
|
522 |
cls := aClass. |
|
523 |
cls isMeta ifTrue:[ |
|
160 | 524 |
cls := cls soleInstance |
96 | 525 |
]. |
526 |
||
179 | 527 |
newInfo := IdentityDictionary new. |
528 |
||
96 | 529 |
"/ |
530 |
"/ the info given by the classes source ... |
|
531 |
"/ |
|
532 |
revInfo := aClass revisionInfo. |
|
179 | 533 |
revInfo notNil ifTrue:[ |
534 |
revInfo keysAndValuesDo:[:key :value | |
|
535 |
newInfo at:key put:value |
|
536 |
] |
|
537 |
]. |
|
96 | 538 |
|
539 |
"/ |
|
540 |
"/ the info given by the classes binary ... |
|
541 |
"/ if present, we better trust that one. |
|
179 | 542 |
"/ however, it only contains partial information (directory & module). |
543 |
"/ (but is available even without a source) |
|
96 | 544 |
"/ |
179 | 545 |
binaryInfo := cls packageSourceCodeInfo. |
546 |
binaryInfo notNil ifTrue:[ |
|
547 |
binaryInfo keysAndValuesDo:[:key :value | |
|
548 |
newInfo at:key put:value |
|
160 | 549 |
] |
96 | 550 |
]. |
551 |
||
179 | 552 |
"/ |
553 |
"/ no information |
|
554 |
"/ |
|
555 |
(binaryInfo isNil and:[revInfo isNil]) ifTrue:[ |
|
535 | 556 |
('SourceCodeManager [warning]: class `' , aClass name , ''' has neither source nor compiled-in info') infoPrintCR. |
179 | 557 |
^ nil |
558 |
]. |
|
96 | 559 |
|
560 |
"/ |
|
179 | 561 |
"/ validate for conflicts |
562 |
"/ trust binary if in doubt |
|
563 |
"/ (in case some cheater edited the version string) |
|
564 |
||
565 |
revInfo notNil ifTrue:[ |
|
566 |
(revInfo includesKey:#repositoryPathName) ifTrue:[ |
|
567 |
container := revInfo at:#repositoryPathName ifAbsent:nil. |
|
568 |
newInfo at:#directory put:(directoryFromRev := self directoryFromContainerPath:container). |
|
569 |
newInfo at:#module put:(moduleFromRev := self moduleFromContainerPath:container). |
|
185 | 570 |
fileNameFromRev := container asFilename baseName. |
571 |
||
572 |
"/ fileNameFromRev := self filenameFromContainerPath:container. |
|
179 | 573 |
newInfo at:#fileName put:(fileNameFromRev copyWithoutLast:2). |
574 |
||
575 |
binaryInfo notNil ifTrue:[ |
|
576 |
(binaryInfo includesKey:#directory) ifTrue:[ |
|
577 |
directoryFromBin := binaryInfo at:#directory. |
|
578 |
moduleFromBin := binaryInfo at:#module. |
|
96 | 579 |
|
179 | 580 |
(directoryFromBin ~= directoryFromRev |
581 |
or:[moduleFromBin ~= moduleFromRev]) ifTrue:[ |
|
187
fdda79120bbb
in sourceInfoOfClass: be prepared for binInfo present, but no sourceInfo
Claus Gittinger <cg@exept.de>
parents:
185
diff
changeset
|
582 |
(directoryFromRev isNil or:[moduleFromRev isNil]) ifTrue:[ |
535 | 583 |
('SourceCodeManager [info]: using binary info: ' |
514 | 584 |
, moduleFromBin , '/' , directoryFromBin |
266 | 585 |
) infoPrintCR. |
187
fdda79120bbb
in sourceInfoOfClass: be prepared for binInfo present, but no sourceInfo
Claus Gittinger <cg@exept.de>
parents:
185
diff
changeset
|
586 |
] ifFalse:[ |
535 | 587 |
('SourceCodeManager [warning]: conflicting source infos (binary: ' |
514 | 588 |
, moduleFromBin , '/' , directoryFromBin |
187
fdda79120bbb
in sourceInfoOfClass: be prepared for binInfo present, but no sourceInfo
Claus Gittinger <cg@exept.de>
parents:
185
diff
changeset
|
589 |
, ' vs. source:' |
514 | 590 |
, moduleFromRev , '/' , directoryFromRev |
266 | 591 |
, ')') infoPrintCR. |
187
fdda79120bbb
in sourceInfoOfClass: be prepared for binInfo present, but no sourceInfo
Claus Gittinger <cg@exept.de>
parents:
185
diff
changeset
|
592 |
]. |
179 | 593 |
newInfo at:#directory put:directoryFromBin. |
594 |
newInfo at:#module put:moduleFromBin. |
|
595 |
] |
|
596 |
] |
|
597 |
]. |
|
598 |
] |
|
599 |
]. |
|
600 |
||
601 |
"/ |
|
602 |
"/ the filename I'd expect from its name ... |
|
603 |
"/ |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
604 |
aClass owningClass notNil ifTrue:[ |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
605 |
classFileNameBase := Smalltalk fileNameForClass:aClass topOwningClass |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
606 |
] ifFalse:[ |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
607 |
classFileNameBase := Smalltalk fileNameForClass:aClass. |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
608 |
]. |
179 | 609 |
|
610 |
(newInfo includesKey:#fileName) ifFalse:[ |
|
611 |
newInfo at:#fileName put:(classFileNameBase , '.st') |
|
612 |
]. |
|
613 |
||
614 |
"/ guess on the container |
|
615 |
container isNil ifTrue:[ |
|
183 | 616 |
(newInfo includesKey:#directory) ifTrue:[ |
617 |
(newInfo includesKey:#module) ifTrue:[ |
|
618 |
(newInfo includesKey:#module) ifTrue:[ |
|
619 |
container := (newInfo at:#directory) |
|
179 | 620 |
, '/' |
183 | 621 |
, (newInfo at:#module) |
179 | 622 |
, '/' |
623 |
, classFileNameBase , '.st,v'. |
|
624 |
] |
|
625 |
] |
|
626 |
] |
|
627 |
]. |
|
628 |
||
629 |
container notNil ifTrue:[ |
|
630 |
newInfo at:#repositoryPathName put:container. |
|
96 | 631 |
]. |
632 |
||
633 |
"/ check .. |
|
634 |
revInfo notNil ifTrue:[ |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
635 |
|
160 | 636 |
actualSourceFileName := revInfo at:#fileName ifAbsent:nil. |
637 |
actualSourceFileName notNil ifTrue:[ |
|
179 | 638 |
expectedFileName := classFileNameBase , '.st'. |
639 |
actualSourceFileName ~= expectedFileName ifTrue:[ |
|
535 | 640 |
('SourceCodeManager [warning]: source of class ' , aClass name , ' in ' , actualSourceFileName , ';') infoPrintCR. |
641 |
('SourceCodeManager [info]: (expected: ' , expectedFileName , '); renamed or missing abbreviation ?') infoPrintCR. |
|
642 |
('SourceCodeManager [info]: This may fail to autoload later if left unchanged.') infoPrintCR. |
|
179 | 643 |
newInfo at:#expectedFileName put:expectedFileName. |
160 | 644 |
newInfo at:#renamed put:true. |
179 | 645 |
classFileNameBase := actualSourceFileName copyWithoutLast:3 |
160 | 646 |
] |
647 |
] |
|
96 | 648 |
]. |
649 |
||
179 | 650 |
newInfo at:#classFileNameBase put:classFileNameBase. |
96 | 651 |
^ newInfo |
652 |
||
653 |
"Created: 25.11.1995 / 12:40:19 / cg" |
|
535 | 654 |
"Modified: 10.1.1997 / 15:14:18 / cg" |
95 | 655 |
! ! |
656 |
||
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
657 |
!AbstractSourceCodeManager class methodsFor:'source code access'! |
95 | 658 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
659 |
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage |
95 | 660 |
"checkin of a class into the source repository. |
661 |
Return true if ok, false if not." |
|
662 |
||
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
663 |
^ self |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
664 |
checkinClass:aClass |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
665 |
fileName:classFileName |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
666 |
directory:packageDir |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
667 |
module:moduleDir |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
668 |
logMessage:logMessage |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
669 |
force:false |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
670 |
|
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
671 |
"Modified: 11.9.1996 / 16:15:43 / cg" |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
672 |
! |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
673 |
|
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
674 |
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage force:force |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
675 |
"checkin of a class into the source repository. |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
676 |
Return true if ok, false if not." |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
677 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
678 |
|tempDir tempFile ok| |
71 | 679 |
|
680 |
tempDir := (Filename newTemporaryIn:nil) makeDirectory. |
|
681 |
[ |
|
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
682 |
|aStream| |
75 | 683 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
684 |
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
|
685 |
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
|
686 |
aStream isNil ifTrue:[ |
375
476a8a705f0d
show reason why fileOut failed (on stderr)
Claus Gittinger <cg@exept.de>
parents:
266
diff
changeset
|
687 |
'SOURCEMGR: temporary fileout failed' errorPrintCR. |
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
688 |
^ false |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
689 |
]. |
71 | 690 |
|
184
e682441f91cb
flush methods fileCache before filingOut
Claus Gittinger <cg@exept.de>
parents:
183
diff
changeset
|
691 |
Method flushSourceStreamCache. |
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
692 |
Class fileOutErrorSignal handle:[:ex | |
375
476a8a705f0d
show reason why fileOut failed (on stderr)
Claus Gittinger <cg@exept.de>
parents:
266
diff
changeset
|
693 |
'SOURCEMGR: fileout failed.' errorPrintCR. |
476a8a705f0d
show reason why fileOut failed (on stderr)
Claus Gittinger <cg@exept.de>
parents:
266
diff
changeset
|
694 |
'SOURCEMGR: reason: ' errorPrint. ex errorString printCR. |
476a8a705f0d
show reason why fileOut failed (on stderr)
Claus Gittinger <cg@exept.de>
parents:
266
diff
changeset
|
695 |
|
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
696 |
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
|
697 |
^ false |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
698 |
] do:[ |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
699 |
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
|
700 |
]. |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
701 |
aStream close. |
71 | 702 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
703 |
tempFile exists ifFalse:[ |
375
476a8a705f0d
show reason why fileOut failed (on stderr)
Claus Gittinger <cg@exept.de>
parents:
266
diff
changeset
|
704 |
'SOURCEMGR: temporary fileout failed' errorPrintCR. |
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
705 |
^ false |
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
706 |
]. |
75 | 707 |
|
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
708 |
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
|
709 |
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
|
710 |
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
|
711 |
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
|
712 |
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
|
713 |
source:(tempFile name) |
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
714 |
logMessage:logMessage |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
715 |
force:force. |
114
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
716 |
|
bb18f2290ec6
dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents:
112
diff
changeset
|
717 |
^ ok |
71 | 718 |
] 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
|
719 |
tempDir recursiveRemove |
71 | 720 |
]. |
721 |
^ false |
|
722 |
||
723 |
" |
|
724 |
SourceCodeManager checkinClass:Array |
|
725 |
" |
|
726 |
||
375
476a8a705f0d
show reason why fileOut failed (on stderr)
Claus Gittinger <cg@exept.de>
parents:
266
diff
changeset
|
727 |
"Modified: 12.7.1996 / 23:38:36 / cg" |
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
728 |
"Created: 11.9.1996 / 16:15:17 / cg" |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
729 |
! |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
730 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
731 |
checkinClass:aClass logMessage:logMessage |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
732 |
"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
|
733 |
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
|
734 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
735 |
|sourceInfo packageDir moduleDir classFileName| |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
736 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
737 |
sourceInfo := self sourceInfoOfClass:aClass. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
738 |
sourceInfo isNil ifTrue:[ |
537 | 739 |
('SourceCodeManager [warning]: no sourceInfo for class: ' , aClass name) errorPrintCR. |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
740 |
^ false |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
741 |
]. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
742 |
|
179 | 743 |
packageDir := self packageFromSourceInfo:sourceInfo. |
744 |
moduleDir := self moduleFromSourceInfo:sourceInfo. "/ use the modules name as CVS module |
|
745 |
classFileName := self containerFromSourceInfo:sourceInfo. |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
746 |
|
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
747 |
^ self |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
748 |
checkinClass:aClass |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
749 |
fileName:classFileName |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
750 |
directory:packageDir |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
751 |
module:moduleDir |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
752 |
logMessage:logMessage |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
753 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
754 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
755 |
" |
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
756 |
SourceCodeManager checkinClass:Array logMessage:'foo' |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
757 |
" |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
758 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
759 |
"Created: 6.11.1995 / 18:56:00 / cg" |
537 | 760 |
"Modified: 10.1.1997 / 17:26:48 / cg" |
71 | 761 |
! |
762 |
||
493
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
763 |
getMostRecentSourceStreamForClassNamed:aClassName |
472 | 764 |
"given a class, return an open stream to its most recent source |
765 |
(not knowing anything about its version). |
|
766 |
Used when autoloading classes." |
|
767 |
||
133 | 768 |
|cls sourceInfo classFileName packageDir moduleDir| |
71 | 769 |
|
133 | 770 |
cls := Smalltalk classNamed:aClassName. |
771 |
cls notNil ifTrue:[ |
|
772 |
sourceInfo := self sourceInfoOfClass:cls. |
|
773 |
]. |
|
774 |
sourceInfo notNil ifTrue:[ |
|
179 | 775 |
packageDir := self packageFromSourceInfo:sourceInfo. |
776 |
moduleDir := self moduleFromSourceInfo:sourceInfo. "/ use the modules name as CVS module |
|
777 |
classFileName := self containerFromSourceInfo:sourceInfo. |
|
133 | 778 |
] ifFalse:[ |
179 | 779 |
classFileName := (Smalltalk fileNameForClass:aClassName) , '.st'. |
133 | 780 |
packageDir := Smalltalk sourceDirectoryNameOfClass:aClassName. |
781 |
moduleDir := 'stx'. |
|
782 |
]. |
|
783 |
||
784 |
packageDir isNil ifTrue:[ |
|
537 | 785 |
'SourceCodeManager [warning]: could not extract packageDir' errorPrintCR. |
133 | 786 |
^ nil |
787 |
]. |
|
71 | 788 |
|
789 |
^ self |
|
133 | 790 |
streamForClass:nil |
791 |
fileName:classFileName |
|
792 |
revision:#newest |
|
793 |
directory:packageDir |
|
794 |
module:moduleDir |
|
795 |
cache:false |
|
71 | 796 |
|
493
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
797 |
"Created: 12.10.1996 / 17:22:54 / cg" |
537 | 798 |
"Modified: 10.1.1997 / 17:27:27 / cg" |
71 | 799 |
! |
800 |
||
493
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
801 |
getSourceStreamFor:aClass |
58 | 802 |
"extract a classes source code and return an open readStream on it. |
803 |
The classes source code is extracted using the revision and the sourceCodeInfo, |
|
804 |
which itself is extracted from the classes packageString." |
|
805 |
||
493
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
806 |
^ self getSourceStreamFor:aClass revision:nil |
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
807 |
|
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
808 |
"Created: 12.10.1996 / 17:21:03 / cg" |
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
809 |
"Modified: 12.10.1996 / 17:22:02 / cg" |
83
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
810 |
! |
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
811 |
|
493
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
812 |
getSourceStreamFor:aClass revision:aRevisionStringOrNil |
83
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
813 |
"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
|
814 |
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
|
815 |
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
|
816 |
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
|
817 |
|
96 | 818 |
|classFileName revision |
501 | 819 |
packageDir moduleDir sourceInfo| |
58 | 820 |
|
83
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
821 |
aRevisionStringOrNil isNil ifTrue:[ |
179 | 822 |
revision := aClass binaryRevision. |
823 |
revision isNil ifTrue:[ |
|
191
ebdb455a26ce
take revision if no binaryRevision is available (in sourceStream for ...)
ca
parents:
187
diff
changeset
|
824 |
revision := aClass revision. |
ebdb455a26ce
take revision if no binaryRevision is available (in sourceStream for ...)
ca
parents:
187
diff
changeset
|
825 |
revision isNil ifTrue:[ |
535 | 826 |
('SourceCodeManager [warning]: class `' , aClass name , ''' has no revision string') infoPrintCR. |
191
ebdb455a26ce
take revision if no binaryRevision is available (in sourceStream for ...)
ca
parents:
187
diff
changeset
|
827 |
^ nil. |
ebdb455a26ce
take revision if no binaryRevision is available (in sourceStream for ...)
ca
parents:
187
diff
changeset
|
828 |
]. |
535 | 829 |
('SourceCodeManager [info]: trusting classes revision ...') infoPrintCR. |
179 | 830 |
] |
83
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
831 |
] ifFalse:[ |
179 | 832 |
revision := aRevisionStringOrNil |
58 | 833 |
]. |
834 |
||
95 | 835 |
sourceInfo := self sourceInfoOfClass:aClass. |
836 |
sourceInfo isNil ifTrue:[^ nil]. |
|
58 | 837 |
|
179 | 838 |
packageDir := self packageFromSourceInfo:sourceInfo. |
839 |
moduleDir := self moduleFromSourceInfo:sourceInfo. "/ use the modules name as CVS module |
|
840 |
classFileName := self containerFromSourceInfo:sourceInfo. |
|
58 | 841 |
|
842 |
^ self |
|
179 | 843 |
streamForClass:aClass |
844 |
fileName:classFileName |
|
845 |
revision:revision |
|
846 |
directory:packageDir |
|
847 |
module:moduleDir |
|
848 |
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
|
849 |
|
493
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
850 |
"Created: 12.10.1996 / 17:21:52 / cg" |
535 | 851 |
"Modified: 10.1.1997 / 15:13:32 / cg" |
58 | 852 |
! ! |
853 |
||
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
854 |
!AbstractSourceCodeManager class methodsFor:'source code administration'! |
59
3bb0b97dffa2
reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents:
58
diff
changeset
|
855 |
|
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
856 |
initialRCSRevisionStringFor:aClass in:dir container:fileName |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
857 |
"return a string usable as initial revision string" |
122
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
858 |
|
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
859 |
"/ do not make the string below into one string; |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
860 |
"/ RCS would expand it into a wrong rev-string |
122
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
861 |
|
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
862 |
|nm oldRev idx special| |
472 | 863 |
|
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
864 |
nm := fileName. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
865 |
(nm endsWith:',v') ifTrue:[ |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
866 |
nm := nm copyWithoutLast:2 |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
867 |
]. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
868 |
(nm endsWith:'.st') ifFalse:[ |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
869 |
nm := nm , '.st' |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
870 |
]. |
122
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
871 |
|
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
872 |
oldRev := aClass revisionString. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
873 |
special := ''. |
122
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
874 |
|
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
875 |
oldRev notNil ifTrue:[ |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
876 |
idx := oldRev lastIndexOf:$[. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
877 |
idx ~~ 0 ifTrue:[ |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
878 |
idx := oldRev indexOf:$[ startingAt:idx+1. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
879 |
idx ~~ 0 ifTrue:[ |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
880 |
special := ' ' , (oldRev copyFrom:idx). |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
881 |
] |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
882 |
] |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
883 |
]. |
122
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
884 |
|
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
885 |
|
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
886 |
^ '$' , 'Header: ' , dir , '/' , fileName , ',v $' |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
887 |
, special |
472 | 888 |
|
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
889 |
"Modified: 17.9.1996 / 15:57:15 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
890 |
"Created: 14.2.1997 / 20:59:28 / cg" |
122
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
891 |
! |
4dd60cb14bc6
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
121
diff
changeset
|
892 |
|
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
893 |
newestRevisionInFile:classFileName directory:packageDir module:moduleDir |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
894 |
"return the newest revision found in a container. |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
895 |
Return nil on failure." |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
896 |
|
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
897 |
|log| |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
898 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
899 |
log := self |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
900 |
revisionLogOf:nil |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
901 |
fromRevision:0 |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
902 |
toRevision:0 |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
903 |
fileName:classFileName |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
904 |
directory:packageDir |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
905 |
module:moduleDir. |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
906 |
|
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
907 |
log isNil ifTrue:[^ nil]. |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
908 |
^ log at:#newestRevision ifAbsent:nil |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
909 |
|
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
910 |
" |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
911 |
SourceCodeManager newestRevisionInFile:'Array.st' directory:'libbasic' module:'stx' |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
912 |
" |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
913 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
914 |
"Modified: 10.1.1997 / 13:31:42 / cg" |
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
915 |
! |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
916 |
|
207
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
917 |
newestRevisionOf:aClass |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
918 |
"return the newest revision (as string) found in the repository. |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
919 |
Return nil on failure." |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
920 |
|
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
921 |
|log| |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
922 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
923 |
log := self revisionLogOf:aClass fromRevision:0 toRevision:0. |
207
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
924 |
log isNil ifTrue:[^ nil]. |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
925 |
^ log at:#newestRevision ifAbsent:nil |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
926 |
|
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
927 |
" |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
928 |
SourceCodeManager newestRevisionOf:Array |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
929 |
SourceCodeManager newestRevisionOf:Connection |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
930 |
" |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
931 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
932 |
"Modified: 10.1.1997 / 13:30:36 / cg" |
207
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
933 |
! |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
934 |
|
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
935 |
revisionLogInFile:classFileName directory:packageDir module:moduleDir |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
936 |
"return info about the repository container and |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
937 |
(part of) the revisionlog as a collection of revision entries. |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
938 |
Return nil on failure. |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
939 |
|
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
940 |
The returned information is a structure (IdentityDictionary) |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
941 |
filled with: |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
942 |
#container -> the RCS container file name |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
943 |
#filename -> the actual source file name |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
944 |
#newestRevision -> the revisionString of the newest revision |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
945 |
#numberOfRevisions -> the number of revisions in the container |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
946 |
#revisions -> collection of per-revision info (see below) |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
947 |
|
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
948 |
per revision info consists of one record per revision: |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
949 |
|
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
950 |
#revision -> the revision string |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
951 |
#author -> who checked that revision into the repository |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
952 |
#date -> when was it checked in |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
953 |
#state -> the RCS state |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
954 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
955 |
|
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
956 |
revisions are ordered newest first |
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
957 |
(i.e. the last entry is for the initial revision; |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
958 |
the first for the most recent one) |
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
959 |
" |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
960 |
|
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
961 |
^ self |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
962 |
revisionLogOf:nil |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
963 |
fromRevision:nil |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
964 |
toRevision:nil |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
965 |
fileName:classFileName |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
966 |
directory:packageDir |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
967 |
module:moduleDir |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
968 |
|
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
969 |
" |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
970 |
CVSSourceCodeManager |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
971 |
revisionLogInFile:'Array.st' directory:'libbasic' module:'stx' |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
972 |
" |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
973 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
974 |
"Modified: 10.1.1997 / 13:29:06 / cg" |
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
975 |
! |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
976 |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
977 |
revisionLogOf:aClass |
95 | 978 |
"return info about the repository container and |
979 |
the revisionlog as a collection of revision entries. |
|
980 |
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
|
981 |
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
|
982 |
filled with: |
95 | 983 |
#container -> the RCS container file name |
984 |
#filename -> the actual source file name |
|
985 |
#newestRevision -> the revisionString of the newest revision |
|
986 |
#numberOfRevisions -> the number of revisions in the container |
|
987 |
#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
|
988 |
|
95 | 989 |
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
|
990 |
|
95 | 991 |
#revision -> the revision string |
992 |
#author -> who checked that revision into the repository |
|
993 |
#date -> when was it checked in |
|
994 |
#state -> the RCS state |
|
995 |
#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
|
996 |
|
95 | 997 |
revisions are ordered newest first |
998 |
(i.e. the last entry is for the initial revision; the first for the most recent one) |
|
999 |
" |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1000 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1001 |
^ self |
95 | 1002 |
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
|
1003 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1004 |
" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1005 |
SourceCodeManager revisionLogOf:Array |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1006 |
" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1007 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1008 |
"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
|
1009 |
"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
|
1010 |
! |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1011 |
|
110 | 1012 |
revisionLogOf:aClass fromRevision:rev1 |
1013 |
"return info about the repository container and |
|
1014 |
(part of) the revisionlog as a collection of revision entries. |
|
1015 |
Return nil on failure. |
|
1016 |
||
1017 |
The returned information is a structure (IdentityDictionary) |
|
1018 |
filled with: |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1019 |
#container -> the RCS container file name |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1020 |
#filename -> the actual source file name |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1021 |
#newestRevision -> the revisionString of the newest revision |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1022 |
#numberOfRevisions -> the number of revisions in the container |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1023 |
#revisions -> collection of per-revision info (see below) |
110 | 1024 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1025 |
for some classes, additional info is returned: |
110 | 1026 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1027 |
#renamed -> true if the class has been renamed or copied |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1028 |
and the sourceInfo is from the previous one |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1029 |
#expectedFileName -> the filename we would expect (i.e. for the new class) |
110 | 1030 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1031 |
rev1 specifies from which revisions a logEntry is wanted: |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1032 |
If rev1 is nil, the first revision is the initial revision |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1033 |
otherwise, the log starts with that revision. |
110 | 1034 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1035 |
per revision info consists of one record per revision: |
110 | 1036 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1037 |
#revision -> the revision string |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1038 |
#author -> who checked that revision into the repository |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1039 |
#date -> when was it checked in |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1040 |
#state -> the RCS state |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1041 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
110 | 1042 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1043 |
revisions are ordered newest first |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1044 |
(i.e. the last entry is for the initial revision; |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1045 |
the first for the most recent one) |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1046 |
" |
110 | 1047 |
|
1048 |
^ self revisionLogOf:aClass fromRevision:rev1 toRevision:nil |
|
1049 |
||
1050 |
" |
|
1051 |
SourceCodeManager revisionLogOf:Array fromRevision:'1.40' |
|
1052 |
" |
|
1053 |
||
1054 |
"Created: 6.11.1995 / 18:56:00 / cg" |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1055 |
"Modified: 10.1.1997 / 13:29:50 / cg" |
110 | 1056 |
! |
1057 |
||
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1058 |
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 |
95 | 1059 |
"return info about the repository container and |
1060 |
(part of) the revisionlog as a collection of revision entries. |
|
1061 |
Return nil on failure. |
|
1062 |
||
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1063 |
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
|
1064 |
filled with: |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1065 |
#container -> the RCS container file name |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1066 |
#filename -> the actual source file name |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1067 |
#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
|
1068 |
#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
|
1069 |
#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
|
1070 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1071 |
for some classes, additional info is returned: |
96 | 1072 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1073 |
#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
|
1074 |
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
|
1075 |
#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
|
1076 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1077 |
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
|
1078 |
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
|
1079 |
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
|
1080 |
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
|
1081 |
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
|
1082 |
If both are nil, no logEntries are extracted (i.e. only the header). |
96 | 1083 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1084 |
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
|
1085 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1086 |
#revision -> the revision string |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1087 |
#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
|
1088 |
#date -> when was it checked in |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1089 |
#state -> the RCS state |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1090 |
#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
|
1091 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1092 |
revisions are ordered newest first |
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1093 |
(i.e. the last entry is for the initial revision; |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1094 |
the first for the most recent one) |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1095 |
" |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1096 |
|
501 | 1097 |
|sourceInfo packageDir moduleDir classFileName info| |
95 | 1098 |
|
1099 |
sourceInfo := self sourceInfoOfClass:aClass. |
|
1100 |
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
|
1101 |
|
179 | 1102 |
packageDir := self packageFromSourceInfo:sourceInfo. |
1103 |
moduleDir := self moduleFromSourceInfo:sourceInfo. "/ use the modules name as CVS module |
|
1104 |
classFileName := self containerFromSourceInfo:sourceInfo. |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1105 |
|
96 | 1106 |
info := self |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1107 |
revisionLogOf:aClass |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1108 |
fromRevision:rev1 |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1109 |
toRevision:rev2 |
179 | 1110 |
fileName:classFileName |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1111 |
directory:packageDir |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1112 |
module:moduleDir. |
96 | 1113 |
|
1114 |
info notNil ifTrue:[ |
|
179 | 1115 |
"/ (sourceInfo includesKey:#renamed) ifTrue:[ |
1116 |
"/ info at:#renamed put:(sourceInfo at:#renamed) |
|
1117 |
"/ ]. |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1118 |
(sourceInfo includesKey:#expectedFileName) ifTrue:[ |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1119 |
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
|
1120 |
] |
96 | 1121 |
]. |
1122 |
^ info |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1123 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1124 |
" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1125 |
SourceCodeManager revisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' |
96 | 1126 |
SourceCodeManager revisionLogOf:XtBoxNew |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1127 |
" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1128 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1129 |
"Created: 6.11.1995 / 18:56:00 / cg" |
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
1130 |
"Modified: 10.1.1997 / 13:30:00 / cg" |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1131 |
! |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1132 |
|
213 | 1133 |
revisionsOf:aClass |
1134 |
"return a collection of revisions (as strings) found in the repository. |
|
1135 |
The most recent (newest) revision will be the first in the list. |
|
1136 |
Return nil on failure." |
|
1137 |
||
1138 |
|log revisions| |
|
1139 |
||
1140 |
log := self revisionLogOf:aClass. |
|
1141 |
log isNil ifTrue:[^ nil]. |
|
1142 |
revisions := log at:#revisions ifAbsent:nil. |
|
1143 |
revisions isNil ifTrue:[^ nil]. |
|
1144 |
^ revisions collect:[:rev | rev at:#revision]. |
|
1145 |
||
1146 |
" |
|
1147 |
SourceCodeManager revisionsOf:Array |
|
1148 |
SourceCodeManager newestRevisionOf:Array |
|
1149 |
" |
|
1150 |
||
1151 |
"Modified: 10.4.1996 / 23:14:24 / cg" |
|
1152 |
"Created: 19.4.1996 / 17:24:34 / cg" |
|
1153 |
! |
|
1154 |
||
147 | 1155 |
writeHistoryLogSince:timeGoal filterSTSources:filter to:aStream |
472 | 1156 |
"send a repositories historyLog to some stream" |
1157 |
||
147 | 1158 |
self writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:nil to:aStream |
1159 |
||
472 | 1160 |
"Modified: 12.9.1996 / 02:36:32 / cg" |
147 | 1161 |
! |
1162 |
||
1163 |
writeHistoryLogSince:timeGoal to:aStream |
|
472 | 1164 |
"send a repositories historyLog to some stream" |
1165 |
||
147 | 1166 |
self writeHistoryLogSince:timeGoal filterSTSources:true filterUser:nil to:aStream |
1167 |
||
1168 |
"Created: 13.12.1995 / 10:28:27 / cg" |
|
472 | 1169 |
"Modified: 12.9.1996 / 02:36:38 / cg" |
147 | 1170 |
! |
1171 |
||
96 | 1172 |
writeRevisionLogMessagesFrom:log to:aStream |
1173 |
"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
|
1174 |
|
138
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
1175 |
self writeRevisionLogMessagesFrom:log withHeader:true to:aStream |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
1176 |
|
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
1177 |
"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
|
1178 |
! |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
1179 |
|
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
1180 |
writeRevisionLogMessagesFrom:log withHeader:header to:aStream |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
1181 |
"helper; send the revisionlog to aStream" |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
1182 |
|
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
1183 |
header ifTrue:[ |
179 | 1184 |
"/ (log at:#renamed ifAbsent:false) ifTrue:[ |
1185 |
"/ aStream nextPutAll:' Class was probably renamed; revision info is from original class.'. |
|
1186 |
"/ aStream cr; nextPutAll:' You may have to create a new container for it.'. |
|
1187 |
"/ aStream cr; cr. |
|
1188 |
"/ ]. |
|
138
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
1189 |
|
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
1190 |
aStream nextPutAll:' Total revisions: '; nextPutLine:(log at:#numberOfRevisions) printString. |
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
1191 |
aStream nextPutAll:' Newest revision: '; nextPutLine:(log at:#newestRevision) printString. |
96 | 1192 |
]. |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1193 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1194 |
(log at:#revisions) do:[:entry | |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1195 |
|logMsg| |
96 | 1196 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1197 |
aStream cr. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1198 |
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
|
1199 |
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
|
1200 |
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
|
1201 |
aStream cr. |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1202 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1203 |
logMsg := entry at:#logMessage. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1204 |
(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
|
1205 |
logMsg := '*** empty log message ***' |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
1206 |
]. |
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
1207 |
aStream tab; nextPutLine:logMsg. |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1208 |
]. |
96 | 1209 |
|
1210 |
"Created: 16.11.1995 / 13:25:30 / cg" |
|
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
1211 |
"Modified: 8.11.1996 / 23:52:48 / cg" |
73 | 1212 |
! |
1213 |
||
77 | 1214 |
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 to:aStream |
73 | 1215 |
"extract a classes log and append it to aStream." |
1216 |
||
96 | 1217 |
|log | |
73 | 1218 |
|
96 | 1219 |
log := self revisionLogOf:aClass fromRevision:rev1 toRevision:rev2. |
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
1220 |
log isNil ifTrue:[ |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
1221 |
aStream nextPutAll:'** No revision log available **'. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
1222 |
^ false |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
1223 |
]. |
96 | 1224 |
|
1225 |
self writeRevisionLogMessagesFrom:log to:aStream. |
|
1226 |
^ true |
|
73 | 1227 |
|
1228 |
" |
|
77 | 1229 |
SourceCodeManager writeRevisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' to:Transcript |
73 | 1230 |
" |
1231 |
||
1232 |
"Created: 6.11.1995 / 18:56:00 / cg" |
|
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
1233 |
"Modified: 14.2.1997 / 21:11:57 / cg" |
77 | 1234 |
! |
1235 |
||
87 | 1236 |
writeRevisionLogOf:aClass to:aStream |
1237 |
"extract a classes log and append it to aStream." |
|
1238 |
||
1239 |
^ self |
|
1240 |
writeRevisionLogOf:aClass fromRevision:nil toRevision:nil to:aStream |
|
77 | 1241 |
|
87 | 1242 |
" |
1243 |
SourceCodeManager writeRevisionLogOf:Array to:Transcript |
|
1244 |
" |
|
1245 |
! ! |
|
77 | 1246 |
|
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
1247 |
!AbstractSourceCodeManager class methodsFor:'documentation'! |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1248 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
1249 |
version |
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
1250 |
^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.72 1997-01-14 20:24:45 cg Exp $' |
123
9a1dff152656
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
122
diff
changeset
|
1251 |
! ! |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
1252 |
AbstractSourceCodeManager initialize! |