author | Claus Gittinger <cg@exept.de> |
Tue, 25 Feb 2020 12:24:48 +0100 | |
changeset 4559 | e97f85bac732 |
parent 4558 | 3d5a033d3b5d |
permissions | -rw-r--r-- |
4449 | 1 |
"{ Encoding: utf8 }" |
2 |
||
56
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3 |
" |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4 |
COPYRIGHT (c) 1995 by Claus Gittinger |
1863 | 5 |
All Rights Reserved |
56
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6 |
|
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7 |
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
|
8 |
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
|
9 |
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
|
10 |
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
|
11 |
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
|
12 |
hereby transferred. |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
13 |
" |
919 | 14 |
"{ Package: 'stx:libbasic3' }" |
15 |
||
3709
2bbbe39feab4
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3684
diff
changeset
|
16 |
"{ NameSpace: Smalltalk }" |
2bbbe39feab4
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3684
diff
changeset
|
17 |
|
56
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
18 |
Object subclass:#AbstractSourceCodeManager |
4170 | 19 |
instanceVariableNames:'' |
20 |
classVariableNames:'CacheDirectoryName CachingSources DefaultManager ManagerPerModule |
|
21 |
PackagesWithoutExtensionMethodConfirmation |
|
4219 | 22 |
SuppressExtensionMethodConfirmation UseWorkTree Verbose |
23 |
WorkTreeDirectoryName' |
|
4170 | 24 |
poolDictionaries:'' |
25 |
category:'System-SourceCodeManagement' |
|
56
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
26 |
! |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
27 |
|
2445 | 28 |
Object subclass:#PackageAndManager |
4170 | 29 |
instanceVariableNames:'package managerTypeName' |
30 |
classVariableNames:'' |
|
31 |
poolDictionaries:'' |
|
32 |
privateIn:AbstractSourceCodeManager |
|
2445 | 33 |
! |
34 |
||
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
35 |
!AbstractSourceCodeManager class methodsFor:'documentation'! |
56
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
36 |
|
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
37 |
copyright |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
38 |
" |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
39 |
COPYRIGHT (c) 1995 by Claus Gittinger |
1863 | 40 |
All Rights Reserved |
56
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
41 |
|
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
42 |
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
|
43 |
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
|
44 |
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
|
45 |
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
|
46 |
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
|
47 |
hereby transferred. |
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
48 |
" |
71 | 49 |
! |
50 |
||
51 |
documentation |
|
52 |
" |
|
53 |
Abstract superclass for sourceCodeManagers. |
|
2400 | 54 |
|
71 | 55 |
Concrete subclasses provide access to a source repository. |
2400 | 56 |
Most protocol here traps into subclassResponsbility errors. |
71 | 57 |
Please read more documentation in concrete subclasses |
2400 | 58 |
(especially: CVSSourceCodeManager) for how to use this manager and |
59 |
what to redefine in another repository manager if required. |
|
236 | 60 |
|
61 |
[author:] |
|
62 |
Claus Gittinger |
|
71 | 63 |
" |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
64 |
! ! |
56
6705671acee8
source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
65 |
|
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
66 |
!AbstractSourceCodeManager class methodsFor:'initialization'! |
63 | 67 |
|
2647
69c582668ce8
added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents:
2638
diff
changeset
|
68 |
forgetDisabledModules |
4323 | 69 |
"intentionally left blank" |
70 |
||
2647
69c582668ce8
added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents:
2638
diff
changeset
|
71 |
^ self |
4323 | 72 |
|
73 |
"Modified (comment): / 18-05-2018 / 12:37:57 / Stefan Vogel" |
|
2647
69c582668ce8
added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents:
2638
diff
changeset
|
74 |
! |
69c582668ce8
added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents:
2638
diff
changeset
|
75 |
|
63 | 76 |
initCacheDirPath |
472 | 77 |
"initialize the name of the cacheDirectory. |
796 | 78 |
This is: |
2838 | 79 |
<tempDir>/stx_sourceCache (non-UNIX) |
80 |
~/.smalltalk/source-cache (UNIX, as <tempDir> is pruned upon each reboot) |
|
81 |
" |
|
82 |
"JV@2012-03-14: Changed to use .smalltalk/source-cache on UNIX machines" |
|
3976 | 83 |
"CG: why only on unix machines???" |
84 |
||
4010 | 85 |
|dir| |
86 |
||
3976 | 87 |
CachingSources isNil ifTrue:[ |
88 |
CachingSources := true. |
|
89 |
]. |
|
4010 | 90 |
|
91 |
dir := Filename homeDirectory / '.smalltalk/sourceCache'. |
|
92 |
dir isWritableDirectory ifFalse:[ |
|
93 |
dir := Filename defaultTempDirectory / 'stx_sourceCache'. |
|
94 |
]. |
|
95 |
CacheDirectoryName := dir pathName. |
|
96 |
||
97 |
"/ OperatingSystem isUNIXlike ifTrue:[ |
|
98 |
"/ CacheDirectoryName := '~/.smalltalk/sourceCache'. |
|
99 |
"/ ] ifFalse:[ |
|
100 |
"/ CacheDirectoryName := (Filename defaultTempDirectory constructString:'stx_sourceCache'). |
|
101 |
"/ ]. |
|
3976 | 102 |
|
792
901f03b078db
fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents:
769
diff
changeset
|
103 |
" |
2838 | 104 |
self initCacheDirPath |
792
901f03b078db
fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents:
769
diff
changeset
|
105 |
" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
106 |
|
2838 | 107 |
"Modified: / 12-07-1999 / 10:01:31 / cg" |
108 |
"Modified (comment): / 19-07-2012 / 14:03:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
109 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
110 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
111 |
initialize |
4045 | 112 |
"setup for caching and no workTree" |
113 |
||
114 |
CachingSources isNil ifTrue:[CachingSources := true]. |
|
1930 | 115 |
UseWorkTree isNil ifTrue:[UseWorkTree := false]. |
4323 | 116 |
SuppressExtensionMethodConfirmation |
117 |
isNil ifTrue:[SuppressExtensionMethodConfirmation := false]. |
|
3587
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
118 |
|
3976 | 119 |
CachingSources ifTrue:[ |
120 |
self validateCacheDirPath. |
|
121 |
]. |
|
3587
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
122 |
Smalltalk addDependent:self |
2788 | 123 |
|
124 |
"Modified: / 02-03-2012 / 17:00:11 / cg" |
|
4323 | 125 |
"Modified: / 18-05-2018 / 12:40:59 / Stefan Vogel" |
3587
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
126 |
! |
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
127 |
|
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
128 |
update:something with:aParameter from:changedObject |
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
129 |
"flush resources on language changes" |
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
130 |
|
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
131 |
something == #returnFromSnapshot ifTrue:[ |
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
132 |
self validateCacheDirPath |
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
133 |
] |
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
134 |
! |
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
135 |
|
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
136 |
validateCacheDirPath |
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
137 |
(CacheDirectoryName isNil |
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
138 |
or:[CacheDirectoryName asFilename exists not]) ifTrue:[ |
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
139 |
self initCacheDirPath |
bb752772cf70
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3582
diff
changeset
|
140 |
]. |
63 | 141 |
! ! |
142 |
||
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
143 |
!AbstractSourceCodeManager class methodsFor:'accessing'! |
112 | 144 |
|
1729 | 145 |
availableManagers |
3976 | 146 |
^ AbstractSourceCodeManager |
147 |
allSubclasses |
|
4323 | 148 |
reject:[:cls | (cls isAbstract) or:[cls isExperimental]]. |
1729 | 149 |
|
150 |
" |
|
151 |
self availableManagers |
|
152 |
" |
|
4323 | 153 |
|
154 |
"Modified (format): / 18-05-2018 / 12:19:48 / Stefan Vogel" |
|
1729 | 155 |
! |
156 |
||
4291 | 157 |
branchStartTagFor:branchName |
158 |
"this tag is used to tag the original starting point of a branch; |
|
159 |
i.e. the head version from which the branch was created. |
|
160 |
Here, we use <branchTagPrefix><branchName>_0" |
|
161 |
||
162 |
^ (self branchTagFor:branchName),'_0' |
|
163 |
||
164 |
"Created: / 07-12-2017 / 10:23:13 / cg" |
|
165 |
! |
|
166 |
||
167 |
branchTagFor:branchName |
|
168 |
"this tag is used to tag the current branch-head of a branch (or the branch as such); |
|
169 |
i.e. the last version checked onto the branch. |
|
170 |
Here, we use <branchTagPrefix><branchName>" |
|
171 |
||
172 |
^ (self branchTagPrefix),branchName |
|
173 |
||
174 |
"Created: / 07-12-2017 / 10:24:03 / cg" |
|
175 |
! |
|
176 |
||
4275 | 177 |
branchTagPrefix |
178 |
^ 'branch_' |
|
179 |
||
180 |
"Created: / 05-12-2017 / 19:19:39 / cg" |
|
181 |
! |
|
182 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
183 |
cacheDirectoryName |
472 | 184 |
"return the name of the cache directory, where checked out class |
185 |
sources are kept for faster access. The default is '/tmp/stx_sourceCache'. |
|
186 |
This cache is shared among all ST/X users on a system." |
|
187 |
||
3976 | 188 |
self cachingSources ifTrue:[ |
189 |
(CacheDirectoryName isNil) ifTrue:[ |
|
190 |
self initCacheDirPath |
|
191 |
]. |
|
192 |
]. |
|
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
193 |
^ CacheDirectoryName |
472 | 194 |
|
195 |
"Modified: 12.9.1996 / 02:20:45 / cg" |
|
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
196 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
197 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
198 |
cacheDirectoryName:aStringOrFilename |
472 | 199 |
"set the name of the cache directory, where checked out class |
200 |
sources are kept for faster access. The default is '/tmp/stx_sourceCache'. |
|
201 |
This cache is shared among all ST/X users on a system. |
|
3976 | 202 |
The directory is typically set via the launcher's setting menu, |
203 |
or from a startup rc-file." |
|
472 | 204 |
|
2451 | 205 |
CacheDirectoryName := aStringOrFilename. |
206 |
||
207 |
"HACK, HACK, since ManagerPerModule is lazy-initialize before |
|
208 |
preferences are read, sigh. We need a better system..." |
|
209 |
||
210 |
ManagerPerModule := nil. |
|
211 |
||
212 |
"Created: / 16-12-1995 / 15:18:43 / cg" |
|
213 |
"Modified: / 12-09-1996 / 02:21:35 / cg" |
|
214 |
"Modified (comment): / 09-07-2011 / 16:02:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
215 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
216 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
217 |
cachingSources |
472 | 218 |
"return true, if source caching is enabled. |
219 |
(see cacheDirectoryName for what that means)" |
|
220 |
||
3976 | 221 |
^ CachingSources ? false |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
222 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
223 |
"Created: 16.12.1995 / 15:17:50 / cg" |
472 | 224 |
"Modified: 12.9.1996 / 02:22:19 / cg" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
225 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
226 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
227 |
cachingSources:aBoolean |
472 | 228 |
"enable/disable the caching of source files. |
229 |
(see cacheDirectoryName for what that means)" |
|
230 |
||
4046 | 231 |
CachingSources := aBoolean. |
232 |
aBoolean ifTrue:[ |
|
233 |
CacheDirectoryName isNil ifTrue:[ |
|
234 |
self validateCacheDirPath |
|
235 |
]. |
|
236 |
]. |
|
237 |
||
238 |
" |
|
239 |
AbstractSourceCodeManager cachingSources:true |
|
240 |
" |
|
241 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
242 |
"Created: 16.12.1995 / 15:18:13 / cg" |
472 | 243 |
"Modified: 12.9.1996 / 02:22:42 / cg" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
244 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
245 |
|
112 | 246 |
defaultManager |
472 | 247 |
"return the default sourceCodeManager class" |
248 |
||
112 | 249 |
^ DefaultManager |
250 |
||
251 |
"Created: 7.12.1995 / 17:14:22 / cg" |
|
472 | 252 |
"Modified: 12.9.1996 / 02:22:56 / cg" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
253 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
254 |
|
2743 | 255 |
enabledManagers |
256 |
"Return list of source code managers that are enabled" |
|
257 |
||
258 |
"If source code management is disabled, return #(). Following code |
|
259 |
is hack since there is no global boolean flag, sigh" |
|
3976 | 260 |
(Smalltalk at:#SourceCodeManager) isNil ifTrue:[ |
261 |
^ #() |
|
262 |
]. |
|
263 |
^ self availableManagers select:[:manager | manager enabled]. |
|
2743 | 264 |
|
265 |
||
266 |
||
267 |
" |
|
268 |
self enabledManagers |
|
269 |
" |
|
270 |
||
271 |
"Created: / 23-01-2012 / 19:13:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
272 |
! |
|
273 |
||
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
274 |
managerForMatchingModule:aPackageIDMatchString put:aSourceCodeManagerClass |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
275 |
"update the per-module manager definitions, adding a manager class for a matchString" |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
276 |
|
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
277 |
ManagerPerModule isNil ifTrue:[ |
2446 | 278 |
ManagerPerModule := UserPreferences current managerPerMatchingModuleDefinitions. |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
279 |
]. |
2445 | 280 |
ManagerPerModule do:[:each | |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
281 |
|packageMatch| |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
282 |
|
3453 | 283 |
packageMatch := each package. |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
284 |
(packageMatch = aPackageIDMatchString) ifTrue:[ |
2445 | 285 |
each manager:aSourceCodeManagerClass. |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
286 |
^ self |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
287 |
]. |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
288 |
]. |
2445 | 289 |
ManagerPerModule add: |
290 |
(PackageAndManager |
|
291 |
package: aPackageIDMatchString |
|
292 |
manager: aSourceCodeManagerClass) |
|
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
293 |
|
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
294 |
" |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
295 |
self managerForModule:'stx:libbasic2' put:SVNSourceCodeManager |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
296 |
self managerForModule:'stx:libbasic2' put:CVSSourceCodeManager |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
297 |
self managerForModule:'stx:libbasic2' |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
298 |
self managerForModule:'exept:expecco' |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
299 |
" |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
300 |
|
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
301 |
"Created: / 18-04-2011 / 19:48:19 / cg" |
3453 | 302 |
"Modified: / 07-07-2013 / 10:40:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
303 |
! |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
304 |
|
2557 | 305 |
managerForPackage:aPackageID |
306 |
"return the sourceCodeManager for a aPackageID, nil if unspecified in the manager per package list" |
|
307 |
||
2743 | 308 |
"JV@2012-01-23: If source code management is disabled, return nil. Following code |
309 |
is hack since there is no global boolean flag, sigh" |
|
310 |
(Smalltalk at:#SourceCodeManager) isNil ifTrue:[ ^nil ]. |
|
311 |
||
312 |
"JV@2012-01-23: HACK: Q: Shouldn't it filter configured manager through |
|
313 |
'enabled' managers?" |
|
2446 | 314 |
self managerPerMatchingModuleDefinitions do:[:each | |
315 |
(each match:aPackageID) ifTrue:[^ each manager]. |
|
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
316 |
]. |
2603 | 317 |
^ DefaultManager |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
318 |
|
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
319 |
" |
3230
65624c6c84b9
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
3131
diff
changeset
|
320 |
self managerForPackage:'stx:libbasic' |
65624c6c84b9
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
3131
diff
changeset
|
321 |
self managerForPackage:'stx:libbasic2' |
65624c6c84b9
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
3131
diff
changeset
|
322 |
self managerForPackage:'exept:expecco' |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
323 |
" |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
324 |
|
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
325 |
"Created: / 18-04-2011 / 19:39:19 / cg" |
2557 | 326 |
"Created: / 10-10-2011 / 14:50:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2603 | 327 |
"Modified: / 19-10-2011 / 16:45:38 / cg" |
2743 | 328 |
"Modified (comment): / 23-01-2012 / 19:46:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
329 |
! |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
330 |
|
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
331 |
managerPerMatchingModuleDefinitions |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
332 |
"return the sourceCodeManager definitions" |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
333 |
|
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
334 |
ManagerPerModule isNil ifTrue:[ |
2445 | 335 |
ManagerPerModule := UserPreferences current managerPerMatchingModuleDefinitions |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
336 |
]. |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
337 |
^ ManagerPerModule |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
338 |
|
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
339 |
"Created: / 18-04-2011 / 20:09:16 / cg" |
2445 | 340 |
"Modified: / 09-07-2011 / 13:36:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
341 |
! |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
342 |
|
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
343 |
managerPerMatchingModuleDefinitions:aCollection |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
344 |
"set the sourceCodeManager definitions; must be an orderedCollection of packageMatchString -> manager |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
345 |
associations |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
346 |
(not a dictionary, because order is relevant in the matching process, where the first match counts)" |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
347 |
|
2445 | 348 |
ManagerPerModule := aCollection. |
349 |
UserPreferences current managerPerMatchingModuleDefinitions:aCollection |
|
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
350 |
|
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
351 |
"Created: / 18-04-2011 / 20:09:21 / cg" |
2445 | 352 |
"Modified: / 09-07-2011 / 13:36:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
353 |
! |
|
354 |
||
355 |
named: managerTypeName |
|
356 |
||
357 |
^self availableManagers |
|
358 |
detect:[:each|each managerTypeName = managerTypeName] |
|
359 |
ifNone:[nil] |
|
360 |
||
361 |
" |
|
362 |
AbstractSourceCodeManager named: 'CVS' |
|
363 |
AbstractSourceCodeManager named: 'Perforce' |
|
364 |
" |
|
365 |
||
366 |
"Created: / 09-07-2011 / 13:51:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
367 |
! |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
368 |
|
1893 | 369 |
repositoryInfoPerModule |
2145 | 370 |
"return the dictionary, which associates CVSRoots to module names. |
371 |
If no entry is contained in this dictionary for some module, |
|
372 |
the default cvsRoot (CVSRoot) will be used." |
|
373 |
||
374 |
^ #() |
|
1893 | 375 |
|
376 |
"Created: / 09-11-2006 / 15:25:17 / cg" |
|
377 |
! |
|
378 |
||
2199 | 379 |
repositoryInfoPerModule:info |
380 |
"/ ignore here |
|
381 |
! |
|
382 |
||
482
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
383 |
repositoryName |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
384 |
"return the name of the repository. |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
385 |
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
|
386 |
|
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
387 |
^ nil |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
388 |
|
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
389 |
"Modified: 12.9.1996 / 02:20:45 / cg" |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
390 |
"Created: 14.9.1996 / 13:21:37 / cg" |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
391 |
! |
ab073539c01e
allow change of the repository
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
392 |
|
2592 | 393 |
repositoryNameForPackage:packageId |
4275 | 394 |
"Return the repository URL for the given package. |
2668 | 395 |
Used for testing/debugging source code management configuration" |
2592 | 396 |
|
397 |
^ self subclassResponsibility |
|
2565 | 398 |
|
399 |
"Created: / 10-10-2011 / 19:44:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4275 | 400 |
"Modified (comment): / 05-12-2017 / 17:41:57 / cg" |
2565 | 401 |
! |
402 |
||
2700 | 403 |
shownInBrowserMenus |
404 |
"can be redefined in subclasses which can be suppressed in the browser's menus" |
|
405 |
||
2728
362068fc2707
added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents:
2725
diff
changeset
|
406 |
^ UserPreferences current at:(self nameWithoutPrefix,'.enabled') ifAbsent:false. |
362068fc2707
added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents:
2725
diff
changeset
|
407 |
|
2700 | 408 |
"Created: / 08-01-2012 / 19:56:22 / cg" |
409 |
! |
|
410 |
||
2728
362068fc2707
added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents:
2725
diff
changeset
|
411 |
shownInBrowserMenus:aBoolean |
362068fc2707
added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents:
2725
diff
changeset
|
412 |
"can be redefined in subclasses which can be suppressed in the browser's menus" |
362068fc2707
added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents:
2725
diff
changeset
|
413 |
|
362068fc2707
added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents:
2725
diff
changeset
|
414 |
^ UserPreferences current at:(self nameWithoutPrefix,'.enabled') put:aBoolean. |
362068fc2707
added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents:
2725
diff
changeset
|
415 |
|
362068fc2707
added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents:
2725
diff
changeset
|
416 |
"Created: / 15-01-2012 / 14:09:21 / cg" |
362068fc2707
added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents:
2725
diff
changeset
|
417 |
! |
362068fc2707
added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents:
2725
diff
changeset
|
418 |
|
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
419 |
useWorkTree |
472 | 420 |
"return the setting of useWorkTree, which (eventually) |
421 |
controls if an up-to-date view of a CVS working tree should be |
|
422 |
kept in sync. This is not yet implemented." |
|
423 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
424 |
^ UseWorkTree |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
425 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
426 |
"Created: 16.12.1995 / 15:36:48 / cg" |
472 | 427 |
"Modified: 12.9.1996 / 02:24:01 / cg" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
428 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
429 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
430 |
useWorkTree:aBoolean |
472 | 431 |
"enable/disable the useWorkTree feature, which (eventually) |
432 |
controls if an up-to-date view of a CVS working tree should be |
|
433 |
kept in sync. This is not yet implemented." |
|
434 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
435 |
UseWorkTree := aBoolean |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
436 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
437 |
"Created: 16.12.1995 / 15:37:29 / cg" |
472 | 438 |
"Modified: 12.9.1996 / 02:24:38 / cg" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
439 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
440 |
|
2557 | 441 |
utilities |
2936
f45a9345a85f
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2926
diff
changeset
|
442 |
"Returns a 'utilities' object that can be used by tools. |
2557 | 443 |
|
444 |
By default, it returns an instance of |
|
445 |
SourceCodeManagerUtilities with receiver as its |
|
446 |
manager, but individual managers may override this |
|
447 |
method and supply its own, customized utilities." |
|
448 |
||
2851
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
449 |
^ (self isContainerBased |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
450 |
ifTrue: [ SourceCodeManagerUtilitiesForContainerBasedManagers ] |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
451 |
ifFalse: [ SourceCodeManagerUtilitiesForWorkspaceBasedManagers ] |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
452 |
) forManager: self |
2557 | 453 |
|
2936
f45a9345a85f
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2926
diff
changeset
|
454 |
" |
f45a9345a85f
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2926
diff
changeset
|
455 |
SourceCodeManager defaultManager |
f45a9345a85f
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2926
diff
changeset
|
456 |
SourceCodeManager defaultManager utilities |
f45a9345a85f
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2926
diff
changeset
|
457 |
" |
f45a9345a85f
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2926
diff
changeset
|
458 |
|
2557 | 459 |
"Created: / 10-10-2011 / 15:10:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2851
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
460 |
"Modified (format): / 25-07-2012 / 17:08:05 / cg" |
2557 | 461 |
! |
462 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
463 |
workTreeDirectoryName |
472 | 464 |
"return the name of the workTree, which is kept in sync |
465 |
with the current class versions. This is not yet implemented" |
|
466 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
467 |
^ WorkTreeDirectoryName |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
468 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
469 |
"Created: 16.12.1995 / 15:35:21 / cg" |
472 | 470 |
"Modified: 12.9.1996 / 02:25:13 / cg" |
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
471 |
! |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
472 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
473 |
workTreeDirectoryName:aStringOrFilename |
472 | 474 |
"set the name of the workTree, which is kept in sync |
475 |
with the current class versions. This is not yet implemented" |
|
476 |
||
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
477 |
WorkTreeDirectoryName := aStringOrFilename |
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
478 |
|
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
479 |
"Created: 16.12.1995 / 15:35:34 / cg" |
472 | 480 |
"Modified: 12.9.1996 / 02:25:19 / cg" |
112 | 481 |
! ! |
482 |
||
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
483 |
!AbstractSourceCodeManager class methodsFor:'basic access'! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
484 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
485 |
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
|
486 |
"checkin of a class into the source repository. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
487 |
Return true if ok, false if not." |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
488 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
489 |
^ self subclassResponsibility. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
490 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
491 |
"Created: 14.2.1997 / 21:17:33 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
492 |
"Modified: 14.2.1997 / 21:18:48 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
493 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
494 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
495 |
checkoutModule:aModule directory:aPackage andDo:aBlock |
759 | 496 |
"check out everything from a package into a temporary directory. |
497 |
Then evaluate aBlock, passing the name of that temp-directory. |
|
498 |
Afterwards, the tempDir is removed. |
|
499 |
Return true, if OK, false if any error occurred." |
|
500 |
||
501 |
^ self subclassResponsibility |
|
502 |
||
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
503 |
"Created: / 23-08-2006 / 14:07:08 / cg" |
759 | 504 |
! |
505 |
||
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
506 |
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
|
507 |
"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
|
508 |
A revision of nil selects the current (in image) revision. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
509 |
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
|
510 |
which itself is extracted from the classes packageString." |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
511 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
512 |
^ self subclassResponsibility |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
513 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
514 |
"Modified: 14.2.1997 / 21:18:35 / cg" |
2202 | 515 |
! |
516 |
||
517 |
streamForExtensionFile:fileName package:package directory:dir module:mod cache:doCache |
|
518 |
|defClass extensionsRevisionString extensionsRevisionInfo rev| |
|
519 |
||
520 |
defClass := ProjectDefinition definitionClassForPackage:package. |
|
521 |
extensionsRevisionString := defClass perform:(self nameOfVersionMethodForExtensions) ifNotUnderstood:nil. |
|
522 |
extensionsRevisionString isNil ifTrue:[ |
|
3385
b4a3a5381e7c
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3371
diff
changeset
|
523 |
Transcript showCR:'SourceCodeManager [warning]: no valid version info for extensions of "',package,'"'. |
2202 | 524 |
^ self streamForClass:nil fileName:fileName revision:nil directory:dir module:mod cache:false. |
525 |
]. |
|
526 |
||
2399
2b84464f1d41
changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
527 |
extensionsRevisionInfo := self revisionInfoFromString:extensionsRevisionString inClass:nil. |
2b84464f1d41
changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
528 |
extensionsRevisionInfo isNil ifTrue:[ |
3961 | 529 |
self halt:('oops - possibly corrupted extensions version string: "%1" in class %2' bindWith:extensionsRevisionString with:defClass name). |
2399
2b84464f1d41
changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
530 |
"/ check for umlaut-remover/adder bug from felix in extensionsRevisionString !!!!!!!! |
2b84464f1d41
changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
531 |
^ self streamForClass:nil fileName:fileName revision:nil directory:dir module:mod cache:false. |
2b84464f1d41
changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
532 |
]. |
2202 | 533 |
|
534 |
self assert:(fileName = 'extensions.st'). |
|
535 |
self assert:(fileName = extensionsRevisionInfo fileName). |
|
536 |
||
537 |
rev := extensionsRevisionInfo revision. |
|
538 |
^ self streamForClass:nil fileName:fileName revision:rev directory:dir module:mod cache:doCache. |
|
2399
2b84464f1d41
changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
539 |
|
2b84464f1d41
changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
540 |
"Modified: / 01-07-2011 / 13:52:38 / cg" |
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
541 |
! ! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
542 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
543 |
!AbstractSourceCodeManager class methodsFor:'basic administration'! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
544 |
|
4219 | 545 |
checkForExistingContainer:fileName inModule:moduleName directory:packageDirName |
546 |
"check for a container to be present. Return a boolean result." |
|
1786 | 547 |
|
548 |
^ self subclassResponsibility. |
|
549 |
||
550 |
"Created: / 13-09-2006 / 18:22:24 / cg" |
|
4219 | 551 |
"Modified (format): / 24-02-2017 / 11:32:46 / cg" |
552 |
! |
|
553 |
||
554 |
checkForExistingContainer:fileName inModule:moduleName directory:packageDirName warn:doWarn |
|
555 |
"check for a container to be present. Return a boolean result." |
|
556 |
||
557 |
|ok| |
|
558 |
||
559 |
ok := self checkForExistingContainer:fileName inModule:moduleName directory:packageDirName. |
|
560 |
ok ifFalse:[ |
|
561 |
self warn:( |
|
562 |
'Could not find/access the container for %1:%2/%3 in the %4 repository. |
|
563 |
||
564 |
This could be due to: |
|
565 |
- invalid/wrong configuration/settings |
|
566 |
- missing access rights (no access / not logged in) |
|
567 |
- changed the SCM after compilation (i.e. wrong SCM-path in version method) |
|
568 |
' |
|
569 |
bindWith:(moduleName ? '?') |
|
570 |
with:(packageDirName ? '?') |
|
571 |
with:(fileName ? '?') |
|
572 |
with:(self managerTypeName)). |
|
573 |
^ false |
|
574 |
]. |
|
575 |
^ ok |
|
576 |
||
577 |
"Created: / 24-02-2017 / 11:38:00 / cg" |
|
1786 | 578 |
! |
579 |
||
1785 | 580 |
checkForExistingContainer:fileName inPackage:aPackage |
581 |
"check if a source-code container is present in a packages directory." |
|
582 |
||
583 |
|packageDir moduleDir| |
|
584 |
||
585 |
packageDir := aPackage asPackageId directory. |
|
586 |
moduleDir := aPackage asPackageId module. |
|
587 |
||
588 |
^ self |
|
1786 | 589 |
checkForExistingContainer:fileName |
590 |
inModule:moduleDir |
|
591 |
directory:packageDir |
|
1785 | 592 |
|
593 |
"Created: / 13-09-2006 / 18:10:30 / cg" |
|
594 |
! |
|
595 |
||
674
5d660e2bae10
added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
596 |
checkForExistingContainerForClass:aClass |
1013 | 597 |
"check if a source-code container for a given class is present in the repository." |
598 |
||
674
5d660e2bae10
added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
599 |
|sourceInfo packageDir moduleDir classFileName| |
5d660e2bae10
added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
600 |
|
5d660e2bae10
added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
601 |
sourceInfo := self sourceInfoOfClass:aClass. |
5d660e2bae10
added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
602 |
sourceInfo isNil ifTrue:[ |
5d660e2bae10
added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
603 |
('SourceCodeManager [warning]: no sourceInfo for class: ' , aClass name) errorPrintCR. |
5d660e2bae10
added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
604 |
^ false |
5d660e2bae10
added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
605 |
]. |
5d660e2bae10
added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
606 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
607 |
packageDir := self directoryFromSourceInfo:sourceInfo. |
674
5d660e2bae10
added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
608 |
moduleDir := self moduleFromSourceInfo:sourceInfo. "/ use the modules name as CVS module |
5d660e2bae10
added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
609 |
classFileName := self containerFromSourceInfo:sourceInfo. |
5d660e2bae10
added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents:
636
diff
changeset
|
610 |
|
1786 | 611 |
^ self |
612 |
checkForExistingContainer:classFileName |
|
613 |
inModule:moduleDir |
|
614 |
directory:packageDir |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
615 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
616 |
"Created: / 13-05-1998 / 22:35:50 / cg" |
1786 | 617 |
"Modified: / 13-09-2006 / 18:23:20 / cg" |
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
618 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
619 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
620 |
checkForExistingModule:moduleName |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
621 |
"check for a module directory to be present" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
622 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
623 |
^ self subclassResponsibility. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
624 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
625 |
"Created: 9.12.1995 / 19:02:23 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
626 |
"Modified: 14.2.1997 / 21:19:01 / cg" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
627 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
628 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
629 |
checkForExistingModule:moduleDir directory:packageDir |
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
630 |
"check for a package directory to be present" |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
631 |
|
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
632 |
^ self subclassResponsibility. |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
633 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
634 |
"Created: / 23-08-2006 / 14:03:06 / cg" |
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
635 |
! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
636 |
|
966 | 637 |
createContainerFor:aClass inModule:moduleName directory:dirName container:fileName |
638 |
"create a new container & check into it an initial version of aClass" |
|
639 |
||
640 |
^ self subclassResponsibility. |
|
641 |
||
642 |
"Created: 9.12.1995 / 19:02:47 / cg" |
|
643 |
"Modified: 14.2.1997 / 21:19:11 / cg" |
|
644 |
! |
|
645 |
||
2842
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
646 |
createContainerFor:cls inModule:moduleName package:packageDir container:classFileName |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
647 |
"create a new container & check into it an initial version of aClass" |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
648 |
|
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
649 |
^ self checkinClass:cls fileName:classFileName directory:packageDir module:moduleName logMessage:'Initial check in' force:false. |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
650 |
|
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
651 |
"Created: / 23-07-2012 / 19:14:34 / cg" |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
652 |
! |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
653 |
|
966 | 654 |
createModule:moduleName |
655 |
"create a new module directory" |
|
656 |
||
657 |
^ self subclassResponsibility. |
|
658 |
||
659 |
"Created: 9.12.1995 / 19:02:23 / cg" |
|
660 |
"Modified: 14.2.1997 / 21:19:16 / cg" |
|
661 |
! |
|
662 |
||
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
663 |
createModule:module directory:directory |
966 | 664 |
"create a new package directory" |
665 |
||
666 |
^ self subclassResponsibility. |
|
667 |
||
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
668 |
"Created: / 23-08-2006 / 14:04:41 / cg" |
966 | 669 |
! |
670 |
||
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
671 |
initialRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName |
966 | 672 |
"return a string usable as initial revision string" |
673 |
||
674 |
^ self subclassResponsibility |
|
675 |
||
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
676 |
"Created: / 23-08-2006 / 14:05:42 / cg" |
966 | 677 |
! |
678 |
||
3597
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
679 |
revisionLogOf:clsOrNil |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
680 |
fromRevision:firstRev toRevision:lastRef |
4427 | 681 |
fileName:classFileName directory:packageDirOrNil module:moduleDir |
3597
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
682 |
|
2052
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
683 |
^ self |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
684 |
revisionLogOf:clsOrNil |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
685 |
fromRevision:firstRev |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
686 |
toRevision:lastRef |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
687 |
numberOfRevisions:nil |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
688 |
fileName:classFileName |
4427 | 689 |
directory:packageDirOrNil |
2052
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
690 |
module:moduleDir |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
691 |
! |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
692 |
|
3597
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
693 |
revisionLogOf:clsOrNil |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
694 |
fromRevision:rev1OrNil toRevision:rev2OrNil numberOfRevisions:limitOrNil |
4453 | 695 |
fileName:classFileName directory:packageDirOrNil module:moduleDirOrNil |
3597
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
696 |
|
3484
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
697 |
"Return info about the repository container and (part of) the revisionlog as a collection |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
698 |
of revision entries. Return nil on failure. |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
699 |
|
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
700 |
This must be implemented by a concrete source-code manager |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
701 |
|
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
702 |
If numRevisionsOrNil is notNil, it limits the number of revision records returned - |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
703 |
only numRevions of the newest revision infos will be collected. |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
704 |
|
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
705 |
The returned information is a structure (IdentityDictionary) |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
706 |
filled with: |
4158 | 707 |
#container -> the container file name (for container-based SCMs) |
3484
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
708 |
#cvsRoot -> the CVS root (repository) |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
709 |
#filename -> the actual source file name |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
710 |
#newestRevision -> the revisionString of the newest revision |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
711 |
#numberOfRevisions -> the number of revisions in the container (nil for all) |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
712 |
#revisions -> collection of per-revision info (see below) |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
713 |
|
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
714 |
firstRevOrNil / lastRevOrNil specify from which revisions a logEntry is wanted: |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
715 |
-If firstRevOrNil is nil, the first revision is the initial revision |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
716 |
otherwise, the log starts with that revision. |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
717 |
-If lastRevOrNil is nil, the last revision is the newest revision |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
718 |
otherwise, the log ends with that revision. |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
719 |
|
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
720 |
-If both are nil, all logEntries are extracted. |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
721 |
-If both are 0 (not nil), no logEntries are extracted (i.e. only the header). |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
722 |
|
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
723 |
per revision info consists of one record per revision: |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
724 |
|
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
725 |
#revision -> the revision string |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
726 |
#author -> who checked that revision into the repository |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
727 |
#date -> when was it checked in |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
728 |
#state -> the RCS state |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
729 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
730 |
#logMessage -> the checkIn log message |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
731 |
|
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
732 |
revisions are ordered newest first |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
733 |
(i.e. the last entry is for the initial revision; the first for the most recent one) |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
734 |
Attention: if state = 'dead' that revision is no longer valid. |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
735 |
" |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
736 |
|
3597
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
737 |
self subclassResponsibility |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
738 |
|
3484
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
739 |
"Created: / 15-11-1995 / 18:12:51 / cg" |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
740 |
"Modified: / 14-02-1997 / 21:14:01 / cg" |
6452f6a97b27
Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3453
diff
changeset
|
741 |
"Modified: / 11-02-2014 / 13:03:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
966 | 742 |
! ! |
743 |
||
744 |
!AbstractSourceCodeManager class methodsFor:'cache administration'! |
|
745 |
||
961
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
746 |
condenseSourceCache |
966 | 747 |
"remove all cached old versions (i.e. leave the newest only)" |
961
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
748 |
|
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
749 |
|extractBaseAndVersion versionIsGreater vsnNumberString baseName| |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
750 |
|
4104 | 751 |
(CacheDirectoryName isNil or:[CacheDirectoryName asFilename isDirectory not]) ifTrue:[ |
3709
2bbbe39feab4
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3684
diff
changeset
|
752 |
^ self |
2bbbe39feab4
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3684
diff
changeset
|
753 |
]. |
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
754 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
755 |
extractBaseAndVersion := |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
756 |
[:filenameString | |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
757 |
|i| |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
758 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
759 |
i := filenameString size. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
760 |
[i > 0 and:[(filenameString at:i) isDigit or:[(filenameString at:i) == $.]]] whileTrue:[ i := i - 1 ]. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
761 |
vsnNumberString := filenameString copyFrom:i + 1. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
762 |
(filenameString at:i) == $_ ifTrue:[i := i - 1]. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
763 |
baseName := filenameString copyTo:i. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
764 |
]. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
765 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
766 |
versionIsGreater := |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
767 |
[:vA :vB | |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
768 |
|seqA seqB sequenceIsGreater| |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
769 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
770 |
seqA := (vA asCollectionOfSubstringsSeparatedBy:$.) collect:[:each | Integer readFrom:each]. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
771 |
seqB := (vB asCollectionOfSubstringsSeparatedBy:$.) collect:[:each | Integer readFrom:each]. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
772 |
sequenceIsGreater := |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
773 |
[:seqA :seqB :index | |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
774 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
775 |
|elA elB| |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
776 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
777 |
elA := seqA at:index. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
778 |
elB := seqB at:index. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
779 |
elA > elB ifTrue:[ |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
780 |
true |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
781 |
] ifFalse:[ |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
782 |
elA < elB ifTrue:[ |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
783 |
false |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
784 |
] ifFalse:[ |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
785 |
sequenceIsGreater value:seqA value:seqB value:index+1. |
961
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
786 |
]. |
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
787 |
]. |
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
788 |
]. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
789 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
790 |
sequenceIsGreater value:seqA value:seqB value:1. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
791 |
]. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
792 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
793 |
CacheDirectoryName asFilename withAllDirectoriesDo:[:d | |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
794 |
|allFiles newestVersions| |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
795 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
796 |
newestVersions := Dictionary new. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
797 |
allFiles := d files. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
798 |
allFiles do:[:eachFilename | |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
799 |
|prevVsnString| |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
800 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
801 |
extractBaseAndVersion value:eachFilename baseName. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
802 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
803 |
vsnNumberString notEmpty ifTrue:[ |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
804 |
prevVsnString := newestVersions at:baseName ifAbsent:nil. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
805 |
prevVsnString isNil ifTrue:[ |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
806 |
newestVersions at:baseName put:vsnNumberString. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
807 |
] ifFalse:[ |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
808 |
(versionIsGreater value:vsnNumberString value:prevVsnString) ifTrue:[ |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
809 |
newestVersions at:baseName put:vsnNumberString |
961
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
810 |
] |
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
811 |
]. |
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
812 |
]. |
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
813 |
]. |
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
814 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
815 |
allFiles do:[:eachFilename | |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
816 |
extractBaseAndVersion value:eachFilename baseName. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
817 |
(vsnNumberString isEmpty |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
818 |
or:[(vsnNumberString ~= (newestVersions at:baseName))]) ifTrue:[ |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
819 |
eachFilename remove |
961
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
820 |
] |
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
821 |
]. |
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
822 |
] |
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
823 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
824 |
" |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
825 |
self condenseSourceCache |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
826 |
" |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
827 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
828 |
"Modified: / 29-08-2006 / 11:25:25 / cg" |
961
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
829 |
! |
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
830 |
|
966 | 831 |
flushSourceCache |
832 |
"remove all cached versions" |
|
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
833 |
|
961
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
834 |
|d| |
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
835 |
|
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
836 |
CacheDirectoryName notNil ifTrue:[ |
1a99e0289a95
added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
837 |
d := CacheDirectoryName asFilename. |
1860
c092daa2828f
#flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents:
1857
diff
changeset
|
838 |
d isDirectory ifTrue:[ |
c092daa2828f
#flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents:
1857
diff
changeset
|
839 |
d directoryContentsAsFilenames do:[:eachFile | |
c092daa2828f
#flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents:
1857
diff
changeset
|
840 |
eachFile recursiveRemove |
c092daa2828f
#flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents:
1857
diff
changeset
|
841 |
] |
c092daa2828f
#flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents:
1857
diff
changeset
|
842 |
]. |
2550 | 843 |
]. |
844 |
Method flushSourceStreamCache. |
|
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
845 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
846 |
" |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
847 |
self flushSourceCache |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
848 |
" |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
849 |
|
2550 | 850 |
"Modified: / 30-09-2011 / 13:33:33 / cg" |
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
851 |
! ! |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
852 |
|
2866 | 853 |
!AbstractSourceCodeManager class methodsFor:'debugging'! |
854 |
||
855 |
verboseSourceCodeAccess |
|
856 |
^ Verbose ? false |
|
857 |
! |
|
858 |
||
859 |
verboseSourceCodeAccess:aBoolean |
|
860 |
Verbose := aBoolean |
|
861 |
! ! |
|
862 |
||
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
863 |
!AbstractSourceCodeManager class methodsFor:'obsolete backward compatibility'! |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
864 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
865 |
checkForExistingModule:moduleDir package:packageDir |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
866 |
"check for a package directory to be present" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
867 |
|
1881 | 868 |
<resource: #obsolete> |
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
869 |
self obsoleteMethodWarning. |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
870 |
^ self checkForExistingModule:moduleDir directory:packageDir. |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
871 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
872 |
"Created: / 09-12-1995 / 19:02:23 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
873 |
"Modified: / 23-08-2006 / 14:03:25 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
874 |
! |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
875 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
876 |
checkoutModule:aModule package:aPackage andDo:aBlock |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
877 |
"check out everything from a package into a temporary directory. |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
878 |
Then evaluate aBlock, passing the name of that temp-directory. |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
879 |
Afterwards, the tempDir is removed. |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
880 |
Return true, if OK, false if any error occurred." |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
881 |
|
1881 | 882 |
<resource: #obsolete> |
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
883 |
self obsoleteMethodWarning. |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
884 |
^ self checkoutModule:aModule directory:aPackage andDo:aBlock |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
885 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
886 |
"Modified: / 23-08-2006 / 14:07:31 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
887 |
! |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
888 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
889 |
createModule:module package:package |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
890 |
"create a new package directory" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
891 |
|
1881 | 892 |
<resource: #obsolete> |
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
893 |
self obsoleteMethodWarning. |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
894 |
^ self createModule:module directory:package. |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
895 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
896 |
"Created: / 09-12-1995 / 19:02:23 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
897 |
"Modified: / 23-08-2006 / 14:04:59 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
898 |
! |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
899 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
900 |
getExistingContainersInModule:aModule package:aPackage |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
901 |
"{ Pragma: +optSpace }" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
902 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
903 |
"return a collection containing the names of existing containers" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
904 |
|
1881 | 905 |
<resource: #obsolete> |
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
906 |
self obsoleteMethodWarning. |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
907 |
^ self getExistingContainersInModule:aModule directory:aPackage |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
908 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
909 |
"Created: / 20-05-1998 / 19:49:12 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
910 |
"Modified: / 23-08-2006 / 14:12:24 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
911 |
! |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
912 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
913 |
getExistingPackagesInModule:aModule |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
914 |
"{ Pragma: +optSpace }" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
915 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
916 |
"return a collection containing the names of existing packages" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
917 |
|
1881 | 918 |
<resource: #obsolete> |
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
919 |
self obsoleteMethodWarning. |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
920 |
^ self getExistingDirectoriesInModule:aModule |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
921 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
922 |
"Created: / 20-05-1998 / 19:38:34 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
923 |
"Modified: / 23-08-2006 / 14:14:04 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
924 |
! |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
925 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
926 |
initialRevisionStringFor:aClass inModule:moduleDir package:packageDir container:fileName |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
927 |
"return a string usable as initial revision string" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
928 |
|
1881 | 929 |
<resource: #obsolete> |
2649 | 930 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
931 |
self obsoleteMethodWarning. |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
932 |
^ self initialRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
933 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
934 |
"Created: / 14-02-1997 / 21:01:41 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
935 |
"Modified: / 23-08-2006 / 14:06:18 / cg" |
2649 | 936 |
"Modified (format): / 21-12-2011 / 18:58:53 / cg" |
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
937 |
! ! |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
938 |
|
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
939 |
!AbstractSourceCodeManager class methodsFor:'private'! |
71 | 940 |
|
813 | 941 |
checkMethodPackagesOf:aClass |
942 |
"check if aClass contains methods from another package; |
|
943 |
ask if these should be checked in with the class. |
|
830
c788d0c93635
allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
944 |
Raises abortSignal if checkIn is to be suppressed. |
c788d0c93635
allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
945 |
returns: |
c788d0c93635
allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
946 |
#base - only check in methods from the classes package |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
947 |
#all - check in all |
813 | 948 |
|
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
949 |
the old code looked for all extensions, and allowed them to be moved to the base-package. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
950 |
This was dangerous, as if one presses yes too quickly, extensions move to the base too easy. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
951 |
The new code only allows for extensions from the __NOPROJECT__ package to be moved. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
952 |
Extensions always remain extensions, and must be moved by an explicit method-menu action. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
953 |
" |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
954 |
|
4323 | 955 |
|clsPackage otherPackages methodsFromOtherPackages |
956 |
methodCategoriesInOtherPackages msg answer labels actions hasUnassignedExtensions |
|
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
957 |
unassignedMethods methodCategoriesWithUnassignedMethods methodCategoryWithUnassignedMethods |
2975
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
958 |
args anyPackageChange| |
813 | 959 |
|
960 |
clsPackage := aClass package. |
|
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
961 |
|
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
962 |
otherPackages := Set new. |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
963 |
methodsFromOtherPackages := OrderedCollection new. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
964 |
hasUnassignedExtensions := false. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
965 |
unassignedMethods := OrderedCollection new. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
966 |
methodCategoriesWithUnassignedMethods := Set new. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
967 |
methodCategoriesInOtherPackages := Set new. |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
968 |
|
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
969 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
815 | 970 |
|mthdPackage| |
971 |
||
972 |
(mthdPackage := mthd package) ~= clsPackage ifTrue:[ |
|
2240
a9c2f87fbd98
changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents:
2238
diff
changeset
|
973 |
mthdPackage = PackageId noProjectID ifTrue:[ |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
974 |
hasUnassignedExtensions := true. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
975 |
unassignedMethods add:mthd. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
976 |
methodCategoriesWithUnassignedMethods add:(mthd category). |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
977 |
] ifFalse:[ |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
978 |
methodsFromOtherPackages add:mthd. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
979 |
otherPackages add:mthdPackage. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
980 |
methodCategoriesInOtherPackages add:(mthd category). |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
981 |
]. |
815 | 982 |
] |
983 |
]. |
|
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
984 |
|
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
985 |
hasUnassignedExtensions ifFalse:[ |
1027
6c93b510b86d
update private class packages
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
986 |
aClass allPrivateClassesDo:[:eachPrivateClass | |
1028 | 987 |
aClass setPackage:clsPackage. |
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
988 |
eachPrivateClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
1027
6c93b510b86d
update private class packages
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
989 |
mthd setPackage:clsPackage |
6c93b510b86d
update private class packages
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
990 |
] |
6c93b510b86d
update private class packages
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
991 |
]. |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
992 |
^ #base |
830
c788d0c93635
allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
993 |
]. |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
994 |
|
1029 | 995 |
otherPackages := otherPackages asOrderedCollection sort. |
4323 | 996 |
|
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
997 |
methodCategoriesWithUnassignedMethods size == 1 ifTrue:[ |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
998 |
methodCategoryWithUnassignedMethods := methodCategoriesWithUnassignedMethods anElement. |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
999 |
]. |
1066
683643ad5544
better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents:
1060
diff
changeset
|
1000 |
|
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1001 |
(SourceCodeManagerUtilities yesToAllNotification notNil |
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1002 |
and:[SourceCodeManagerUtilities yesToAllNotification isHandled]) ifTrue:[ |
4323 | 1003 |
answer := true. |
830
c788d0c93635
allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
1004 |
] ifFalse:[ |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1005 |
methodCategoriesWithUnassignedMethods size == 1 ifTrue:[ |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1006 |
unassignedMethods size == 1 ifTrue:[ |
1520 | 1007 |
msg := 'The class ''%1'' contains the unassigned (loose) method: %6'. |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1008 |
] ifFalse:[ |
1520 | 1009 |
msg := 'The class ''%1'' contains %3 unassigned (loose) method(s)'. |
2468 | 1010 |
]. |
1011 |
msg := msg , '\(In the ''%4'' category).'. |
|
1016 | 1012 |
] ifFalse:[ |
1520 | 1013 |
msg := 'The class ''%1'' contains %3 unassigned (loose) methods in %5 categories.'. |
1016 | 1014 |
]. |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1015 |
unassignedMethods size == 1 ifTrue:[ |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1016 |
msg := msg , '\\Move this method to the ''%2'' package ?'. |
1550 | 1017 |
msg := msg , '\\Hint: if this is meant to be an extension of another package,\move it to the appropriate package and checkIn the extension(s).'. |
1066
683643ad5544
better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents:
1060
diff
changeset
|
1018 |
] ifFalse:[ |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1019 |
msg := msg , '\\Move those to the ''%2'' package ?'. |
1550 | 1020 |
msg := msg , '\\Hint: if these are meant to be extensions of another package,\move them to the appropriate package and checkIn the extensions.'. |
1066
683643ad5544
better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents:
1060
diff
changeset
|
1021 |
]. |
1550 | 1022 |
|
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1023 |
args := Array |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1024 |
with:aClass name allBold |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1025 |
with:clsPackage allBold |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1026 |
with:unassignedMethods size |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1027 |
with:methodCategoryWithUnassignedMethods |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1028 |
with:methodCategoriesWithUnassignedMethods size |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1029 |
with:unassignedMethods first selector allBold. |
1016 | 1030 |
|
1036 | 1031 |
SourceCodeManagerUtilities yesToAllNotification isHandled |
1032 |
ifTrue:[ |
|
3684
7f6dc6208ae7
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3673
diff
changeset
|
1033 |
labels := #('Cancel' 'No' 'Browse' 'Yes to All' 'Yes'). |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1034 |
actions := #(#cancel false #browse #yesToAll true). |
1036 | 1035 |
] ifFalse:[ |
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1036 |
labels := #('Cancel' 'No' 'Browse' 'Yes'). |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1037 |
actions := #(#cancel false #browse true). |
1036 | 1038 |
]. |
1039 |
||
4323 | 1040 |
(SuppressExtensionMethodConfirmation |
1041 |
or:[ self isPackageWithoutExtensionMethodConfirmation:aClass package]) |
|
4119 | 1042 |
ifTrue:[ |
1043 |
answer := true |
|
1044 |
] ifFalse:[ |
|
1045 |
Dialog |
|
1046 |
withOptoutOption:[ self rememberPackageWithoutExtensionMethodConfirmation:aClass package ] |
|
1047 |
labelled:(SystemBrowser classResources string:'Do not show this dialog again (for this package)') |
|
4133 | 1048 |
andOptoutOption:[ SuppressExtensionMethodConfirmation := true ] |
1049 |
labelled:(SystemBrowser classResources string:'Do not show this dialog again (for any package)') |
|
4119 | 1050 |
do:[ |
1051 |
answer := OptionBox |
|
1052 |
request:(SystemBrowser classResources |
|
1053 |
stringWithCRs:msg |
|
4345 | 1054 |
withArguments:args) |
4119 | 1055 |
label:'Change packageID ?' |
1056 |
image:(InfoBox iconBitmap) |
|
1057 |
buttonLabels:(Dialog resources array:labels) |
|
1058 |
values:actions |
|
1059 |
default:true. |
|
1060 |
]. |
|
1061 |
]. |
|
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1062 |
answer == #browse ifTrue:[ |
4254 | 1063 |
SystemBrowser default |
2240
a9c2f87fbd98
changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents:
2238
diff
changeset
|
1064 |
browseMethods:unassignedMethods |
a9c2f87fbd98
changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents:
2238
diff
changeset
|
1065 |
title:('Unassigned (loose) Methods in %1' bindWith:aClass name) |
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1066 |
sort:true. |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1067 |
answer := #cancel. |
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1068 |
]. |
2240
a9c2f87fbd98
changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents:
2238
diff
changeset
|
1069 |
"/ answer == #browseExtensions ifTrue:[ |
a9c2f87fbd98
changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents:
2238
diff
changeset
|
1070 |
"/ UserPreferences current systemBrowserClass |
a9c2f87fbd98
changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents:
2238
diff
changeset
|
1071 |
"/ browseMethods:methodsFromOtherPackages |
a9c2f87fbd98
changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents:
2238
diff
changeset
|
1072 |
"/ title:('Extensions for %1' bindWith:aClass name) |
a9c2f87fbd98
changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents:
2238
diff
changeset
|
1073 |
"/ sort:true. |
a9c2f87fbd98
changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents:
2238
diff
changeset
|
1074 |
"/ answer := #cancel. |
a9c2f87fbd98
changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents:
2238
diff
changeset
|
1075 |
"/ ]. |
830
c788d0c93635
allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
1076 |
]. |
c788d0c93635
allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
1077 |
|
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1078 |
answer == #cancel ifTrue:[ |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1079 |
AbortSignal raise |
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1080 |
]. |
1016 | 1081 |
answer == #yesToAll ifTrue:[ |
1082 |
SourceCodeManagerUtilities yesToAllNotification raiseWith:true. |
|
1083 |
answer := true. |
|
1084 |
]. |
|
851
fcf26a083242
better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents:
844
diff
changeset
|
1085 |
|
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1086 |
"/ ok, move them over |
851
fcf26a083242
better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents:
844
diff
changeset
|
1087 |
answer == true ifTrue:[ |
830
c788d0c93635
allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
1088 |
"/ change all method's packageID to the classes packageId |
2975
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1089 |
anyPackageChange := false. |
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1090 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
2208
a66ff7ef9153
Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents:
2202
diff
changeset
|
1091 |
mthd package == PackageId noProjectID ifTrue:[ |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1092 |
mthd makeLocalStringSource. |
2975
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1093 |
mthd setPackage:clsPackage. |
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1094 |
anyPackageChange := true. |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1095 |
] |
830
c788d0c93635
allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
1096 |
]. |
1027
6c93b510b86d
update private class packages
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1097 |
aClass allPrivateClassesDo:[:eachPrivateClass | |
1028 | 1098 |
aClass setPackage:clsPackage. |
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1099 |
eachPrivateClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
2975
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1100 |
mthd package ~= clsPackage ifTrue:[ |
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1101 |
mthd makeLocalStringSource. |
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1102 |
mthd setPackage:clsPackage. |
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1103 |
anyPackageChange := true. |
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1104 |
] |
1027
6c93b510b86d
update private class packages
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1105 |
] |
6c93b510b86d
update private class packages
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1106 |
]. |
2975
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1107 |
anyPackageChange ifTrue:[ |
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1108 |
aClass changed:#projectOrganization. |
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1109 |
Smalltalk changed:#projectOrganization with:(Array with:aClass). |
90f3c278d6d8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2937
diff
changeset
|
1110 |
]. |
813 | 1111 |
]. |
1518
c6b1f8da85f2
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1499
diff
changeset
|
1112 |
^ #base |
1112
c395948357d3
care for userPref-browser-setting (in browse-action)
Claus Gittinger <cg@exept.de>
parents:
1091
diff
changeset
|
1113 |
|
4254 | 1114 |
"Modified: / 01-09-2017 / 14:19:53 / cg" |
4323 | 1115 |
"Modified: / 18-05-2018 / 12:46:11 / Stefan Vogel" |
4345 | 1116 |
"Modified: / 09-08-2018 / 14:57:08 / Claus Gittinger" |
813 | 1117 |
! |
1118 |
||
3453 | 1119 |
checkTabSpaceConventionIn: aStream |
1120 |
"This method checks whether data in given stream follows |
|
1121 |
tab-space discipline. |
|
1122 |
||
1123 |
More precisely, this checks that each line starts with zero or more |
|
1124 |
tabs (16r9) followed by 0-7 spaces (16r32) followed by non-space non-tab |
|
1125 |
character. |
|
3510
b3f273c8ce01
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3484
diff
changeset
|
1126 |
This is done for two reasons: |
b3f273c8ce01
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3484
diff
changeset
|
1127 |
1) Makefiles (and Make.proto/Make.spec) files MUST not have leading spaces in their rules, but tabs. |
b3f273c8ce01
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3484
diff
changeset
|
1128 |
otherwise, make fails badly. |
b3f273c8ce01
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3484
diff
changeset
|
1129 |
|
b3f273c8ce01
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3484
diff
changeset
|
1130 |
2) for diff-comparison, a consisten tab/space discipline avoids false diff-positivies, which resulted from simple |
b3f273c8ce01
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3484
diff
changeset
|
1131 |
edititing with different editors with different tab conventions. |
3453 | 1132 |
" |
1133 |
||
1134 |
| checkStream | |
|
1135 |
||
1136 |
aStream isFileStream ifTrue:[ |
|
1137 |
aStream flush. |
|
4323 | 1138 |
checkStream := aStream pathName asFilename readStream. |
3453 | 1139 |
] ifFalse:[ |
4323 | 1140 |
aStream isExternalStream ifFalse:[ |
3453 | 1141 |
checkStream := aStream contents asString readStream. |
1142 |
]. |
|
1143 |
]. |
|
1144 |
[ |
|
1145 |
[ checkStream atEnd ] whileFalse:[ |
|
1146 |
| line done nspaces | |
|
1147 |
||
1148 |
nspaces := 0. |
|
1149 |
line := checkStream nextLine readStream. |
|
1150 |
done := line atEnd. |
|
1151 |
[ done ] whileFalse:[ |
|
1152 |
| c | |
|
1153 |
||
1154 |
c := line next. |
|
1155 |
c == Character space ifTrue:[ |
|
1156 |
nspaces := nspaces + 1. |
|
1157 |
nspaces == 8 ifTrue:[ |
|
1158 |
"/ self breakPoint: #jv info: 'Oops, every consecutive 8 spaces should be a tab!! CHECK THE CALLER NOW!!!!!!'. |
|
1159 |
"/ |
|
1160 |
"/ There are only two solutions: either (i) relax the rule and do not make any conversion |
|
1161 |
"/ (ii) or write a sed script to fix all sources, commit and then debug why it is so, |
|
1162 |
"/ Otherwise, we merging will forever be pain in the... |
|
1163 |
self breakPoint: #cg info: 'Oops, every consecutive 8 spaces should be a tab!! CHECK THE CALLER NOW!!!!!!'. |
|
1164 |
]. |
|
1165 |
]. |
|
1166 |
c == Character tab ifTrue:[ |
|
1167 |
nspaces ~~ 0 ifTrue:[ |
|
1168 |
"/ self breakPoint: #jv info: 'Oops, spaces followed by tab!! CHECK THE CALLER NOW!!!!!!'. |
|
1169 |
||
1170 |
"/ There are only two solutions: either (i) relax the rule and do not make any conversion |
|
1171 |
"/ (ii) or write a sed script to fix all sources, commit and then debug why it is so, |
|
1172 |
"/ Otherwise, we merging will forever be pain in the... |
|
1173 |
self breakPoint: #cg info: 'Oops, spaces followed by tab!! CHECK THE CALLER NOW!!!!!!'. |
|
1174 |
]. |
|
1175 |
]. |
|
1176 |
done := (c ~~ Character space and:[c ~~ Character tab ]) or:[line atEnd]. |
|
1177 |
]. |
|
1178 |
]. |
|
1179 |
] ensure:[ |
|
1180 |
checkStream close. |
|
1181 |
]. |
|
1182 |
||
1183 |
" |
|
1184 |
Good: |
|
1185 |
AbstractSourceCodeManager checkTabSpaceConventionIn: #[9 32 32 32 32 97 ] readStream |
|
1186 |
AbstractSourceCodeManager checkTabSpaceConventionIn: #[97 10 10 10 9 32 32 32 32 97 ] readStream |
|
1187 |
||
1188 |
Bad: |
|
1189 |
AbstractSourceCodeManager checkTabSpaceConventionIn: #[32 32 32 32 32 32 32 32 97 ] readStream |
|
1190 |
AbstractSourceCodeManager checkTabSpaceConventionIn: #[97 10 10 10 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 97 ] readStream |
|
1191 |
AbstractSourceCodeManager checkTabSpaceConventionIn: #[97 10 10 10 9 32 32 32 32 32 32 32 32 97 ] readStream |
|
1192 |
AbstractSourceCodeManager checkTabSpaceConventionIn: #[97 10 10 10 32 32 32 32 9 97 ] readStream |
|
1193 |
||
1194 |
||
1195 |
" |
|
1196 |
||
1197 |
"Created: / 29-11-2013 / 12:01:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1198 |
"Modified (format): / 29-11-2013 / 14:02:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4323 | 1199 |
"Modified: / 18-05-2018 / 12:23:12 / Stefan Vogel" |
3453 | 1200 |
! |
1201 |
||
2173 | 1202 |
compileVersionMethod:methodName of:aClass for:newRevisionString |
1203 |
||
4347 | 1204 |
|cls language mthd code| |
2173 | 1205 |
|
1206 |
cls := aClass theMetaclass. |
|
4347 | 1207 |
language := cls programmingLanguage. |
1208 |
"/ self assert: language isSmalltalk. |
|
1209 |
||
1210 |
code := language methodSourceForVersionMethodCVS:newRevisionString. |
|
1211 |
||
1212 |
mthd := language compilerClass |
|
2227
355f0bf86adc
changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2226
diff
changeset
|
1213 |
compile:code |
355f0bf86adc
changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2226
diff
changeset
|
1214 |
forClass:cls |
355f0bf86adc
changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2226
diff
changeset
|
1215 |
inCategory:#documentation |
355f0bf86adc
changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2226
diff
changeset
|
1216 |
notifying:nil |
355f0bf86adc
changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2226
diff
changeset
|
1217 |
install:true |
355f0bf86adc
changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2226
diff
changeset
|
1218 |
skipIfSame:false |
355f0bf86adc
changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2226
diff
changeset
|
1219 |
silent:true. |
2173 | 1220 |
|
1221 |
mthd notNil ifTrue:[ |
|
1222 |
mthd setPackage:aClass package |
|
1223 |
] |
|
4347 | 1224 |
|
1225 |
"Modified: / 28-08-2018 / 11:56:45 / Claus Gittinger" |
|
2173 | 1226 |
! |
1227 |
||
179 | 1228 |
containerFromSourceInfo:info |
472 | 1229 |
"given a sourceInfo, return the classes container" |
1230 |
||
179 | 1231 |
(info includesKey:#fileName) ifTrue:[ |
1232 |
^ info at:#fileName |
|
1233 |
]. |
|
1234 |
(info includesKey:#expectedFileName) ifTrue:[ |
|
1235 |
^ info at:#expectedFileName |
|
1236 |
]. |
|
1237 |
^ (info at:#classFileNameBase) , '.st' |
|
1238 |
||
472 | 1239 |
"Modified: 12.9.1996 / 02:31:52 / cg" |
179 | 1240 |
! |
1241 |
||
3268 | 1242 |
createTempDirectory:packageDir forModule:moduleDir in:aParentDir |
1243 |
"create a temp directory for checking out" |
|
1244 |
||
1245 |
|tempdir dir| |
|
1246 |
||
1247 |
"/ if CVSTempDir isNil, use current. |
|
1248 |
OsError handle:[:ex | |
|
1249 |
self reportError:('cannot create temporary directory'). |
|
1250 |
^ nil. |
|
1251 |
] do:[ |
|
1252 |
tempdir := Filename newTemporaryDirectoryIn:aParentDir. |
|
1253 |
]. |
|
1254 |
||
1255 |
moduleDir notNil ifTrue:[ |
|
1256 |
dir := tempdir construct:moduleDir. |
|
1257 |
dir makeDirectory. |
|
1258 |
||
1259 |
packageDir notNil ifTrue:[ |
|
1260 |
dir := dir construct:packageDir. |
|
1261 |
dir recursiveMakeDirectory. |
|
1262 |
]. |
|
1263 |
dir exists ifFalse:[ |
|
1264 |
(tempdir construct:moduleDir) recursiveRemove. |
|
1265 |
tempdir recursiveRemove. |
|
1266 |
self reportError:('cannot create temporary directory'). |
|
1267 |
^ nil. |
|
1268 |
]. |
|
1269 |
]. |
|
1270 |
^ tempdir |
|
1271 |
||
1272 |
"self createTempDirectory:'fooPackage' forModule:'fooModule'" |
|
1273 |
||
1274 |
"Created: / 09-12-1995 / 19:14:35 / cg" |
|
1275 |
"Modified: / 19-12-1995 / 16:13:02 / stefan" |
|
1276 |
"Modified: / 29-08-2006 / 13:16:23 / cg" |
|
1277 |
! |
|
1278 |
||
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1279 |
directoryFromContainerPath:containerPath forClass:aClass |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1280 |
"given a full path as in an RCS header, |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1281 |
extract the directory (i.e. package)." |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1282 |
|
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1283 |
^ self directoryFromContainerPath:containerPath forPackage:(aClass package) |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1284 |
|
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1285 |
" |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1286 |
CVSSourceCodeManager directoryFromContainerPath:'/files/CVS/stx/libbasic/Array.st' forClass:Array |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1287 |
" |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1288 |
! |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1289 |
|
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1290 |
directoryFromContainerPath:containerPath forPackage:packageID |
721
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1291 |
"given a full path as in an RCS header, |
4076 | 1292 |
extract the directory (i.e. package) within the module. |
1293 |
Notice: |
|
1294 |
for top-level folder-only modules (like exept, smalltalk), |
|
1295 |
an empty string is returned." |
|
148 | 1296 |
|
96 | 1297 |
|path idx| |
1298 |
||
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1299 |
path := self pathInRepositoryFrom:containerPath forPackage:packageID. |
704 | 1300 |
path isNil ifTrue:[^ nil]. |
1301 |
||
1302 |
"/ these are always UNIX filenames ... |
|
1303 |
idx := path indexOf:$/. |
|
1304 |
idx ~~ 0 ifTrue:[ |
|
4076 | 1305 |
"/ be careful: for top-level module descriptions (folders), |
1306 |
"/ the directory is empty |
|
1307 |
(path indexOf:$/ startingAt:idx+1) == 0 ifTrue:[ |
|
1308 |
"/ there is no directory |
|
1309 |
^ '' |
|
1310 |
]. |
|
704 | 1311 |
path := path copyFrom:(idx + 1) |
96 | 1312 |
]. |
721
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1313 |
|
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1314 |
"/ the code below used to be: |
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1315 |
"/ ^ path asFilename directoryName |
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1316 |
"/ however, that only works under UNIX, since |
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1317 |
"/ we MUST return a unix pathname here. |
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1318 |
"/ therefore, do what unix would do here ... |
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1319 |
|
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1320 |
idx := path lastIndexOf:$/. |
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1321 |
idx == 0 ifTrue:[ |
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1322 |
"/ huh ? |
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1323 |
^ path |
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1324 |
]. |
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1325 |
^ path copyTo:(idx - 1) |
96 | 1326 |
|
1327 |
" |
|
721
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1328 |
CVSSourceCodeManager directoryFromContainerPath:'/files/CVS/stx/libbasic/Array.st' |
96 | 1329 |
" |
1330 |
||
721
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1331 |
"Created: / 25.9.1998 / 15:37:06 / cg" |
5a2a1f8dc18e
always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents:
705
diff
changeset
|
1332 |
"Modified: / 25.9.1998 / 15:38:59 / cg" |
96 | 1333 |
! |
1334 |
||
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
1335 |
directoryFromSourceInfo:info |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
1336 |
"given a sourceInfo, return the classes package directory" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
1337 |
|
2485 | 1338 |
^ info at:#directory ifAbsent:nil. |
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
1339 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
1340 |
"Created: / 23-08-2006 / 14:10:29 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
1341 |
! |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
1342 |
|
4133 | 1343 |
isPackageWithoutExtensionMethodConfirmation:aPackageID |
1344 |
"usually, the checkin dialog asks if unpackaged methods should be moved |
|
1345 |
to the package. |
|
1346 |
This can be suppressed on a per-package base with a checkbox ('do not...again') |
|
1347 |
in the dialog. |
|
1348 |
This method returns true, if this was done for a particular package" |
|
1349 |
||
1350 |
^ PackagesWithoutExtensionMethodConfirmation notNil |
|
1351 |
and:[ PackagesWithoutExtensionMethodConfirmation includes:aPackageID] |
|
1352 |
! |
|
1353 |
||
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1354 |
moduleFromContainerPath:containerPath forClass:aClass |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1355 |
"given a full path as in an RCS header, extract the module." |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1356 |
|
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1357 |
^ self moduleFromContainerPath:containerPath forPackage:aClass package |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1358 |
|
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1359 |
" |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1360 |
SourceCodeManager moduleFromContainerPath:'/files/CVS/stx/libbasic/Array.st' forClass:Array |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1361 |
" |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1362 |
! |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1363 |
|
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1364 |
moduleFromContainerPath:containerPath forPackage:packageID |
148 | 1365 |
"given a full path as in an RCS header, extract the module." |
1366 |
||
96 | 1367 |
|path idx| |
1368 |
||
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1369 |
path := self pathInRepositoryFrom:containerPath forPackage:packageID. |
704 | 1370 |
path isNil ifTrue:[^ nil]. |
1371 |
||
1372 |
"/ these are always UNIX filenames |
|
1373 |
idx := path indexOf:$/. |
|
1374 |
idx == 0 ifTrue:[^ path]. |
|
1375 |
^ path copyTo:(idx - 1) |
|
96 | 1376 |
|
1377 |
" |
|
1378 |
SourceCodeManager moduleFromContainerPath:'/files/CVS/stx/libbasic/Array.st' |
|
1379 |
" |
|
1380 |
||
704 | 1381 |
"Created: / 25.11.1995 / 18:42:20 / cg" |
1382 |
"Modified: / 11.8.1998 / 23:01:24 / cg" |
|
96 | 1383 |
! |
1384 |
||
179 | 1385 |
moduleFromSourceInfo:info |
472 | 1386 |
"given a sourceInfo, return the classes module directory" |
1387 |
||
179 | 1388 |
^ info at:#module. "/ use the modules name as CVS module |
1389 |
||
1390 |
"Created: 6.2.1996 / 17:26:38 / cg" |
|
472 | 1391 |
"Modified: 12.9.1996 / 02:32:23 / cg" |
179 | 1392 |
! |
1393 |
||
1394 |
packageFromSourceInfo:info |
|
472 | 1395 |
"given a sourceInfo, return the classes package directory" |
1396 |
||
1881 | 1397 |
<resource: #obsolete> |
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
1398 |
self obsoleteMethodWarning. |
179 | 1399 |
^ info at:#directory. |
1400 |
||
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
1401 |
"Created: / 06-02-1996 / 17:26:23 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
1402 |
"Modified: / 23-08-2006 / 14:11:18 / cg" |
179 | 1403 |
! |
1404 |
||
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1405 |
pathInRepositoryFrom:containerPath forPackage:packageID |
2915
f0e6c9528a5e
added: #isRevision:sameOfAfter:
Claus Gittinger <cg@exept.de>
parents:
2866
diff
changeset
|
1406 |
"this tries to extract the path within a repository, |
f0e6c9528a5e
added: #isRevision:sameOfAfter:
Claus Gittinger <cg@exept.de>
parents:
2866
diff
changeset
|
1407 |
given some path as present in an RCS Header string. |
148 | 1408 |
Typically, this ought to be that string directly; |
1409 |
however, if the repository directory is accessed via a symbolic link during |
|
1410 |
ci/co, some systems extract different strings with co. |
|
1411 |
One such system here had a symbolic link from /phys/ibm/CVS... to /file/CVS, |
|
1412 |
and extracted sources had /phys/ibm/CVS in their header. |
|
1413 |
Do not depend on the code below to work correctly all the time." |
|
1414 |
||
501 | 1415 |
|top lastTop idx| |
96 | 1416 |
|
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1417 |
containerPath isNil ifTrue:[^ nil]. |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1418 |
|
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1419 |
packageID notNil ifTrue:[ |
4076 | 1420 |
idx := containerPath indexOfSubCollection:((packageID copyReplaceAll:$: with:$/),'/'). |
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1421 |
idx ~~ 0 ifTrue:[ |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1422 |
^ containerPath copyFrom:idx. |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1423 |
]. |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1424 |
]. |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1425 |
|
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1426 |
"/ |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1427 |
"/ the following is heuristics, in case that the packageID is not known |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1428 |
"/ (should not be required) |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1429 |
"/ |
4323 | 1430 |
top := self repositoryTopDirectoryFromSCMRoot. |
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1431 |
top notNil ifTrue:[ |
148 | 1432 |
|
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1433 |
(containerPath startsWith:(top , '/')) ifTrue:[ |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1434 |
^ containerPath copyFrom:(top size + 2). |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1435 |
]. |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1436 |
(containerPath startsWith:(top)) ifTrue:[ |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1437 |
^ containerPath copyFrom:(top size + 1). |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1438 |
]. |
148 | 1439 |
|
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1440 |
"/ hardcase - the repository-filename in the versionInfo |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1441 |
"/ does not match my repository top. |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1442 |
"/ check for mangled prefix (happens with symbolic links) |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1443 |
|
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1444 |
lastTop := '/' , top asFilename baseName, '/'. |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1445 |
idx := containerPath indexOfSubCollection:lastTop. |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1446 |
idx ~~ 0 ifTrue:[ |
3512
a69619b661ea
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
1447 |
('SourceCodeManager [warning]: repository path mismatch: ' , (containerPath copyTo:idx-1) , lastTop , ' vs. ' , top , '/') infoPrintCR. |
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1448 |
'SourceCodeManager [info]: warning: assuming that mismatch is ok.' infoPrintCR. |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1449 |
^ containerPath copyFrom:(idx + lastTop size). |
148 | 1450 |
] |
96 | 1451 |
]. |
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1452 |
|
501 | 1453 |
^ nil |
96 | 1454 |
|
1455 |
" |
|
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1456 |
SourceCodeManager pathInRepositoryFrom:'/files/CVS/stx/libbasic/Array.st' forPackage:Array package |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1457 |
SourceCodeManager pathInRepositoryFrom:'/phys/ibm/CVS/stx/libbasic/Array.st' forPackage:Array package |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1458 |
|
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1459 |
SourceCodeManager pathInRepositoryFrom:'/files/CVS/stx/libbasic/Array.st' forPackage:nil |
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1460 |
SourceCodeManager pathInRepositoryFrom:'/phys/ibm/CVS/stx/libbasic/Array.st' forPackage:nil |
96 | 1461 |
" |
1462 |
||
1498 | 1463 |
"Created: / 25-11-1995 / 18:42:20 / cg" |
1464 |
"Modified: / 21-06-2006 / 12:06:14 / cg" |
|
2915
f0e6c9528a5e
added: #isRevision:sameOfAfter:
Claus Gittinger <cg@exept.de>
parents:
2866
diff
changeset
|
1465 |
"Modified (comment): / 24-09-2012 / 11:10:50 / cg" |
4323 | 1466 |
"Modified: / 18-05-2018 / 12:30:23 / Stefan Vogel" |
96 | 1467 |
! |
1468 |
||
1091
577e196eb240
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1077
diff
changeset
|
1469 |
postCheckInClass:aClass |
871 | 1470 |
"invoked after a checkIn" |
870 | 1471 |
|
928 | 1472 |
|p| |
1473 |
||
1474 |
(p := Project current) notNil ifTrue:[ |
|
1475 |
p condenseChangesForClassCheckin:aClass. |
|
2241
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1476 |
]. |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1477 |
|
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1478 |
"/ |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1479 |
"/ Set the source code for every method of the checked in class |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1480 |
"/ Ensure that the source code for the compiled methods is the original one |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1481 |
"/ Done to avoid checking out from the repository using binaryRevision and sourcePosition |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1482 |
"/ |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1483 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
3396
b7066ff1c30f
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3385
diff
changeset
|
1484 |
mthd package = aClass package ifTrue:[ |
b7066ff1c30f
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3385
diff
changeset
|
1485 |
mthd makeLocalStringSource. |
b7066ff1c30f
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3385
diff
changeset
|
1486 |
] |
2241
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1487 |
]. |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1488 |
aClass allPrivateClassesDo:[:eachPrivateClass | |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1489 |
eachPrivateClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
3396
b7066ff1c30f
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3385
diff
changeset
|
1490 |
mthd package = aClass package ifTrue:[ |
b7066ff1c30f
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3385
diff
changeset
|
1491 |
mthd makeLocalStringSource. |
b7066ff1c30f
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3385
diff
changeset
|
1492 |
]. |
2241
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1493 |
] |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1494 |
]. |
1091
577e196eb240
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1077
diff
changeset
|
1495 |
! |
577e196eb240
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1077
diff
changeset
|
1496 |
|
577e196eb240
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1077
diff
changeset
|
1497 |
postCheckInExtensionsForPackage:aPackageId |
577e196eb240
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1077
diff
changeset
|
1498 |
"invoked after a checkIn" |
577e196eb240
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1077
diff
changeset
|
1499 |
|
2241
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1500 |
|p extensionMethods| |
1091
577e196eb240
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1077
diff
changeset
|
1501 |
|
577e196eb240
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1077
diff
changeset
|
1502 |
(p := Project current) notNil ifTrue:[ |
577e196eb240
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1077
diff
changeset
|
1503 |
p condenseChangesForExtensionsCheckInInPackage:aPackageId. |
2241
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1504 |
]. |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1505 |
|
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1506 |
"/ |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1507 |
"/ Set the source code for every extension method of the checked in aPackageId |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1508 |
"/ Ensure that the source code for the compiled methods is the original one |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1509 |
"/ Done to avoid checking out from the repository |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1510 |
"/ |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1511 |
extensionMethods := Smalltalk allExtensionsForPackage:aPackageId. |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1512 |
extensionMethods do:[:mthd | |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1513 |
mthd makeLocalStringSource. |
891d18a71bbf
After check-in, set the source code for every method of the checked in class or extensions
fm
parents:
2240
diff
changeset
|
1514 |
]. |
870 | 1515 |
! |
1516 |
||
4133 | 1517 |
rememberPackageWithoutExtensionMethodConfirmation:aPackageID |
1518 |
"usually, the checkin dialog asks if unpackaged methods should be moved |
|
1519 |
to the package. |
|
1520 |
This can be suppressed on a per-package base with a checkbox ('do not...again') |
|
1521 |
in the dialog. |
|
1522 |
This method adds a package to the set of non-asking packages" |
|
1523 |
||
1524 |
PackagesWithoutExtensionMethodConfirmation isNil ifTrue:[ |
|
1525 |
PackagesWithoutExtensionMethodConfirmation := Set new |
|
1526 |
]. |
|
1527 |
PackagesWithoutExtensionMethodConfirmation add:aPackageID |
|
1528 |
! |
|
1529 |
||
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
1530 |
reportError:msg |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
1531 |
|fullMsg| |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
1532 |
|
4449 | 1533 |
fullMsg := self className,' [error]: ',msg. |
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
1534 |
fullMsg errorPrintCR. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
1535 |
SourceCodeManagerError raiseErrorString:fullMsg. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
1536 |
|
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
1537 |
"Created: / 29-08-2006 / 12:44:19 / cg" |
4449 | 1538 |
"Modified: / 28-06-2019 / 08:38:29 / Claus Gittinger" |
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
1539 |
! |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
1540 |
|
96 | 1541 |
repositoryTopDirectory |
472 | 1542 |
"return the name of the repository" |
1543 |
||
96 | 1544 |
^ nil |
1545 |
||
1546 |
"Created: 25.11.1995 / 18:38:59 / cg" |
|
472 | 1547 |
"Modified: 12.9.1996 / 02:32:40 / cg" |
96 | 1548 |
! |
1549 |
||
71 | 1550 |
sourceCacheDirectory |
4415 | 1551 |
"return the sourceCache directories name. |
1552 |
Ensure that it exists." |
|
472 | 1553 |
|
71 | 1554 |
|dir nm| |
1555 |
||
1556 |
(nm := self cacheDirectoryName) isNil ifTrue:[^ nil]. |
|
69 | 1557 |
|
71 | 1558 |
(dir := nm asFilename) exists ifFalse:[ |
3234 | 1559 |
OsError catch:[ |
2232
ee754b28809e
changed: #sourceCacheDirectory
Claus Gittinger <cg@exept.de>
parents:
2231
diff
changeset
|
1560 |
dir recursiveMakeDirectory. |
4415 | 1561 |
dir exists ifFalse:[ |
1562 |
('SourceCodeManager [warning]: could not create cache dir "', CacheDirectoryName,'"') errorPrintCR. |
|
1563 |
^ nil |
|
1564 |
]. |
|
1565 |
"/ |
|
1566 |
"/ make it read/writable for everyone |
|
1567 |
"/ |
|
1568 |
dir makeReadableForAll. |
|
1569 |
dir makeWritableForAll. |
|
1570 |
dir makeExecutableForAll. |
|
173
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
1571 |
]. |
71 | 1572 |
]. |
1573 |
^ dir |
|
173
d73d61190510
make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents:
160
diff
changeset
|
1574 |
|
535 | 1575 |
"Modified: 10.1.1997 / 15:13:20 / cg" |
71 | 1576 |
! |
69 | 1577 |
|
96 | 1578 |
sourceInfoOfClass:aClass |
751 | 1579 |
"helper: return a classes sourceCodeInfo by extracting its |
1580 |
versionString components." |
|
96 | 1581 |
|
4076 | 1582 |
|cls clsPackage packageInfo revInfo actualSourceFileName classFileNameBase |
501 | 1583 |
newInfo container expectedFileName |
752 | 1584 |
directoryFromVersion moduleFromVersion fileNameFromVersion |
3280
5b12c2facb52
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3268
diff
changeset
|
1585 |
directoryFromPackage moduleFromPackage repairedPath| |
96 | 1586 |
|
1091
577e196eb240
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1077
diff
changeset
|
1587 |
cls := aClass theNonMetaclass. |
96 | 1588 |
|
179 | 1589 |
newInfo := IdentityDictionary new. |
1590 |
||
96 | 1591 |
"/ |
1592 |
"/ the info given by the classes source ... |
|
752 | 1593 |
"/ (i.e. its revisionString) |
96 | 1594 |
"/ |
2838 | 1595 |
revInfo := cls revisionInfoOfManager: self. |
179 | 1596 |
revInfo notNil ifTrue:[ |
1597 |
revInfo keysAndValuesDo:[:key :value | |
|
1598 |
newInfo at:key put:value |
|
1599 |
] |
|
1600 |
]. |
|
96 | 1601 |
|
1602 |
"/ |
|
1603 |
"/ the info given by the classes binary ... |
|
752 | 1604 |
"/ (i.e. its package-ID) |
96 | 1605 |
"/ if present, we better trust that one. |
752 | 1606 |
"/ however, it only contains partial information (module:directory:libName). |
179 | 1607 |
"/ (but is available even without a source) |
96 | 1608 |
"/ |
4076 | 1609 |
clsPackage := cls package. |
1610 |
"/ hack: fix on-the-fly if corrupted top-module's package (FolderInfo) |
|
1611 |
(clsPackage endsWith:':') ifTrue:[ |
|
1612 |
('SourceCodeManager [warning]: fixing corrupted package identifier: ',clsPackage) infoPrintCR. |
|
1613 |
clsPackage := clsPackage copyButLast asSymbol. |
|
1614 |
cls setPackage:clsPackage. |
|
1615 |
]. |
|
1616 |
cls name = clsPackage ifTrue:[ |
|
1617 |
"/ very special - the top-module's FolderInfo |
|
1618 |
newInfo at:#module put:clsPackage. |
|
4056 | 1619 |
newInfo at:#directory put:''. |
1620 |
] ifFalse:[ |
|
1621 |
packageInfo := cls packageSourceCodeInfo. |
|
1622 |
packageInfo notNil ifTrue:[ |
|
1623 |
packageInfo keysAndValuesDo:[:key :value | |
|
1624 |
newInfo at:key put:value |
|
1625 |
] |
|
160 | 1626 |
] |
96 | 1627 |
]. |
1628 |
||
179 | 1629 |
"/ |
1630 |
"/ no information |
|
1631 |
"/ |
|
752 | 1632 |
(packageInfo isNil and:[revInfo isNil]) ifTrue:[ |
1223 | 1633 |
('SourceCodeManager [warning]: class `' , cls name , ''' has neither source nor compiled-in info') infoPrintCR. |
179 | 1634 |
^ nil |
1635 |
]. |
|
96 | 1636 |
|
1637 |
"/ |
|
179 | 1638 |
"/ validate for conflicts |
1639 |
"/ trust binary if in doubt |
|
1640 |
"/ (in case some cheater edited the version string) |
|
752 | 1641 |
"/ |
179 | 1642 |
revInfo notNil ifTrue:[ |
2030
ed856e774120
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
1980
diff
changeset
|
1643 |
container := revInfo at:#repositoryPathName ifAbsent:nil. |
ed856e774120
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
1980
diff
changeset
|
1644 |
(container notNil) ifTrue:[ |
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1645 |
moduleFromVersion := self moduleFromContainerPath:container forClass:aClass. |
1125 | 1646 |
moduleFromVersion notNil ifTrue:[ |
1647 |
newInfo at:#module put:moduleFromVersion. |
|
1648 |
]. |
|
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1649 |
directoryFromVersion := self directoryFromContainerPath:container forClass:aClass. |
752 | 1650 |
directoryFromVersion notNil ifTrue:[ |
1651 |
newInfo at:#directory put:directoryFromVersion. |
|
704 | 1652 |
]. |
752 | 1653 |
fileNameFromVersion := container asFilename baseName. |
1654 |
(fileNameFromVersion endsWith:',v') ifTrue:[ |
|
3230
65624c6c84b9
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
3131
diff
changeset
|
1655 |
fileNameFromVersion := fileNameFromVersion copyButLast:2. |
704 | 1656 |
]. |
752 | 1657 |
newInfo at:#fileName put:fileNameFromVersion. |
179 | 1658 |
|
752 | 1659 |
packageInfo notNil ifTrue:[ |
1660 |
(packageInfo includesKey:#directory) ifTrue:[ |
|
1661 |
directoryFromPackage := packageInfo at:#directory. |
|
1662 |
moduleFromPackage := packageInfo at:#module. |
|
96 | 1663 |
|
752 | 1664 |
(directoryFromPackage ~= directoryFromVersion |
1665 |
or:[moduleFromPackage ~= moduleFromVersion]) ifTrue:[ |
|
1666 |
(directoryFromVersion isNil or:[moduleFromVersion isNil]) ifTrue:[ |
|
1667 |
directoryFromPackage ~= 'no package' ifTrue:[ |
|
1125 | 1668 |
moduleFromVersion notNil ifTrue:[ |
1669 |
('SourceCodeManager [warning]: conflicting source infos (binary: ' |
|
1670 |
, (moduleFromPackage ? 'nil') , '/' , (directoryFromPackage ? 'nil') |
|
1671 |
, ' vs. source:' |
|
1672 |
, (moduleFromVersion ? 'nil') , '/' , (directoryFromVersion ? 'nil') |
|
1673 |
, ')') infoPrintCR. |
|
1674 |
('SourceCodeManager [info]: using binary info: ' |
|
1675 |
, moduleFromPackage , '/' , directoryFromPackage |
|
1676 |
) infoPrintCR. |
|
1677 |
]. |
|
752 | 1678 |
newInfo at:#directory put:directoryFromPackage. |
1679 |
newInfo at:#module put:moduleFromPackage. |
|
583
aeb05843bd69
suppress annoying warning message about binary vs. source info,
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
1680 |
] |
187
fdda79120bbb
in sourceInfoOfClass: be prepared for binInfo present, but no sourceInfo
Claus Gittinger <cg@exept.de>
parents:
185
diff
changeset
|
1681 |
] ifFalse:[ |
752 | 1682 |
directoryFromPackage ~= 'no package' ifTrue:[ |
3888
202109d7ba22
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3815
diff
changeset
|
1683 |
('SourceCodeManager [warning]: class: ', aClass name, ' - conflicting source infos (binary: ' |
752 | 1684 |
, moduleFromPackage , '/' , directoryFromPackage |
581
2f96268045cb
avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents:
558
diff
changeset
|
1685 |
, ' vs. source:' |
3888
202109d7ba22
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3815
diff
changeset
|
1686 |
, moduleFromVersion , '/' , directoryFromVersion, ')') infoPrintCR. |
581
2f96268045cb
avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents:
558
diff
changeset
|
1687 |
] |
583
aeb05843bd69
suppress annoying warning message about binary vs. source info,
Claus Gittinger <cg@exept.de>
parents:
582
diff
changeset
|
1688 |
] |
179 | 1689 |
] |
1690 |
] |
|
1691 |
]. |
|
1692 |
] |
|
1693 |
]. |
|
1694 |
||
1695 |
"/ |
|
1696 |
"/ the filename I'd expect from its name ... |
|
1697 |
"/ |
|
1863 | 1698 |
classFileNameBase := cls classBaseFilename. |
179 | 1699 |
|
1700 |
(newInfo includesKey:#fileName) ifFalse:[ |
|
1856
1b69eec9b150
care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents:
1838
diff
changeset
|
1701 |
newInfo at:#fileName put:classFileNameBase |
179 | 1702 |
]. |
1703 |
||
1704 |
"/ guess on the container |
|
1461 | 1705 |
((newInfo includesKey:#directory) and:[newInfo includesKey:#module]) ifTrue:[ |
4056 | 1706 |
|moduleDirectory pathInRepository| |
1707 |
||
1708 |
(newInfo at:#directory) isEmpty ifTrue:[ |
|
1709 |
moduleDirectory := (newInfo at:#module). |
|
1710 |
] ifFalse:[ |
|
1711 |
moduleDirectory := (newInfo at:#module) , '/' , (newInfo at:#directory). |
|
1712 |
]. |
|
1461 | 1713 |
container isNil ifTrue:[ |
4056 | 1714 |
container := moduleDirectory , '/' , classFileNameBase , ',v'. |
1461 | 1715 |
]. |
4056 | 1716 |
pathInRepository := moduleDirectory , '/' , classFileNameBase. |
1461 | 1717 |
newInfo at:#pathInRepository put:pathInRepository. |
179 | 1718 |
]. |
1719 |
||
1720 |
container notNil ifTrue:[ |
|
1721 |
newInfo at:#repositoryPathName put:container. |
|
96 | 1722 |
]. |
1723 |
||
3280
5b12c2facb52
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3268
diff
changeset
|
1724 |
(newInfo includesKey:#pathInRepository) ifFalse:[ |
5b12c2facb52
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3268
diff
changeset
|
1725 |
(fileNameFromVersion := newInfo at:#fileName ifAbsent:nil) notNil ifTrue:[ |
3972 | 1726 |
cls projectDirectory notNil ifTrue:[ |
1727 |
(repairedPath := cls projectDirectory asFilename construct:fileNameFromVersion) exists ifTrue:[ |
|
1728 |
Transcript showCR:('Oldstyle, broken or invalid version-info in class: ',cls name allBold,'. Please check'). |
|
1729 |
newInfo at:#pathInRepository put:repairedPath pathName. |
|
1730 |
]. |
|
3280
5b12c2facb52
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3268
diff
changeset
|
1731 |
]. |
5b12c2facb52
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3268
diff
changeset
|
1732 |
]. |
5b12c2facb52
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3268
diff
changeset
|
1733 |
]. |
5b12c2facb52
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3268
diff
changeset
|
1734 |
|
96 | 1735 |
"/ check .. |
1736 |
revInfo notNil ifTrue:[ |
|
160 | 1737 |
actualSourceFileName := revInfo at:#fileName ifAbsent:nil. |
1738 |
actualSourceFileName notNil ifTrue:[ |
|
1856
1b69eec9b150
care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents:
1838
diff
changeset
|
1739 |
expectedFileName := classFileNameBase. |
179 | 1740 |
actualSourceFileName ~= expectedFileName ifTrue:[ |
1223 | 1741 |
('SourceCodeManager [warning]: source of class ' , cls name , ' in ' , actualSourceFileName , ';') infoPrintCR. |
535 | 1742 |
('SourceCodeManager [info]: (expected: ' , expectedFileName , '); renamed or missing abbreviation ?') infoPrintCR. |
1743 |
('SourceCodeManager [info]: This may fail to autoload later if left unchanged.') infoPrintCR. |
|
179 | 1744 |
newInfo at:#expectedFileName put:expectedFileName. |
160 | 1745 |
newInfo at:#renamed put:true. |
1856
1b69eec9b150
care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents:
1838
diff
changeset
|
1746 |
classFileNameBase := actualSourceFileName |
160 | 1747 |
] |
1748 |
] |
|
96 | 1749 |
]. |
1750 |
||
1888 | 1751 |
newInfo at:#classFileNameBase put:(classFileNameBase asFilename nameWithoutSuffix). |
96 | 1752 |
^ newInfo |
1753 |
||
704 | 1754 |
" |
3815
36cba9b2a19f
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3746
diff
changeset
|
1755 |
SourceCodeManager sourceInfoOfClass:Array |
704 | 1756 |
" |
1757 |
||
2030
ed856e774120
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
1980
diff
changeset
|
1758 |
"Modified: / 22-10-2008 / 20:49:15 / cg" |
2838 | 1759 |
"Modified: / 19-07-2012 / 13:38:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2173 | 1760 |
! |
1761 |
||
2638
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1762 |
updateVersionMethod:selector of:aClass for:newRevisionString |
2173 | 1763 |
"{ Pragma: +optSpace }" |
1764 |
||
1765 |
"helper for the checkin procedure. |
|
1766 |
Update my #version_XXX method, to now return newRevisionString." |
|
1767 |
||
1768 |
Class methodRedefinitionNotification answer:#keep do:[ |
|
1769 |
Class withoutUpdatingChangesDo:[ |
|
2543
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
1770 |
"/ "/ must preserve the binary version, as methods still have the offsets into the old source file inside |
4323 | 1771 |
"/ aClass setBinaryRevision:aClass revision. |
2543
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
1772 |
|
2638
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1773 |
self compileVersionMethod:selector of:aClass for:newRevisionString. |
2173 | 1774 |
] |
1775 |
]. |
|
1776 |
||
2543
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
1777 |
"Modified: / 29-09-2011 / 21:59:41 / cg" |
2638
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1778 |
"Created: / 02-12-2011 / 14:18:14 / cg" |
4323 | 1779 |
"Modified (format): / 18-05-2018 / 12:26:00 / Stefan Vogel" |
2638
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1780 |
! |
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1781 |
|
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1782 |
updateVersionMethodOf:aClass for:newRevisionString |
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1783 |
"{ Pragma: +optSpace }" |
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1784 |
|
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1785 |
"helper for the checkin procedure. |
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1786 |
Update my #version_XXX method, to now return newRevisionString." |
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1787 |
|
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1788 |
self updateVersionMethod:(self nameOfVersionMethodInClasses) of:aClass for:newRevisionString. |
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1789 |
|
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1790 |
"Updates the old method #version (if present)" |
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1791 |
true "(aClass theMetaclass includesSelector: Class nameOfOldVersionMethod)" ifTrue: [ |
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1792 |
self updateVersionMethod:(Class nameOfOldVersionMethod) of:aClass for:newRevisionString. |
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1793 |
]. |
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1794 |
|
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
1795 |
"Modified: / 02-12-2011 / 14:19:37 / cg" |
95 | 1796 |
! ! |
1797 |
||
1893 | 1798 |
!AbstractSourceCodeManager class methodsFor:'queries'! |
1799 |
||
2730 | 1800 |
enabled |
1801 |
||
1802 |
"JV@2012-01-19: Quick hack, see senders. Is that what you mean?" |
|
1803 |
||
1804 |
^self askFor:#shownInBrowserMenus |
|
1805 |
||
1806 |
"Created: / 19-01-2012 / 10:39:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1807 |
! |
|
1808 |
||
3663
4cd9f90aaad3
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3661
diff
changeset
|
1809 |
initialRevisionString |
4cd9f90aaad3
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3661
diff
changeset
|
1810 |
"redefinable in subclasses" |
4cd9f90aaad3
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3661
diff
changeset
|
1811 |
|
4cd9f90aaad3
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3661
diff
changeset
|
1812 |
^ '1.0' |
4cd9f90aaad3
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3661
diff
changeset
|
1813 |
! |
4cd9f90aaad3
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3661
diff
changeset
|
1814 |
|
4210 | 1815 |
isAbstract |
1816 |
"Return if this class is an abstract class. |
|
1817 |
True is returned here for myself only; false for subclasses. |
|
1818 |
Abstract subclasses must redefine this again." |
|
1819 |
||
1820 |
^ self == AbstractSourceCodeManager. |
|
1821 |
! |
|
1822 |
||
2649 | 1823 |
isContainerBased |
1824 |
"true, if the SCM uses some kind of source container (,v files). |
|
1825 |
False, if it is like a database or filesystem." |
|
1826 |
||
1827 |
^ true |
|
1828 |
||
1829 |
"Created: / 21-12-2011 / 18:53:49 / cg" |
|
1830 |
! |
|
1831 |
||
2199 | 1832 |
isExperimental |
1833 |
^ false |
|
1834 |
||
1835 |
"Created: / 16-08-2006 / 11:22:47 / cg" |
|
1836 |
! |
|
1837 |
||
2763
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1838 |
isExtensionsVersionMethodSelector: selector |
3647
41283198781e
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3631
diff
changeset
|
1839 |
"true if the given selector is for ANY of the manager's extensions version methods. |
2763
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1840 |
These are all named extensionVersion_XXX, where XXX is manager-specific (CVS, P4, SVN etc.). |
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1841 |
For backward compatibility (times, when there was only one CVS sourcecode manager, |
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1842 |
the selector named 'extensionsVersion' alone also counts as a version method |
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1843 |
(which might be a somewhat bad idea in the long term...)." |
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1844 |
|
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1845 |
selector isNil ifTrue: [^ false]. |
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1846 |
|
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1847 |
^ selector == self nameOfVersionMethodForExtensions |
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1848 |
or:[selector startsWith: self prefixOfVersionMethodForExtensionsSelector] |
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1849 |
|
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1850 |
"Modified (comment): / 09-07-2011 / 12:31:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1851 |
"Created: / 26-01-2012 / 14:30:45 / cg" |
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1852 |
! |
38380a8ec471
added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2762
diff
changeset
|
1853 |
|
1893 | 1854 |
isResponsibleForModule:module |
1855 |
^ self repositoryInfoPerModule keys includes:module |
|
1856 |
||
1857 |
"Created: / 09-11-2006 / 15:24:57 / cg" |
|
2140
48a3fb6d338d
added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents:
2100
diff
changeset
|
1858 |
! |
48a3fb6d338d
added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents:
2100
diff
changeset
|
1859 |
|
2445 | 1860 |
isResponsibleForPackage:aStringOrSymbol |
2565 | 1861 |
"Returns true if the manager can handle source code for given package. |
1862 |
||
1863 |
Answering true does not imply that receiver is configured default |
|
1864 |
manager for that package, it only means that it has a repository |
|
1865 |
configured for given package." |
|
1866 |
||
2445 | 1867 |
self subclassResponsibility |
1868 |
||
2565 | 1869 |
"Modified (comment): / 11-10-2011 / 11:58:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2634
865f10de3c93
comment/format in: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents:
2623
diff
changeset
|
1870 |
"Modified (format): / 01-12-2011 / 20:56:32 / cg" |
2259
dfb8e835c7d3
added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1871 |
! |
dfb8e835c7d3
added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1872 |
|
2665
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1873 |
isRevision:revision1 after:revision2 |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1874 |
"true, if the dotted revision string revision1 is > than revision2" |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1875 |
|
3417
848ad94c1e8f
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3399
diff
changeset
|
1876 |
^ (revision1 compareAsVersionNumberWith:revision2) > 0 |
2665
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1877 |
|
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1878 |
" |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1879 |
SourceCodeManager isRevision:'1' after:'2' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1880 |
SourceCodeManager isRevision:'2' after:'1' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1881 |
SourceCodeManager isRevision:'1.1' after:'2.1.2' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1882 |
SourceCodeManager isRevision:'2.1' after:'1.2.3' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1883 |
SourceCodeManager isRevision:'1' after:'1.1' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1884 |
SourceCodeManager isRevision:'1.1' after:'1' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1885 |
SourceCodeManager isRevision:'1.1' after:'1.2' |
3417
848ad94c1e8f
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3399
diff
changeset
|
1886 |
SourceCodeManager isRevision:'1.10' after:'1.2' |
2665
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1887 |
SourceCodeManager isRevision:'1.2' after:'1.1' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1888 |
SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3.5' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1889 |
SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3.3' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1890 |
SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1891 |
SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3.4' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1892 |
" |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1893 |
|
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1894 |
"Created: / 21-12-2011 / 19:15:35 / cg" |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1895 |
! |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
1896 |
|
2916
259d582b2131
added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents:
2915
diff
changeset
|
1897 |
isRevision:revision1 sameOrAfter:revision2 |
259d582b2131
added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents:
2915
diff
changeset
|
1898 |
"true, if the dotted revision string revision1 is >= than revision2" |
259d582b2131
added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents:
2915
diff
changeset
|
1899 |
|
3417
848ad94c1e8f
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3399
diff
changeset
|
1900 |
^ (revision1 compareAsVersionNumberWith:revision2) >= 0 |
2916
259d582b2131
added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents:
2915
diff
changeset
|
1901 |
|
259d582b2131
added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents:
2915
diff
changeset
|
1902 |
"Created: / 26-09-2012 / 18:15:58 / cg" |
259d582b2131
added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents:
2915
diff
changeset
|
1903 |
! |
259d582b2131
added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents:
2915
diff
changeset
|
1904 |
|
3249
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
1905 |
isVersionMethodForExtensionsSelector: selector |
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
1906 |
<resource: #obsolete> |
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
1907 |
|
2764
c3849e8e0f31
added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents:
2763
diff
changeset
|
1908 |
"true if the given selector is for one of the manager's extensions version methods. |
c3849e8e0f31
added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents:
2763
diff
changeset
|
1909 |
These are all named extensionVersion_XXX, where XXX is manager-specific (CVS, P4, SVN etc.). |
c3849e8e0f31
added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents:
2763
diff
changeset
|
1910 |
For backward compatibility (times, when there was only one CVS sourcecode manager, |
3249
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
1911 |
the selector named 'extensionsVersion' alone also counts as a version method |
2764
c3849e8e0f31
added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents:
2763
diff
changeset
|
1912 |
(which might be a somewhat bad idea in the long term...)." |
c3849e8e0f31
added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents:
2763
diff
changeset
|
1913 |
|
3249
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
1914 |
self obsoleteMethodWarning:'use isExtensionsVersionMethodSelector'. |
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
1915 |
^self isExtensionsVersionMethodSelector: selector |
2764
c3849e8e0f31
added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents:
2763
diff
changeset
|
1916 |
! |
c3849e8e0f31
added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents:
2763
diff
changeset
|
1917 |
|
2183 | 1918 |
isVersionMethodSelector: selector |
2342
9b43866e85b5
changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
1919 |
"true if the given selector is for one of the manager's version methods. |
2445 | 1920 |
These are all named version_XXX, where XXX is manager-specific (CVS, P4, SVN etc.). |
2342
9b43866e85b5
changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
1921 |
For backward compatibility (times, when there was only one CVS sourcecode manager, |
9b43866e85b5
changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
1922 |
the selector named 'version' alone also counts as a version method |
9b43866e85b5
changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
1923 |
(which might be a somewhat bad idea in the long term...)." |
2183 | 1924 |
|
2195 | 1925 |
selector isNil ifTrue: [^ false]. |
1926 |
||
2529
302c2c58caa7
changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1927 |
^ selector == self nameOfVersionMethodInClasses |
2530
331e4ee893f7
comment/format in: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2529
diff
changeset
|
1928 |
or:[selector startsWith: self prefixOfVersionMethodSelector] |
2529
302c2c58caa7
changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1929 |
|
2445 | 1930 |
"Modified (comment): / 09-07-2011 / 12:31:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2530
331e4ee893f7
comment/format in: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2529
diff
changeset
|
1931 |
"Modified (format): / 29-09-2011 / 14:56:15 / cg" |
2183 | 1932 |
! |
1933 |
||
2552
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1934 |
managerTypeName |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1935 |
|
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1936 |
"Answers version manager name suitable for UI, |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1937 |
i,e., CVS, SubVersion, Perforce" |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1938 |
|
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1939 |
^ self subclassResponsibility |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1940 |
|
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1941 |
"Modified (comment): / 03-10-2011 / 13:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1942 |
! |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1943 |
|
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1944 |
managerTypeNameShort |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1945 |
|
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1946 |
"Answers short version manager name suitable for UI, |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1947 |
i,e., CVS, SVN, P4. Used in cases where sorter strings |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1948 |
are preferred. Defaults to #managerTypeName" |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1949 |
|
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1950 |
^self managerTypeName |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1951 |
|
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1952 |
"Created: / 03-10-2011 / 13:28:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1953 |
! |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
1954 |
|
2199 | 1955 |
nameOfVersionMethodForExtensions |
2528
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1956 |
"that is the old name; now, we use extensionsVersion_<SCM>" |
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1957 |
|
2199 | 1958 |
^ #'extensionsVersion' |
2528
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1959 |
|
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1960 |
"Modified (comment): / 29-09-2011 / 13:27:04 / cg" |
2199 | 1961 |
! |
1962 |
||
2140
48a3fb6d338d
added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents:
2100
diff
changeset
|
1963 |
nameOfVersionMethodInClasses |
2528
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1964 |
"that is the old name; now, we use version_<SCM>" |
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1965 |
|
2140
48a3fb6d338d
added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents:
2100
diff
changeset
|
1966 |
^ #'version' |
2528
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1967 |
|
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1968 |
"Modified (comment): / 29-09-2011 / 13:27:09 / cg" |
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1969 |
! |
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1970 |
|
2838 | 1971 |
performsCompilabilityChecks |
1972 |
"Should return true, if the manager itself performs |
|
1973 |
compilability checks, false otherwise. |
|
1974 |
||
1975 |
Basically a hack, see my senders..." |
|
1976 |
||
1977 |
^false"/by default |
|
1978 |
||
1979 |
"Created: / 11-04-2012 / 16:54:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1980 |
! |
|
1981 |
||
2762 | 1982 |
prefixOfVersionMethodForExtensionsSelector |
1983 |
"all scm-extensionsVersion methods start with this prefix" |
|
1984 |
||
1985 |
^ 'extensionsVersion_' |
|
1986 |
||
1987 |
"Created: / 26-01-2012 / 14:29:32 / cg" |
|
1988 |
! |
|
1989 |
||
2528
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1990 |
prefixOfVersionMethodSelector |
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1991 |
"all scm-version methods start with this prefix" |
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1992 |
|
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1993 |
^ 'version_' |
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1994 |
|
fb5b84f165d4
added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents:
2527
diff
changeset
|
1995 |
"Created: / 29-09-2011 / 13:26:29 / cg" |
2199 | 1996 |
! |
1997 |
||
4554 | 1998 |
repositoryTopDirectoryFromSCMRoot |
1999 |
"return the top of the repository." |
|
2000 |
||
2001 |
^ self subclassResponsibility |
|
2002 |
||
2003 |
"Created: / 18-05-2018 / 12:30:23 / Stefan Vogel" |
|
2004 |
! |
|
2005 |
||
2665
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2006 |
revisionAfter:aRevisionString |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2007 |
"generate the next revision number after the given number" |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2008 |
|
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2009 |
|idx| |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2010 |
|
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2011 |
idx := aRevisionString lastIndexOf:$.. |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2012 |
idx == 0 ifTrue:[ |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2013 |
^ ((Integer readFrom:aRevisionString) + 1) printString |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2014 |
]. |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2015 |
|
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2016 |
^ (aRevisionString copyTo:idx) , ((Integer readFrom:(aRevisionString copyFrom:(idx+1)))+1) printString |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2017 |
|
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2018 |
" |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2019 |
SourceCodeManager revisionAfter:'1.2.3.4' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2020 |
SourceCodeManager revisionAfter:'123' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2021 |
SourceCodeManager revisionAfter:'1.24' |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2022 |
" |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2023 |
|
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2024 |
"Created: 20.11.1995 / 12:54:05 / cg" |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2025 |
"Modified: 12.9.1996 / 02:33:03 / cg" |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2026 |
! |
279ad76d9372
comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents:
2654
diff
changeset
|
2027 |
|
2347 | 2028 |
settingsApplicationClass |
2350
161df39dbbbb
added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents:
2347
diff
changeset
|
2029 |
"link to my settings application (needed for the settings dialog" |
161df39dbbbb
added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents:
2347
diff
changeset
|
2030 |
|
2347 | 2031 |
self subclassResponsibility |
2032 |
||
2033 |
"Created: / 19-04-2011 / 12:43:54 / cg" |
|
2350
161df39dbbbb
added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents:
2347
diff
changeset
|
2034 |
"Modified: / 19-04-2011 / 13:52:45 / cg" |
2347 | 2035 |
! |
2036 |
||
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2037 |
sourceCodeManagerForPackage:aPackageID |
3647
41283198781e
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3631
diff
changeset
|
2038 |
|defaultManager module mgr| |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2039 |
|
4158 | 2040 |
"JV@2012-01-23: If source code management is disabled, return #()." |
3647
41283198781e
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3631
diff
changeset
|
2041 |
defaultManager := Smalltalk at:#SourceCodeManager. |
41283198781e
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3631
diff
changeset
|
2042 |
defaultManager isNil ifTrue:[ "eg. disabled" ^ nil ]. |
2743 | 2043 |
|
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2044 |
aPackageID notNil ifTrue:[ |
2259
dfb8e835c7d3
added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
2045 |
"/ see if there is a package-specific manager |
2743 | 2046 |
(mgr := self managerForPackage:aPackageID) notNil ifTrue:[^ mgr]. |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2047 |
|
3647
41283198781e
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3631
diff
changeset
|
2048 |
"/ more or less obsolete now - I know which manager is to be used per package |
41283198781e
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3631
diff
changeset
|
2049 |
"/ self availableManagers do:[:mgr | |
41283198781e
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3631
diff
changeset
|
2050 |
"/ (mgr isResponsibleForPackage:aPackageID) ifTrue:[^ mgr ]. |
41283198781e
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3631
diff
changeset
|
2051 |
"/ ]. |
2259
dfb8e835c7d3
added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
2052 |
|
dfb8e835c7d3
added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
2053 |
"/ old stuff: see if there is a module-specific manager |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2054 |
module := aPackageID upTo:$:. |
2225 | 2055 |
self availableManagers do:[:mgr | |
2056 |
(mgr isResponsibleForModule:module) ifTrue:[^ mgr ]. |
|
2057 |
] |
|
2058 |
]. |
|
3647
41283198781e
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3631
diff
changeset
|
2059 |
^ defaultManager |
2329
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2060 |
|
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2061 |
" |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2062 |
self sourceCodeManagerForPackage:'stx:libbasic'. |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2063 |
self sourceCodeManagerForPackage:'stx:libboss'. |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2064 |
self managerForMatchingModule:'stx:libba*' put:SVNSourceCodeManager. |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2065 |
self sourceCodeManagerForPackage:'stx:libbasic'. |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2066 |
self sourceCodeManagerForPackage:'stx:libboss'. |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2067 |
" |
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2068 |
|
2fc2fbd7a63c
per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents:
2324
diff
changeset
|
2069 |
"Modified: / 18-04-2011 / 19:53:03 / cg" |
2743 | 2070 |
"Modified: / 23-01-2012 / 19:44:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2225 | 2071 |
! |
2072 |
||
2649 | 2073 |
supportsCheckinLogMessages |
2074 |
"true, if log-messages are supported" |
|
2075 |
||
2076 |
^ true |
|
2077 |
||
2078 |
"Created: / 21-12-2011 / 18:02:34 / cg" |
|
2079 |
! |
|
2080 |
||
3661
ce825c324ef7
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3652
diff
changeset
|
2081 |
versionInfoClass |
ce825c324ef7
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3652
diff
changeset
|
2082 |
|
ce825c324ef7
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3652
diff
changeset
|
2083 |
^VersionInfo |
ce825c324ef7
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3652
diff
changeset
|
2084 |
! |
ce825c324ef7
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3652
diff
changeset
|
2085 |
|
2527
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2086 |
versionMethodKeyword |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2087 |
|
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2088 |
"Answers the keyword used by the version management system to |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2089 |
expand a current version in a file (_without_ dollars). For |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2090 |
CVS it is 'Header', for SVN 'Id', others may use different |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2091 |
keywords. If nil is returned, then the version management does |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2092 |
not use any keyword." |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2093 |
|
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2094 |
"/TODO: Now, 'Header' is returned for backward compatibility. In future |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2095 |
"/it should be changed to self subclassResponsibility |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2096 |
|
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2097 |
^'Header' |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2098 |
|
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2099 |
"Created: / 27-09-2011 / 14:52:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2100 |
! |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2101 |
|
2476 | 2102 |
versionMethodTemplateForJavaScript |
2103 |
^ self versionMethodTemplateForJavaScriptFor:(self nameOfVersionMethodInClasses) |
|
2104 |
||
2105 |
" |
|
2106 |
CVSSourceCodeManager versionMethodTemplateForJavaScript |
|
2107 |
" |
|
2108 |
||
2109 |
"Created: / 19-08-2011 / 01:20:28 / cg" |
|
2110 |
! |
|
2111 |
||
2112 |
versionMethodTemplateForJavaScriptFor:aSelector |
|
2113 |
"do not make the thing below a single string - otherwise |
|
2114 |
it would get expanded by the sourcecodemanager, which we do not want here" |
|
2115 |
||
2116 |
^ |
|
3453 | 2117 |
"'function ',"aSelector,'() { |
2118 |
return "$' , self versionMethodKeyword , '$"; |
|
2476 | 2119 |
}' |
2120 |
||
2121 |
"Created: / 19-08-2011 / 01:20:56 / cg" |
|
3453 | 2122 |
"Modified: / 20-09-2012 / 12:13:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2476 | 2123 |
! |
2124 |
||
2199 | 2125 |
versionMethodTemplateForRuby |
2126 |
^ self versionMethodTemplateForRubyFor:(self nameOfVersionMethodInClasses) |
|
2127 |
||
2128 |
" |
|
2129 |
CVSSourceCodeManager versionMethodTemplateForRuby |
|
2130 |
" |
|
2131 |
! |
|
2132 |
||
2133 |
versionMethodTemplateForRubyFor:aSelector |
|
2476 | 2134 |
"do not make the thing below a single string - otherwise |
2135 |
it would get expanded by the sourcecodemanager, which we do not want here" |
|
2136 |
||
2199 | 2137 |
^ |
2138 |
'def self.',aSelector,'() |
|
2527
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2139 |
return "$' , self versionMethodKeyword , '$" |
2199 | 2140 |
end' |
2476 | 2141 |
|
2142 |
"Modified (comment): / 19-08-2011 / 01:19:40 / cg" |
|
2527
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2143 |
"Modified: / 27-09-2011 / 16:46:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2199 | 2144 |
! |
2145 |
||
2146 |
versionMethodTemplateForSmalltalk |
|
2147 |
^ self versionMethodTemplateForSmalltalkFor:(self nameOfVersionMethodInClasses) |
|
2148 |
||
2149 |
" |
|
2150 |
CVSSourceCodeManager versionMethodTemplateForSmalltalk |
|
2151 |
" |
|
2152 |
! |
|
2153 |
||
2154 |
versionMethodTemplateForSmalltalkFor:aSelector |
|
2476 | 2155 |
"do not make the thing below a single string - otherwise |
2156 |
it would get expanded by the sourcecodemanager, which we do not want here" |
|
2157 |
||
2199 | 2158 |
^ |
2159 |
aSelector,' |
|
2527
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2160 |
^ ''$', self versionMethodKeyword , '$'' |
2199 | 2161 |
' |
2476 | 2162 |
|
2163 |
"Modified (comment): / 19-08-2011 / 01:19:08 / cg" |
|
2527
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
2164 |
"Modified: / 27-09-2011 / 16:46:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4434 | 2165 |
! |
2166 |
||
2167 |
versionString:stringA isLessThan:stringB |
|
2168 |
^ self utilities versionString:stringA isLessThan:stringB |
|
2169 |
||
2170 |
"Created: / 28-05-2019 / 15:53:16 / Claus Gittinger" |
|
1893 | 2171 |
! ! |
2172 |
||
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
2173 |
!AbstractSourceCodeManager class methodsFor:'source code access'! |
95 | 2174 |
|
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2175 |
basicCheckinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage force:force |
3624
ad34fdcdc273
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3597
diff
changeset
|
2176 |
"low level checkin of a class into the source repository. Does not deal with any version method updates, |
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2177 |
only does the checkin, using a temporary file. |
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2178 |
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
|
2179 |
|
3624
ad34fdcdc273
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3597
diff
changeset
|
2180 |
aClass isPrivate ifTrue:[ |
ad34fdcdc273
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3597
diff
changeset
|
2181 |
self reportError:'refuse to check in private classes.'. |
ad34fdcdc273
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3597
diff
changeset
|
2182 |
^ false. |
ad34fdcdc273
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3597
diff
changeset
|
2183 |
]. |
2851
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2184 |
^ self |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2185 |
withClass:aClass |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2186 |
classFileName:classFileName |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2187 |
filedOutToTemporaryFileDo:[:tempFile | |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2188 |
self |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2189 |
checkinClass:aClass |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2190 |
fileName:classFileName |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2191 |
directory:packageDir |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2192 |
module:moduleDir |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2193 |
source:(tempFile name) |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2194 |
logMessage:logMessage |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2195 |
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
|
2196 |
]. |
71 | 2197 |
|
2198 |
" |
|
2199 |
SourceCodeManager checkinClass:Array |
|
2200 |
" |
|
2201 |
||
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2202 |
"Modified: / 25-09-1997 / 12:16:00 / stefan" |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2203 |
"Created: / 21-12-2011 / 19:30:06 / cg" |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2204 |
! |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2205 |
|
4284 | 2206 |
checkin:containerFilename text:someText directory:packageDir module:moduleName logMessage:logMessage force:force |
2207 |
"enter some (source) code (which is someText) |
|
2208 |
into the source repository. If the force argument is true, no merge is done; |
|
2209 |
instead, the code is checked in as given (Dangerous). |
|
2210 |
Return true if ok, false if not." |
|
2211 |
||
2212 |
^ self checkin:containerFilename text:someText directory:packageDir module:moduleName logMessage:logMessage force:force onBranch:nil |
|
2213 |
||
2214 |
"Modified: / 19-04-2012 / 14:18:24 / sr" |
|
2215 |
"Modified: / 05-12-2017 / 23:30:00 / cg" |
|
2216 |
! |
|
2217 |
||
2218 |
checkin:containerFilename text:someText directory:packageDir module:moduleName logMessage:logMessage force:force onBranch:branchNameOrNil |
|
2219 |
"enter some (source) code (which is someText) |
|
2220 |
into the source repository. If the force argument is true, no merge is done; |
|
2221 |
instead, the code is checked in as given (Dangerous). |
|
2222 |
Return true if ok, false if not." |
|
2223 |
||
2224 |
self subclassResponsibility |
|
2225 |
||
2226 |
"Created: / 05-12-2017 / 23:30:37 / cg" |
|
2227 |
! |
|
2228 |
||
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2229 |
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2230 |
"checkin of a class into the source repository. |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2231 |
Return true if ok, false if not." |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2232 |
|
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2233 |
^ self |
4279 | 2234 |
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage onBranch:nil |
2235 |
||
2236 |
"Modified: / 05-12-2017 / 20:28:20 / cg" |
|
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2237 |
! |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2238 |
|
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2239 |
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage force:force |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2240 |
"checkin of a class into the source repository. |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2241 |
Return true if ok, false if not." |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2242 |
|
4008 | 2243 |
|theMetaclass className answer allLabel allValue |
2244 |
nameOfVersionMethodInClasses revision question| |
|
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2245 |
|
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2246 |
className := aClass name. |
4008 | 2247 |
theMetaclass := aClass theMetaclass. |
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2248 |
nameOfVersionMethodInClasses := self nameOfVersionMethodInClasses. |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2249 |
|
3930 | 2250 |
(revision := aClass revisionOfManager:self) isNil ifTrue:[ |
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2251 |
force ifFalse:[ |
4008 | 2252 |
('SourceCodeManager [warning]: class "%1" has no revision string (for %2)' bindWith:className with:self managerTypeName) errorPrintCR. |
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2253 |
|
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2254 |
AbortAllOperationWantedQuery query ifTrue:[ |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2255 |
allLabel := #('Cancel All'). |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2256 |
allValue := #(cancelAll). |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2257 |
] ifFalse:[ |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2258 |
allLabel := #(). |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2259 |
allValue := #(). |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2260 |
]. |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2261 |
|
4008 | 2262 |
((theMetaclass includesSelector:#version) |
2263 |
or:[theMetaclass includesSelector: nameOfVersionMethodInClasses]) ifTrue:[ |
|
2264 |
||
2265 |
(theMetaclass includesSelector: nameOfVersionMethodInClasses) ifTrue:[ |
|
2266 |
question := 'Class "%1" has a broken revision string (for %2).\\Checkin as newest?' |
|
2267 |
] ifFalse:[ |
|
2268 |
question := 'Class "%1" has no revision string (for %2).\\Initial Checkin?' |
|
2269 |
]. |
|
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2270 |
answer := OptionBox |
4008 | 2271 |
request:(question bindWith:className allBold with:self managerTypeName) withCRs |
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2272 |
label:'Confirm' |
3930 | 2273 |
buttonLabels:(allLabel , #('Cancel' 'Browse & Cancel' 'CheckIn')) |
2274 |
values:(allValue , #(false #browse #checkIn)) |
|
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2275 |
default:#checkIn. |
3930 | 2276 |
answer == #browse ifTrue:[ |
4008 | 2277 |
UserPreferences browserClass openInClass:theMetaclass. |
3930 | 2278 |
AbortOperationRequest raise. ^ false |
2279 |
]. |
|
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2280 |
] ifFalse:[ |
3597
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2281 |
force ifTrue:[ |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2282 |
revision := self newestRevisionInFile:classFileName directory:packageDir module:moduleDir. |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2283 |
revision isNil ifTrue:[ |
3663
4cd9f90aaad3
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3661
diff
changeset
|
2284 |
revision := self initialRevisionString "/ initial checkin |
3597
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2285 |
]. |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2286 |
] ifFalse:[ |
3663
4cd9f90aaad3
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3661
diff
changeset
|
2287 |
revision := self initialRevisionString "/ initial checkin |
3597
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2288 |
]. |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2289 |
answer := #create. |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2290 |
"/ answer := OptionBox |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2291 |
"/ request:('Class %1 has no revision string.\\Check in as newest ?' bindWith:className allBold) withCRs |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2292 |
"/ label:'Confirm' |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2293 |
"/ buttonLabels:(allLabel , #('Cancel' 'CheckIn' 'Create & CheckIn')) |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2294 |
"/ values:(allValue , #(false #checkIn #create)) |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2295 |
"/ default:#create. |
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2296 |
]. |
2980
7dab3220c55b
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
2979
diff
changeset
|
2297 |
answer == false ifTrue:[ AbortOperationRequest raise. ^ false ]. |
7dab3220c55b
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
2979
diff
changeset
|
2298 |
answer == #cancelAll ifTrue:[ AbortAllOperationRequest raise. ^ false ]. |
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2299 |
answer == #create ifTrue:[ |
3597
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
2300 |
self updateVersionMethodOf:aClass for:(self revisionStringFor:aClass inModule:moduleDir directory:packageDir container:classFileName revision:revision). |
2654
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2301 |
]. |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2302 |
] |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2303 |
]. |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2304 |
|
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2305 |
"Ensure that the method #version_XXX is present before checking in XXX. |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2306 |
It will be missing when checking in classes with only the old method #version" |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2307 |
|
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2308 |
^ self basicCheckinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage force:force. |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2309 |
|
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2310 |
" |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2311 |
SourceCodeManager checkinClass:Array |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2312 |
" |
6cb5bc656e8c
added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents:
2649
diff
changeset
|
2313 |
|
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
2314 |
"Created: / 11-09-1996 / 16:15:17 / cg" |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
2315 |
"Modified: / 25-09-1997 / 12:16:00 / stefan" |
4008 | 2316 |
"Modified: / 30-04-2016 / 12:59:59 / cg" |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2317 |
! |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2318 |
|
4279 | 2319 |
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage onBranch:branchNameOrNil |
2320 |
"checkin of a class into the source repository. |
|
2321 |
Return true if ok, false if not." |
|
2322 |
||
2323 |
^ self |
|
2324 |
checkinClass:aClass |
|
2325 |
fileName:classFileName |
|
2326 |
directory:packageDir |
|
2327 |
module:moduleDir |
|
2328 |
logMessage:logMessage |
|
2329 |
force:false |
|
2330 |
||
2331 |
"Created: / 05-12-2017 / 20:28:07 / cg" |
|
2332 |
! |
|
2333 |
||
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2334 |
checkinClass:aClass logMessage:logMessage |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2335 |
"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
|
2336 |
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
|
2337 |
|
4279 | 2338 |
^ self checkinClass:aClass logMessage:logMessage onBranch:nil |
2339 |
||
2340 |
" |
|
2341 |
SourceCodeManager checkinClass:Array logMessage:'foo' |
|
2342 |
" |
|
2343 |
||
2344 |
"Created: / 06-11-1995 / 18:56:00 / cg" |
|
2345 |
"Modified: / 05-12-2017 / 20:27:46 / cg" |
|
2346 |
! |
|
2347 |
||
2348 |
checkinClass:aClass logMessage:logMessage onBranch:branchNameOrNil |
|
2349 |
"checkin of a class into the source repository. |
|
2350 |
Return true if ok, false if not." |
|
2351 |
||
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2352 |
|sourceInfo packageDir moduleDir classFileName| |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2353 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2354 |
sourceInfo := self sourceInfoOfClass:aClass. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2355 |
sourceInfo isNil ifTrue:[ |
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
2356 |
self reportError:('no sourceInfo for class: ' , aClass name). |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2357 |
^ false |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2358 |
]. |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2359 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2360 |
packageDir := self directoryFromSourceInfo:sourceInfo. |
179 | 2361 |
moduleDir := self moduleFromSourceInfo:sourceInfo. "/ use the modules name as CVS module |
2362 |
classFileName := self containerFromSourceInfo:sourceInfo. |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2363 |
|
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2364 |
^ self |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2365 |
checkinClass:aClass |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2366 |
fileName:classFileName |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2367 |
directory:packageDir |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2368 |
module:moduleDir |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2369 |
logMessage:logMessage |
4279 | 2370 |
onBranch:branchNameOrNil |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2371 |
|
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2372 |
" |
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2373 |
SourceCodeManager checkinClass:Array logMessage:'foo' |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2374 |
" |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
2375 |
|
4279 | 2376 |
"Created: / 05-12-2017 / 20:27:33 / cg" |
71 | 2377 |
! |
2378 |
||
1780 | 2379 |
getFile:fileName revision:revision directory:packageDir module:moduleDir |
2380 |
|s contents| |
|
2381 |
||
2382 |
s := self |
|
2383 |
streamForFile:fileName |
|
2384 |
revision:revision |
|
2385 |
directory:packageDir |
|
2386 |
module:moduleDir. |
|
2387 |
s isNil ifTrue:[^ nil]. |
|
3582
9ea25bf13e00
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3512
diff
changeset
|
2388 |
contents := s contentsAsString. |
1780 | 2389 |
s close. |
2390 |
^ contents |
|
2391 |
||
2392 |
" |
|
2393 |
SourceCodeManager |
|
2394 |
getFile:'Make.spec' |
|
2395 |
revision:#newest |
|
2396 |
directory:'libbasic2' |
|
2397 |
module:'stx' |
|
2398 |
" |
|
2399 |
||
2400 |
"Created: / 29-08-2006 / 15:47:08 / cg" |
|
2401 |
! |
|
2402 |
||
493
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
2403 |
getMostRecentSourceStreamForClassNamed:aClassName |
472 | 2404 |
"given a class, return an open stream to its most recent source |
2405 |
(not knowing anything about its version). |
|
2406 |
Used when autoloading classes." |
|
2407 |
||
745
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2408 |
^ self |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2409 |
getMostRecentSourceStreamForClassNamed:aClassName |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2410 |
inPackage:nil |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2411 |
! |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2412 |
|
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2413 |
getMostRecentSourceStreamForClassNamed:aClassName inPackage:forcedPackage |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2414 |
"given a class, return an open stream to its most recent source |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2415 |
(not knowing anything about its version). |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2416 |
Used when autoloading classes or to compare a classes source with the most |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2417 |
recent found in the repostitory. |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2418 |
The forcePackage argument passes the classes package information |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2419 |
and is only required when autoloading or when the class is not already |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2420 |
present (i.e. there is no way to extract the package info). |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2421 |
If nil, the package is extracted from the class - which must exist." |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2422 |
|
1205 | 2423 |
|cls sourceInfo classFileName packageDir moduleDir s components i| |
71 | 2424 |
|
133 | 2425 |
cls := Smalltalk classNamed:aClassName. |
2426 |
cls notNil ifTrue:[ |
|
2427 |
sourceInfo := self sourceInfoOfClass:cls. |
|
2428 |
]. |
|
2429 |
sourceInfo notNil ifTrue:[ |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2430 |
packageDir := self directoryFromSourceInfo:sourceInfo. |
179 | 2431 |
moduleDir := self moduleFromSourceInfo:sourceInfo. "/ use the modules name as CVS module |
2432 |
classFileName := self containerFromSourceInfo:sourceInfo. |
|
133 | 2433 |
] ifFalse:[ |
1838 | 2434 |
classFileName := (Smalltalk fileNameForClass:aClassName), '.st'. |
133 | 2435 |
packageDir := Smalltalk sourceDirectoryNameOfClass:aClassName. |
769 | 2436 |
packageDir notNil ifTrue:[ |
2437 |
(packageDir startsWith:'stx/') ifTrue:[ |
|
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
2438 |
"this is a backward compatibility leftover - will vanish" |
769 | 2439 |
packageDir := packageDir copyFrom:5. |
2440 |
] ifFalse:[ |
|
2441 |
i := packageDir indexOf:$:. |
|
2442 |
i ~~ 0 ifTrue:[ |
|
2443 |
moduleDir := packageDir copyTo:i-1. |
|
2444 |
packageDir := packageDir copyFrom:i+1 |
|
2445 |
] |
|
2446 |
] |
|
744 | 2447 |
]. |
769 | 2448 |
moduleDir isNil ifTrue:[ |
2449 |
moduleDir := 'stx' |
|
2450 |
]. |
|
133 | 2451 |
]. |
2452 |
||
2453 |
packageDir isNil ifTrue:[ |
|
745
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2454 |
forcedPackage isNil ifTrue:[ |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2455 |
'SourceCodeManager [warning]: could not extract packageDir' errorPrintCR. |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2456 |
^ nil |
a17a530bb089
fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents:
744
diff
changeset
|
2457 |
]. |
1777
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
2458 |
moduleDir := forcedPackage asPackageId module. |
9ae57293c00f
sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents:
1729
diff
changeset
|
2459 |
packageDir := forcedPackage asPackageId directory. |
133 | 2460 |
]. |
71 | 2461 |
|
557
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2462 |
s := self |
133 | 2463 |
streamForClass:nil |
2464 |
fileName:classFileName |
|
2465 |
revision:#newest |
|
2466 |
directory:packageDir |
|
2467 |
module:moduleDir |
|
557
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2468 |
cache:false. |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2469 |
|
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2470 |
s isNil ifTrue:[ |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2471 |
"/ guessed moduleDir ? |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2472 |
|
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2473 |
sourceInfo isNil ifTrue:[ |
1417
2707849f626a
No need to use Filename>>#concreteClass
Stefan Vogel <sv@exept.de>
parents:
1392
diff
changeset
|
2474 |
components := Filename components:packageDir. |
557
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2475 |
moduleDir := components first. |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2476 |
packageDir := (Filename fromComponents:(components copyFrom:2)) asString. |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2477 |
s := self |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2478 |
streamForClass:nil |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2479 |
fileName:classFileName |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2480 |
revision:#newest |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2481 |
directory:packageDir |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2482 |
module:moduleDir |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2483 |
cache:false. |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2484 |
] |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2485 |
]. |
8466accf9276
if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2486 |
^ s. |
71 | 2487 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2488 |
"Created: / 12-10-1996 / 17:22:54 / cg" |
1838 | 2489 |
"Modified: / 06-10-2006 / 16:17:33 / cg" |
71 | 2490 |
! |
2491 |
||
1594 | 2492 |
getMostRecentSourceStreamForFile:aFileName inPackage:aPackage |
2493 |
"given a filename, return an open stream to its most recent contents |
|
2494 |
(not knowing anything about its version). |
|
2495 |
Used when autoloading extensions or to compare a classes source with the most |
|
2496 |
recent found in the repostitory." |
|
2497 |
||
1780 | 2498 |
|directory module| |
1594 | 2499 |
|
2500 |
module := aPackage asPackageId module. |
|
2501 |
directory := aPackage asPackageId directory. |
|
2502 |
||
1780 | 2503 |
^ self |
2504 |
streamForFile:aFileName |
|
1594 | 2505 |
revision:#newest |
2506 |
directory:directory |
|
1780 | 2507 |
module:module. |
2508 |
||
2509 |
"Created: / 12-10-1996 / 17:22:54 / cg" |
|
2510 |
"Modified: / 29-08-2006 / 15:49:02 / cg" |
|
1594 | 2511 |
! |
2512 |
||
493
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
2513 |
getSourceStreamFor:aClass |
58 | 2514 |
"extract a classes source code and return an open readStream on it. |
2515 |
The classes source code is extracted using the revision and the sourceCodeInfo, |
|
2516 |
which itself is extracted from the classes packageString." |
|
2517 |
||
493
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
2518 |
^ self getSourceStreamFor:aClass revision:nil |
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
2519 |
|
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
2520 |
"Created: 12.10.1996 / 17:21:03 / cg" |
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
2521 |
"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
|
2522 |
! |
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
2523 |
|
493
ec81df138d8f
had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents:
482
diff
changeset
|
2524 |
getSourceStreamFor:aClass revision:aRevisionStringOrNil |
83
250202dc956e
added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents:
77
diff
changeset
|
2525 |
"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
|
2526 |
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
|
2527 |
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
|
2528 |
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
|
2529 |
|
3345
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2530 |
^ self getSourceStreamFor:aClass revision:aRevisionStringOrNil cache:true |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2531 |
! |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2532 |
|
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2533 |
getSourceStreamFor:aClass revision:aRevisionStringOrNil cache:cache |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2534 |
"extract a classes source code and return an open readStream on it. |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2535 |
A revision of nil selects the current (in image) revision. |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2536 |
The classes source code is extracted using the revision and the sourceCodeInfo, |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2537 |
which itself is extracted from the classes packageString." |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2538 |
|
2543
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2539 |
|classFileName binaryRevision revision revisionUsed |
4558 | 2540 |
packageDir moduleDir sourceInfo revForMeOrNil packageId| |
58 | 2541 |
|
943 | 2542 |
aRevisionStringOrNil == #newest ifTrue:[ |
2543 |
^ self getMostRecentSourceStreamForClassNamed:(aClass theNonMetaclass name). |
|
2544 |
]. |
|
2545 |
||
2543
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2546 |
(revisionUsed := aRevisionStringOrNil) isNil ifTrue:[ |
2510
45b4c466a799
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2505
diff
changeset
|
2547 |
revision := aClass revisionOfManager:self. |
2543
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2548 |
binaryRevision := aClass binaryRevision. |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2549 |
binaryRevision isNil ifTrue:[ |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2550 |
revision isNil ifTrue:[ |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2551 |
('SourceCodeManager [warning]: class "%1" has no revision string' bindWith:aClass name) infoPrintCR. |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2552 |
^ nil. |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2553 |
]. |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2554 |
revisionUsed := revision |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2555 |
] ifFalse:[ |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2556 |
"/ see if this is a versionString for me (i.e. if I can extract my version string from it) |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2557 |
revForMeOrNil := self revisionInfoFromString:aClass binaryRevisionString. |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2558 |
revForMeOrNil isNil ifTrue:[ |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2559 |
revision isNil ifTrue:[ |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2560 |
('SourceCodeManager [info]: binary revision "%3" of "%1" is not for %4 - cannot extract version' |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2561 |
bindWith:aClass name |
4558 | 2562 |
with:revision |
2563 |
with:binaryRevision |
|
2543
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2564 |
with:self name) infoPrintCR. |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2565 |
] ifFalse:[ |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2566 |
('SourceCodeManager [info]: binary revision "%3" of "%1" is not for %4 - trusting revision %2' |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2567 |
bindWith:aClass name |
4558 | 2568 |
with:revision |
2569 |
with:binaryRevision |
|
2543
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2570 |
with:self name) infoPrintCR. |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2571 |
]. |
2546
be9e1b778210
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2543
diff
changeset
|
2572 |
^ nil |
2543
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2573 |
] ifFalse:[ |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2574 |
revision ~= binaryRevision ifTrue:[ |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2575 |
('SourceCodeManager [info]: "%1" has %4-revision (%2) vs. binary revision (%3) - trusting binaryRevision' |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2576 |
bindWith:aClass name |
4558 | 2577 |
with:revision |
2578 |
with:binaryRevision |
|
2543
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2579 |
with:self name) infoPrintCR. |
2547
ccb236fb305e
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2546
diff
changeset
|
2580 |
"/ self halt. |
2543
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2581 |
]. |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2582 |
revisionUsed := binaryRevision. |
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2583 |
]. |
179 | 2584 |
] |
58 | 2585 |
]. |
2586 |
||
95 | 2587 |
sourceInfo := self sourceInfoOfClass:aClass. |
1066
683643ad5544
better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents:
1060
diff
changeset
|
2588 |
sourceInfo isNil ifTrue:[ |
3345
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2589 |
"/ ('SourceCodeManager [warning]: no sourceInfo for class "%1"' bindWith:aClass name) infoPrintCR. |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2590 |
"/ ^ nil |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2591 |
"/ let's hope... |
4558 | 2592 |
packageId := aClass package asPackageId. |
2593 |
||
3345
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2594 |
classFileName := aClass classFilename. |
4558 | 2595 |
packageDir := packageId directory. |
2596 |
moduleDir := packageId module. |
|
2926
d335aecb95c3
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2924
diff
changeset
|
2597 |
] ifFalse:[ |
3345
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2598 |
packageDir := self directoryFromSourceInfo:sourceInfo. |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2599 |
packageDir isNil ifTrue:[ |
4558 | 2600 |
packageId := aClass package asPackageId. |
2601 |
packageDir := packageId directory. |
|
2602 |
moduleDir := packageId module. |
|
3345
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2603 |
] ifFalse:[ |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2604 |
moduleDir := self moduleFromSourceInfo:sourceInfo. "/ use the modules name as CVS module |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2605 |
]. |
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2606 |
classFileName := self containerFromSourceInfo:sourceInfo. |
2926
d335aecb95c3
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2924
diff
changeset
|
2607 |
]. |
58 | 2608 |
^ self |
179 | 2609 |
streamForClass:aClass |
2610 |
fileName:classFileName |
|
2543
fee92873f0c6
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
2611 |
revision:revisionUsed |
179 | 2612 |
directory:packageDir |
2613 |
module:moduleDir |
|
3345
ef913a1c10e8
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3318
diff
changeset
|
2614 |
cache:cache |
65
098be8484211
dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents:
64
diff
changeset
|
2615 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2616 |
"Created: / 12-10-1996 / 17:21:52 / cg" |
2547
ccb236fb305e
changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents:
2546
diff
changeset
|
2617 |
"Modified: / 29-09-2011 / 22:02:55 / cg" |
1780 | 2618 |
! |
2619 |
||
3511
41c63b951cf8
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3510
diff
changeset
|
2620 |
loadPackageWithId:aPackageId fromRepositoryAsAutoloaded: doLoadAsAutoloaded |
4039 | 2621 |
"Should be redefined by subclasses. |
3511
41c63b951cf8
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3510
diff
changeset
|
2622 |
Raise an exception, if load failed." |
41c63b951cf8
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3510
diff
changeset
|
2623 |
|
4170 | 2624 |
PackageLoadError raiseRequestWith:aPackageId errorString:'unimplemented feature, load package'. |
2225 | 2625 |
! |
2626 |
||
1780 | 2627 |
streamForFile:fileName revision:revision directory:packageDir module:moduleDir |
2628 |
^ self |
|
2629 |
streamForClass:nil |
|
2630 |
fileName:fileName |
|
2631 |
revision:revision |
|
2632 |
directory:packageDir |
|
2633 |
module:moduleDir |
|
2634 |
cache:true |
|
2635 |
||
2636 |
" |
|
2637 |
SourceCodeManager |
|
2638 |
streamForFile:'Make.spec' |
|
2639 |
revision:#newest |
|
2640 |
directory:'libbasic2' |
|
2641 |
module:'stx' |
|
2642 |
" |
|
2643 |
||
2644 |
"Created: / 29-08-2006 / 15:41:43 / cg" |
|
2851
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2645 |
! |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2646 |
|
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2647 |
withClass:aClass classFileName:classFileName filedOutToTemporaryFileDo:aBlock |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2648 |
"helper. fileout and eval aBlock" |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2649 |
|
4399 | 2650 |
|tempDir tempFile packageMode filter| |
2851
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2651 |
|
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2652 |
packageMode := self checkMethodPackagesOf:aClass. |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2653 |
packageMode == #base ifTrue:[ |
2979
ca2676ba02a1
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2975
diff
changeset
|
2654 |
filter := [:mthd | mthd package == aClass package]. |
2851
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2655 |
]. |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2656 |
|
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2657 |
tempDir := Filename newTemporaryDirectory. |
4399 | 2658 |
^ [ |
2851
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2659 |
|aStream| |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2660 |
|
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2661 |
tempFile := tempDir construct:classFileName. |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2662 |
[ |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2663 |
aStream := tempFile writeStream. |
4540 | 2664 |
] on:OpenError do:[:ex| |
2851
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2665 |
self reportError:('temporary fileout failed'). |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2666 |
^ false |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2667 |
]. |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2668 |
|
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2669 |
Method flushSourceStreamCache. |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2670 |
Class fileOutErrorSignal handle:[:ex | |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2671 |
aStream close. |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2672 |
self reportError:('fileout failed (',ex description,')'). |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2673 |
^ false |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2674 |
] do:[ |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2675 |
self |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2676 |
fileOutSourceCodeOf:aClass |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2677 |
on:aStream |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2678 |
withTimeStamp:false |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2679 |
withInitialize:true |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2680 |
withDefinition:true |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2681 |
methodFilter:filter. |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2682 |
]. |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2683 |
aStream close. |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2684 |
|
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2685 |
tempFile exists ifFalse:[ |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2686 |
self reportError:'temporary fileout failed'. |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2687 |
^ false. |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2688 |
]. |
4399 | 2689 |
aBlock value:tempFile |
2851
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2690 |
] ensure:[ |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2691 |
tempDir recursiveRemove |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2692 |
]. |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2693 |
|
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2694 |
" |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2695 |
SourceCodeManager checkinClass:Array |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2696 |
" |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2697 |
|
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2698 |
"Modified: / 25-09-1997 / 12:16:00 / stefan" |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2699 |
"Modified: / 20-08-2011 / 14:52:01 / cg" |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
2700 |
"Created: / 25-07-2012 / 19:38:23 / cg" |
4399 | 2701 |
"Modified: / 12-02-2019 / 20:03:33 / Stefan Vogel" |
58 | 2702 |
! ! |
2703 |
||
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
2704 |
!AbstractSourceCodeManager class methodsFor:'source code administration'! |
59
3bb0b97dffa2
reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents:
58
diff
changeset
|
2705 |
|
2838 | 2706 |
fileOutSourceCodeExtensions: extensions package: package on: stream |
2707 |
"File out extension methods for given package on stream. |
|
3453 | 2708 |
Not programming-language safe - can handle smalltalk methods." |
2709 |
||
2710 |
^self fileOutSourceCodeExtensions: extensions package: package on: stream version: true. |
|
2711 |
||
2712 |
"Created: / 02-02-2012 / 15:30:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2713 |
"Modified: / 07-11-2012 / 23:51:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2714 |
! |
|
2715 |
||
2716 |
fileOutSourceCodeExtensions: extensions package: pkg on: stream version: versionIt |
|
2717 |
"File out extension methods for given package on stream. |
|
2718 |
Not programming-language safe - can handle smalltalk methods." |
|
2838 | 2719 |
|
3131
d203000b91af
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2980
diff
changeset
|
2720 |
| source | |
d203000b91af
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2980
diff
changeset
|
2721 |
|
3453 | 2722 |
self assert: (extensions allSatisfy:[:m|m programmingLanguage isSmalltalk]). |
2723 |
source := self utilities sourceCodeForExtensions:extensions package:pkg forManager:self. |
|
3131
d203000b91af
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2980
diff
changeset
|
2724 |
source isWideString ifTrue:[ |
d203000b91af
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2980
diff
changeset
|
2725 |
| s | |
d203000b91af
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2980
diff
changeset
|
2726 |
|
3453 | 2727 |
s:= EncodedStream stream: stream encoder: (CharacterEncoder encoderForUTF8). |
3131
d203000b91af
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2980
diff
changeset
|
2728 |
s nextPutAll: '"{ Encoding: utf8 }"'; cr;cr. |
d203000b91af
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2980
diff
changeset
|
2729 |
s nextPutAll: source. |
d203000b91af
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2980
diff
changeset
|
2730 |
] ifFalse:[ |
d203000b91af
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2980
diff
changeset
|
2731 |
stream nextPutAll: source. |
2838 | 2732 |
]. |
2733 |
||
3453 | 2734 |
self checkTabSpaceConventionIn: stream. |
2735 |
||
2736 |
"Created: / 07-11-2012 / 23:50:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2737 |
"Modified: / 29-11-2013 / 13:10:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2838 | 2738 |
! |
2739 |
||
2173 | 2740 |
fileOutSourceCodeOf:aClass on:aStream |
2741 |
||
2742 |
self withSourceRewriteHandlerDo:[ |
|
2743 |
aClass fileOutOn:aStream withTimeStamp:false. |
|
2744 |
]. |
|
2745 |
! |
|
2746 |
||
2380
d17747baf9e9
comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
2350
diff
changeset
|
2747 |
fileOutSourceCodeOf:aClass on:aStream |
d17747baf9e9
comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
2350
diff
changeset
|
2748 |
withTimeStamp:withTimeStamp withInitialize:withInitialize withDefinition:withDefinition |
d17747baf9e9
comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
2350
diff
changeset
|
2749 |
methodFilter:methodFilter |
2173 | 2750 |
|
2838 | 2751 |
"JV@2012-02-02: Do not fileout extensionVersion methods, that one is filed out |
2752 |
when extensions are filed out." |
|
4323 | 2753 |
"/ (aClass inheritsFrom: ProjectDefinition) ifTrue:[ |
2754 |
"/ filter := [:m| (methodFilter value: m) |
|
2755 |
"/ and:[ (self isExtensionsVersionMethodSelector:m selector) not |
|
2756 |
"/ "m selector ~~ self nameOfVersionMethodForExtensions"] |
|
2757 |
"/ ] |
|
2758 |
"/ ] ifFalse:[ |
|
2759 |
"/ filter := methodFilter. |
|
2760 |
"/ ]. |
|
2838 | 2761 |
|
2173 | 2762 |
self withSourceRewriteHandlerDo:[ |
3628
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2763 |
| writer | |
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2764 |
|
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2765 |
writer := aClass programmingLanguage sourceFileWriterClass new. |
3710
21fec77b695d
Fix bad bug in AbstractSourceCodeManager>>fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3709
diff
changeset
|
2766 |
writer generatingSourceForOriginal:true. |
3628
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2767 |
writer |
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2768 |
fileOut:aClass |
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2769 |
on:aStream |
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2770 |
withTimeStamp:withTimeStamp |
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2771 |
withInitialize:withInitialize |
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2772 |
withDefinition:withDefinition |
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2773 |
methodFilter:methodFilter |
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2774 |
|
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2775 |
"/ aClass fileOutOn:aStream |
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2776 |
"/ withTimeStamp:withTimeStamp |
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2777 |
"/ withInitialize:withInitialize |
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2778 |
"/ withDefinition:withDefinition |
a35c08debde5
Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3624
diff
changeset
|
2779 |
"/ methodFilter:filter. |
2173 | 2780 |
]. |
2838 | 2781 |
|
3453 | 2782 |
self checkTabSpaceConventionIn: aStream. |
2783 |
||
3710
21fec77b695d
Fix bad bug in AbstractSourceCodeManager>>fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3709
diff
changeset
|
2784 |
"Modified: / 22-01-2015 / 09:39:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4323 | 2785 |
"Modified: / 18-05-2018 / 12:47:06 / Stefan Vogel" |
2173 | 2786 |
! |
2787 |
||
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2788 |
getExistingContainersInModule:aModule directory:aPackage |
677 | 2789 |
"{ Pragma: +optSpace }" |
2790 |
||
2791 |
"return a collection containing the names of existing containers" |
|
2792 |
||
2793 |
^ self subclassResponsibility |
|
2794 |
||
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2795 |
"Created: / 23-08-2006 / 14:12:07 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2796 |
! |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2797 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2798 |
getExistingDirectoriesInModule:aModule |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2799 |
"{ Pragma: +optSpace }" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2800 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2801 |
"return a collection containing the names of existing packages" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2802 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2803 |
^ self subclassResponsibility |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2804 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2805 |
"Created: / 23-08-2006 / 14:13:52 / cg" |
677 | 2806 |
! |
2807 |
||
676 | 2808 |
getExistingModules |
2809 |
"{ Pragma: +optSpace }" |
|
2810 |
||
2811 |
"return a collection containing the names of existing modules" |
|
2812 |
||
2813 |
^ self subclassResponsibility |
|
2814 |
||
2815 |
"Modified: / 29.1.1997 / 18:57:29 / cg" |
|
2816 |
"Created: / 20.5.1998 / 19:38:23 / cg" |
|
2817 |
! |
|
2818 |
||
4275 | 2819 |
knownBranchTagsAndRevisionsFor:aClass |
2820 |
"retrieve a list of branch (symbolic tags -> versionNr) associations known for that class. |
|
2821 |
I.e. which tags/symbolic versions exist, and which revision-nr is attached to it" |
|
2822 |
||
2823 |
|allTagsAndVersions| |
|
2824 |
||
2825 |
allTagsAndVersions := self knownTagsAndRevisionsFor:aClass. |
|
2826 |
^ self onlyBranchTagsFrom:allTagsAndVersions |
|
2827 |
||
2828 |
" |
|
2829 |
CVSSourceCodeManager knownBranchTagsAndRevisionsFor:Array |
|
2830 |
" |
|
2831 |
||
2832 |
"Created: / 05-12-2017 / 19:27:50 / cg" |
|
2833 |
! |
|
2834 |
||
2835 |
knownBranchTagsAndRevisionsForContainer:classFileName directory:packageDir module:moduleDir |
|
2836 |
"retrieve all branch tages." |
|
2837 |
||
2838 |
|allTagsAndVersions| |
|
2839 |
||
2840 |
allTagsAndVersions := self knownTagsAndRevisionsForContainer:classFileName directory:packageDir module:moduleDir. |
|
2841 |
^ self onlyBranchTagsFrom:allTagsAndVersions |
|
2842 |
||
2843 |
" |
|
2844 |
CVSSourceCodeManager knownBranchTagsAndRevisionsFor:cg_test2 |
|
2845 |
CVSSourceCodeManager knownBranchTagsAndRevisionsForContainer:'cg_test2.st' directory:'test2' module:'cg' |
|
2846 |
" |
|
2847 |
||
2848 |
"Created: / 05-12-2017 / 19:19:29 / cg" |
|
2849 |
! |
|
2850 |
||
2320
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2851 |
knownTagsAndRevisionsFor:aClass |
4274 | 2852 |
"retrieve a list of (symbolic tags -> versionNr) associations known for that class. |
2320
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2853 |
I.e. which tags/symbolic versions exist, and which revision-nr is attached to it" |
2319 | 2854 |
|
2855 |
|log| |
|
2856 |
||
2857 |
log := aClass sourceCodeManager revisionLogOf:aClass fromRevision:nil toRevision:nil finishAfter:20. |
|
2858 |
log isNil ifTrue:[ |
|
2859 |
SourceCodeManagerError |
|
2860 |
raiseRequestWith:aClass |
|
2861 |
errorString: 'Could not fetch log (cvs connection error?)'. |
|
2862 |
^ #() |
|
2863 |
]. |
|
2827
f473f55da102
**** new version from Christian
Claus Gittinger <cg@exept.de>
parents:
2821
diff
changeset
|
2864 |
^ (log at:#symbolicNames ifAbsent:[ #() ]). |
2320
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2865 |
|
4274 | 2866 |
" |
2867 |
CVSSourceCodeManager knownTagsAndRevisionsFor:Array |
|
2868 |
" |
|
2869 |
||
2320
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2870 |
"Created: / 08-02-2011 / 10:18:00 / cg" |
4274 | 2871 |
"Modified (comment): / 05-12-2017 / 12:46:14 / cg" |
2872 |
! |
|
2873 |
||
2874 |
knownTagsAndRevisionsForContainer:fileName directory:packageDir module:moduleDir |
|
2875 |
"retrieve a list of (symbolic tags -> versionNr) associations. |
|
2876 |
I.e. which tags/symbolic versions exist, and which revision-nr is attached to it" |
|
2877 |
||
2878 |
|log| |
|
2879 |
||
4288 | 2880 |
log := self revisionLogOf:nil numberOfRevisions:1 fileName:fileName directory:packageDir module:moduleDir. |
4274 | 2881 |
log isNil ifTrue:[ |
2882 |
SourceCodeManagerError |
|
2883 |
raiseRequestWith:fileName |
|
2884 |
errorString: 'Could not fetch log (cvs connection error?)'. |
|
2885 |
^ #() |
|
2886 |
]. |
|
2887 |
^ (log at:#symbolicNames ifAbsent:[ #() ]). |
|
2888 |
||
2889 |
" |
|
2890 |
CVSSourceCodeManager knownTagsAndRevisionsForContainer:'Make.proto' directory:'libbasic' module:'stx' |
|
2891 |
" |
|
2892 |
||
2893 |
"Created: / 05-12-2017 / 01:16:09 / cg" |
|
4288 | 2894 |
"Modified: / 06-12-2017 / 11:47:02 / cg" |
2320
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2895 |
! |
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2896 |
|
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2897 |
knownTagsFor:aClass |
4529 | 2898 |
"retrieve a colelction of symbolic tags known for that class. |
2320
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2899 |
I.e. which tags/symbolic versions exist" |
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2900 |
|
4523 | 2901 |
|tagRevisionMapping tagList| |
2320
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2902 |
|
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2903 |
tagRevisionMapping := self knownTagsAndRevisionsFor:aClass. |
4530 | 2904 |
tagRevisionMapping isEmptyOrNil ifTrue:[^ OrderedCollection new ]. |
4523 | 2905 |
"/ ^ tagRevisionMapping keys |
2906 |
||
2907 |
"/ sort by revision; within same revision, sort by tag name |
|
2908 |
tagList := (((tagRevisionMapping associations |
|
2909 |
sort:[:a :b | a key < b key "self versionString:(a value) isLessThan:(b value)"]) |
|
2910 |
stableSort:[:a :b | self versionString:(a value) isLessThan:(b value)]) |
|
2911 |
collect:[:assoc | assoc key]) reverse. |
|
2912 |
^ tagList |
|
2320
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2913 |
|
82c54c399a28
added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
2914 |
"Modified: / 08-02-2011 / 10:18:34 / cg" |
2319 | 2915 |
! |
2916 |
||
4427 | 2917 |
newestRevisionInFile:classFileName directory:packageDirOrNil module:moduleDir |
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2918 |
"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
|
2919 |
Return nil on failure." |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2920 |
|
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2921 |
|log| |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2922 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
2923 |
log := self |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
2924 |
revisionLogOf:nil |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
2925 |
fromRevision:0 |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
2926 |
toRevision:0 |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
2927 |
fileName:classFileName |
4427 | 2928 |
directory:packageDirOrNil |
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
2929 |
module:moduleDir. |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
2930 |
|
460
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2931 |
log isNil ifTrue:[^ nil]. |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2932 |
^ 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
|
2933 |
|
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2934 |
" |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2935 |
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
|
2936 |
" |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2937 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
2938 |
"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
|
2939 |
! |
06d089e12054
added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
2940 |
|
550
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2941 |
newestRevisionLogEntryOf:aClass |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2942 |
"return the newest revisions log found in the repository. |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2943 |
Return nil on failure." |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2944 |
|
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2945 |
^ self revisionLogOf:aClass fromRevision:0 toRevision:0. |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2946 |
|
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2947 |
" |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2948 |
SourceCodeManager newestRevisionLogEntryOf:Array |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2949 |
SourceCodeManager newestRevisionLogEntryOf:Connection |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2950 |
" |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2951 |
|
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2952 |
"Modified: 10.1.1997 / 13:30:36 / cg" |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2953 |
"Created: 29.1.1997 / 18:50:12 / cg" |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2954 |
! |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
2955 |
|
207
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2956 |
newestRevisionOf:aClass |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2957 |
"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
|
2958 |
Return nil on failure." |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2959 |
|
1205 | 2960 |
|sourceInfo packageDir moduleDir classFileName| |
1005
5f595dc604e0
use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2961 |
|
5f595dc604e0
use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2962 |
sourceInfo := self sourceInfoOfClass:aClass. |
5f595dc604e0
use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2963 |
sourceInfo isNil ifTrue:[^ nil]. |
207
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2964 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
2965 |
packageDir := self directoryFromSourceInfo:sourceInfo. |
2485 | 2966 |
packageDir isNil ifTrue:[^ nil]. |
1005
5f595dc604e0
use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2967 |
moduleDir := self moduleFromSourceInfo:sourceInfo. "/ use the modules name as CVS module |
5f595dc604e0
use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2968 |
classFileName := self containerFromSourceInfo:sourceInfo. |
4173 | 2969 |
classFileName isNil ifTrue:[^ nil]. |
2970 |
||
1005
5f595dc604e0
use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2971 |
^ self newestRevisionInFile:classFileName directory:packageDir module:moduleDir |
5f595dc604e0
use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2972 |
|
5f595dc604e0
use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2973 |
"/ |log| |
5f595dc604e0
use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2974 |
"/ |
5f595dc604e0
use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2975 |
"/ log := self revisionLogOf:aClass fromRevision:0 toRevision:0. |
5f595dc604e0
use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2976 |
"/ log isNil ifTrue:[^ nil]. |
5f595dc604e0
use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2977 |
"/ ^ log at:#newestRevision ifAbsent:nil |
207
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2978 |
|
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2979 |
" |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2980 |
SourceCodeManager newestRevisionOf:Array |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2981 |
SourceCodeManager newestRevisionOf:Connection |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2982 |
" |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2983 |
|
2485 | 2984 |
"Modified: / 20-08-2011 / 14:56:04 / cg" |
207
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2985 |
! |
9366df6c32ea
added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2986 |
|
4190 | 2987 |
oldestRevisionLogEntryOf:aClass |
2988 |
"return the oldest revisions log found in the repository. |
|
2989 |
Return nil on failure. |
|
2990 |
Can be used to determine the time of initial checkin or the original author" |
|
2991 |
||
2992 |
|log| |
|
2993 |
||
2994 |
log := self revisionLogOf:aClass. |
|
2995 |
^ (log at:#revisions) last. |
|
2996 |
||
2997 |
" |
|
2998 |
SourceCodeManager oldestRevisionLogEntryOf:Array |
|
2999 |
" |
|
3000 |
! |
|
3001 |
||
4275 | 3002 |
onlyBranchTagsFrom:tagsAndVersions |
3003 |
"retrieve a list of branch (symbolic tags -> versionNr) associations known for that class. |
|
3004 |
I.e. which tags/symbolic versions exist, and which revision-nr is attached to it" |
|
3005 |
||
3006 |
tagsAndVersions isEmptyOrNil ifTrue:[ ^ #() ]. |
|
3007 |
tagsAndVersions keys copy do:[:k | |
|
3008 |
(k startsWith:(self branchTagPrefix)) ifFalse:[ |
|
3009 |
tagsAndVersions removeKey:k. |
|
3010 |
]. |
|
3011 |
]. |
|
3012 |
^ tagsAndVersions |
|
3013 |
||
3014 |
" |
|
3015 |
CVSSourceCodeManager knownBranchTagsAndRevisionsFor:Array |
|
3016 |
" |
|
3017 |
||
3018 |
"Created: / 05-12-2017 / 19:28:19 / cg" |
|
3019 |
! |
|
3020 |
||
4195 | 3021 |
printClassRepositorySummaryForClass:aClass on:aStream |
3022 |
"returns summary info from the repository: |
|
3023 |
current version, |
|
3024 |
newest in repository, |
|
3025 |
original checkin date (i.e. age), |
|
3026 |
tags on the current version |
|
3027 |
maybe more in the future |
|
3028 |
" |
|
3029 |
||
3030 |
| log revisions youngestRev oldestRev| |
|
3031 |
||
3032 |
aClass isNil ifTrue:[^ '']. |
|
3033 |
||
3034 |
log := self revisionLogOf:aClass. |
|
3035 |
log isNil ifTrue:[ |
|
4552 | 3036 |
aStream nextPutLine:'Could not get the repository log from %1' |
3037 |
with:(self repositoryName ? '<no repository name>'). |
|
4195 | 3038 |
^ self. |
3039 |
]. |
|
3040 |
||
3041 |
aStream nextPutAll:('Newest Revision: %1' bindWith:(log at:#newestRevision ifAbsent:'unknown')). |
|
3042 |
revisions := log at:#revisions ifAbsent:nil. |
|
3043 |
revisions isNil ifTrue:[ |
|
3044 |
aStream cr. |
|
3045 |
aStream nextPutAll:('Could not retrieve the revision log'). |
|
3046 |
^ self. |
|
3047 |
]. |
|
3048 |
||
3049 |
youngestRev := revisions first. |
|
3050 |
oldestRev := revisions last. |
|
4552 | 3051 |
aStream nextPutLine:' by %1 at %2' with:(youngestRev author ? '?') with:(youngestRev timestamp). |
3052 |
aStream nextPutLine:'First Checkin: by %1 at %2' with:(oldestRev author ? '?') with:(oldestRev timestamp). |
|
4195 | 3053 |
! |
3054 |
||
2683
fb2a7157540a
added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents:
2668
diff
changeset
|
3055 |
removeContainer: container inModule: module directory: directory |
fb2a7157540a
added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents:
2668
diff
changeset
|
3056 |
"remove a container" |
fb2a7157540a
added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents:
2668
diff
changeset
|
3057 |
|
fb2a7157540a
added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents:
2668
diff
changeset
|
3058 |
^ self subclassResponsibility |
fb2a7157540a
added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents:
2668
diff
changeset
|
3059 |
|
fb2a7157540a
added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents:
2668
diff
changeset
|
3060 |
"Modified (comment): / 23-12-2011 / 19:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
fb2a7157540a
added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents:
2668
diff
changeset
|
3061 |
! |
fb2a7157540a
added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents:
2668
diff
changeset
|
3062 |
|
4288 | 3063 |
revisionForSymbolicName:tag class:cls fileName:classFileName directory:packageDir module:moduleDir |
3064 |
"given a tag, return the corresponding revision" |
|
3065 |
||
3066 |
|partialLog symbolicNames| |
|
3067 |
||
3068 |
partialLog := self |
|
3069 |
revisionLogOf:cls |
|
3070 |
numberOfRevisions:1 |
|
3071 |
fileName:classFileName |
|
3072 |
directory:packageDir |
|
3073 |
module:moduleDir. |
|
3074 |
||
3075 |
partialLog notNil ifTrue:[ |
|
3076 |
symbolicNames := partialLog at:#symbolicNames ifAbsent:[]. |
|
3077 |
symbolicNames notNil ifTrue:[ |
|
3078 |
^ symbolicNames at:tag ifAbsent:nil |
|
3079 |
]. |
|
3080 |
]. |
|
3081 |
^ nil. |
|
3082 |
||
3083 |
" |
|
3084 |
CVSSourceCodeManager |
|
3085 |
revisionForSymbolicName:'stable' |
|
3086 |
class:Array fileName:'Array.st' |
|
3087 |
directory:'libbasic' module:'stx' |
|
3088 |
||
3089 |
CVSSourceCodeManager |
|
3090 |
revisionForSymbolicName:'stable' |
|
3091 |
class:Array fileName:nil |
|
3092 |
directory:'libbasic' module:'stx' |
|
3093 |
" |
|
3094 |
||
3095 |
"Created: / 06-12-2017 / 11:44:39 / cg" |
|
3096 |
! |
|
3097 |
||
2937
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3098 |
revisionForTag:tagName inClass:aClass |
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3099 |
"retrieve the revision number associated to a particular tag/symbolic version. |
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3100 |
Nil if unknown" |
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3101 |
|
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3102 |
|tagsAndVersions| |
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3103 |
|
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3104 |
tagsAndVersions := self knownTagsAndRevisionsFor:aClass. |
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3105 |
tagsAndVersions isEmptyOrNil ifTrue:[ ^ nil ]. |
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3106 |
^ tagsAndVersions at:tagName ifAbsent:nil. |
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3107 |
|
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3108 |
" |
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3109 |
SourceCodeManager revisionForTag:'stable' inClass:Array |
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3110 |
" |
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3111 |
|
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3112 |
"Created: / 08-02-2011 / 10:18:00 / cg" |
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3113 |
! |
227e7043831a
added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3114 |
|
4275 | 3115 |
revisionForTag:tagName inContainer:classFileName directory:packageDir module:moduleDir |
3116 |
"retrieve the revision number associated to a particular tag/symbolic version. |
|
3117 |
Nil if unknown" |
|
3118 |
||
3119 |
|tagsAndVersions| |
|
3120 |
||
3121 |
tagsAndVersions := self knownTagsAndRevisionsForContainer:classFileName directory:packageDir module:moduleDir. |
|
3122 |
tagsAndVersions isEmptyOrNil ifTrue:[ ^ nil ]. |
|
3123 |
^ tagsAndVersions at:tagName ifAbsent:nil. |
|
3124 |
||
3125 |
" |
|
3126 |
SourceCodeManager revisionForTag:'stable' inClass:Array |
|
3127 |
SourceCodeManager revisionForTag:'stable' inContainer:'Make.proto' directory:'libbasic' module:'stx' |
|
3128 |
" |
|
3129 |
||
3130 |
"Created: / 05-12-2017 / 01:15:01 / cg" |
|
3131 |
"Modified (comment): / 05-12-2017 / 19:15:51 / cg" |
|
3132 |
! |
|
3133 |
||
550
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3134 |
revisionInfoFromRCSString:aString |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3135 |
"{ Pragma: +optSpace }" |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3136 |
|
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3137 |
"return a dictionary filled with revision info. |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3138 |
This extracts the relevant info from aString." |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3139 |
|
4156 | 3140 |
^ CVSSourceCodeManager versionInfoClass fromRCSString:aString. |
550
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3141 |
|
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3142 |
" |
968 | 3143 |
SourceCodeManager revisionInfoFromString:'$' , 'Revision: 1.122 $' |
550
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3144 |
SourceCodeManager revisionInfoFromString:(SourceCodeManager version) |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3145 |
" |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3146 |
|
2030
ed856e774120
versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents:
1980
diff
changeset
|
3147 |
"Modified: / 22-10-2008 / 20:18:58 / cg" |
550
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3148 |
! |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3149 |
|
2842
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3150 |
revisionInfoFromStandardVersionString:aString |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3151 |
"{ Pragma: +optSpace }" |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3152 |
|
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3153 |
"return a VersionInfo object filled with revision info. |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3154 |
This extracts the relevant info from aString which is in the format as created |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3155 |
by standardRevisionStringFor:...." |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3156 |
|
3673
62cfdf4894c6
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3663
diff
changeset
|
3157 |
|info path version user timeStamp| |
2842
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3158 |
|
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3159 |
"/ 'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826' |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3160 |
|
3673
62cfdf4894c6
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3663
diff
changeset
|
3161 |
path := self extractKeyValueFor:'Path' fromRevisionString:aString. |
62cfdf4894c6
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3663
diff
changeset
|
3162 |
version := self extractKeyValueFor:'Version' fromRevisionString:aString. |
62cfdf4894c6
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3663
diff
changeset
|
3163 |
user := self extractKeyValueFor:'User' fromRevisionString:aString. |
62cfdf4894c6
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3663
diff
changeset
|
3164 |
timeStamp := self extractKeyValueFor:'Time' fromRevisionString:aString. |
2842
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3165 |
|
3661
ce825c324ef7
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3652
diff
changeset
|
3166 |
info := self versionInfoClass new. |
2842
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3167 |
path notNil ifTrue:[ info fileName:(path asFilename baseName) ]. |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3168 |
info revision:version. |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3169 |
user notNil ifTrue:[ info user:user ]. |
3673
62cfdf4894c6
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3663
diff
changeset
|
3170 |
timeStamp notNil ifTrue:[ info timeStamp:(Timestamp readFrom:timeStamp) ]. |
2842
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3171 |
^ info |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3172 |
|
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3173 |
" |
3673
62cfdf4894c6
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3663
diff
changeset
|
3174 |
self revisionInfoFromStandardVersionString:'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826' |
2842
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3175 |
" |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3176 |
|
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3177 |
"Created: / 23-07-2012 / 18:45:41 / cg" |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3178 |
! |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3179 |
|
550
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3180 |
revisionInfoFromString:aString |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3181 |
"{ Pragma: +optSpace }" |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3182 |
|
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3183 |
"return a dictionary filled with revision info. |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3184 |
This extracts the relevant info from aString." |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3185 |
|
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3186 |
^ self subclassResponsibility |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3187 |
|
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3188 |
"Created: 29.1.1997 / 18:54:52 / cg" |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3189 |
"Modified: 29.1.1997 / 18:57:29 / cg" |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3190 |
! |
3ddcec87d591
the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents:
549
diff
changeset
|
3191 |
|
2552
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
3192 |
revisionInfoFromString: vsnString inClass: class |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
3193 |
|
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
3194 |
^self revisionInfoFromString: vsnString |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
3195 |
|
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
3196 |
"Modified: / 03-10-2011 / 13:05:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
3197 |
! |
a7095d9ae297
- more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents:
2550
diff
changeset
|
3198 |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3199 |
revisionLogOf:aClass |
95 | 3200 |
"return info about the repository container and |
3201 |
the revisionlog as a collection of revision entries. |
|
3202 |
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
|
3203 |
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
|
3204 |
filled with: |
4158 | 3205 |
#container -> the container file name (for container-based SCMs) |
1863 | 3206 |
#filename -> the actual source file name |
3207 |
#newestRevision -> the revisionString of the newest revision |
|
3208 |
#numberOfRevisions -> the number of revisions in the container |
|
3209 |
#revisions -> collection of per-revision info |
|
3210 |
||
3211 |
per revision info consists of one record per revision: |
|
3212 |
||
3213 |
#revision -> the revision string |
|
3214 |
#author -> who checked that revision into the repository |
|
3215 |
#date -> when was it checked in |
|
3216 |
#state -> the RCS state |
|
3217 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
|
3218 |
||
3219 |
revisions are ordered newest first |
|
3220 |
(i.e. the last entry is for the initial revision; the first for the most recent one) |
|
3221 |
" |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3222 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3223 |
^ self |
1863 | 3224 |
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
|
3225 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3226 |
" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3227 |
SourceCodeManager revisionLogOf:Array |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3228 |
" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3229 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3230 |
"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
|
3231 |
"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
|
3232 |
! |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3233 |
|
110 | 3234 |
revisionLogOf:aClass fromRevision:rev1 |
3235 |
"return info about the repository container and |
|
3236 |
(part of) the revisionlog as a collection of revision entries. |
|
3237 |
Return nil on failure. |
|
3238 |
||
3239 |
The returned information is a structure (IdentityDictionary) |
|
3240 |
filled with: |
|
4158 | 3241 |
#container -> the container file name (for container-based SCMs) |
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3242 |
#filename -> the actual source file name |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3243 |
#newestRevision -> the revisionString of the newest revision |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3244 |
#numberOfRevisions -> the number of revisions in the container |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3245 |
#revisions -> collection of per-revision info (see below) |
110 | 3246 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3247 |
for some classes, additional info is returned: |
110 | 3248 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3249 |
#renamed -> true if the class has been renamed or copied |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3250 |
and the sourceInfo is from the previous one |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3251 |
#expectedFileName -> the filename we would expect (i.e. for the new class) |
110 | 3252 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3253 |
rev1 specifies from which revisions a logEntry is wanted: |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3254 |
If rev1 is nil, the first revision is the initial revision |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3255 |
otherwise, the log starts with that revision. |
110 | 3256 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3257 |
per revision info consists of one record per revision: |
110 | 3258 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3259 |
#revision -> the revision string |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3260 |
#author -> who checked that revision into the repository |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3261 |
#date -> when was it checked in |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3262 |
#state -> the RCS state |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3263 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
110 | 3264 |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3265 |
revisions are ordered newest first |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3266 |
(i.e. the last entry is for the initial revision; |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3267 |
the first for the most recent one) |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3268 |
" |
110 | 3269 |
|
3270 |
^ self revisionLogOf:aClass fromRevision:rev1 toRevision:nil |
|
3271 |
||
3272 |
" |
|
3273 |
SourceCodeManager revisionLogOf:Array fromRevision:'1.40' |
|
3274 |
" |
|
3275 |
||
3276 |
"Created: 6.11.1995 / 18:56:00 / cg" |
|
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3277 |
"Modified: 10.1.1997 / 13:29:50 / cg" |
110 | 3278 |
! |
3279 |
||
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3280 |
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 |
95 | 3281 |
"return info about the repository container and |
3282 |
(part of) the revisionlog as a collection of revision entries. |
|
3283 |
Return nil on failure. |
|
3284 |
||
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3285 |
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
|
3286 |
filled with: |
4158 | 3287 |
#container -> the container file name (for container-based SCMs) |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3288 |
#filename -> the actual source file name |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3289 |
#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
|
3290 |
#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
|
3291 |
#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
|
3292 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3293 |
for some classes, additional info is returned: |
96 | 3294 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3295 |
#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
|
3296 |
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
|
3297 |
#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
|
3298 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3299 |
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
|
3300 |
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
|
3301 |
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
|
3302 |
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
|
3303 |
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
|
3304 |
If both are nil, no logEntries are extracted (i.e. only the header). |
96 | 3305 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3306 |
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
|
3307 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3308 |
#revision -> the revision string |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3309 |
#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
|
3310 |
#date -> when was it checked in |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3311 |
#state -> the RCS state |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3312 |
#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
|
3313 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3314 |
revisions are ordered newest first |
534
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3315 |
(i.e. the last entry is for the initial revision; |
73fc19a1169e
commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents:
516
diff
changeset
|
3316 |
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
|
3317 |
" |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3318 |
|
2052
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3319 |
^ self |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3320 |
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3321 |
finishAfter:nil |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3322 |
! |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3323 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3324 |
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 finishAfter:maxCountOrNil |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3325 |
"return info about the repository container and |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3326 |
(part of) the revisionlog as a collection of revision entries. |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3327 |
Return nil on failure. |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3328 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3329 |
The returned information is a structure (IdentityDictionary) |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3330 |
filled with: |
4158 | 3331 |
#container -> the container file name (for container-based SCMs) |
2052
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3332 |
#filename -> the actual source file name |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3333 |
#newestRevision -> the revisionString of the newest revision |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3334 |
#numberOfRevisions -> the number of revisions in the container |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3335 |
#revisions -> collection of per-revision info (see below) |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3336 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3337 |
for some classes, additional info is returned: |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3338 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3339 |
#renamed -> true if the class has been renamed or copied |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3340 |
and the sourceInfo is from the previous one |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3341 |
#expectedFileName -> the filename we would expect (i.e. for the new class) |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3342 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3343 |
rev1 / rev2 specify from which revisions a logEntry is wanted: |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3344 |
If rev1 is nil, the first revision is the initial revision |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3345 |
otherwise, the log starts with that revision. |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3346 |
If rev2 is nil, the last revision is the newest revision |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3347 |
otherwise, the log ends with that revision. |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3348 |
If both are nil, no logEntries are extracted (i.e. only the header). |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3349 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3350 |
per revision info consists of one record per revision: |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3351 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3352 |
#revision -> the revision string |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3353 |
#author -> who checked that revision into the repository |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3354 |
#date -> when was it checked in |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3355 |
#state -> the RCS state |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3356 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3357 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3358 |
revisions are ordered newest first |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3359 |
(i.e. the last entry is for the initial revision; |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3360 |
the first for the most recent one) |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3361 |
" |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3362 |
|
501 | 3363 |
|sourceInfo packageDir moduleDir classFileName info| |
95 | 3364 |
|
3365 |
sourceInfo := self sourceInfoOfClass:aClass. |
|
3366 |
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
|
3367 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
3368 |
packageDir := self directoryFromSourceInfo:sourceInfo. |
179 | 3369 |
moduleDir := self moduleFromSourceInfo:sourceInfo. "/ use the modules name as CVS module |
3370 |
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
|
3371 |
|
96 | 3372 |
info := self |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3373 |
revisionLogOf:aClass |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3374 |
fromRevision:rev1 |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3375 |
toRevision:rev2 |
2052
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
3376 |
numberOfRevisions:maxCountOrNil |
179 | 3377 |
fileName:classFileName |
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3378 |
directory:packageDir |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3379 |
module:moduleDir. |
96 | 3380 |
|
3381 |
info notNil ifTrue:[ |
|
179 | 3382 |
"/ (sourceInfo includesKey:#renamed) ifTrue:[ |
3383 |
"/ info at:#renamed put:(sourceInfo at:#renamed) |
|
3384 |
"/ ]. |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3385 |
(sourceInfo includesKey:#expectedFileName) ifTrue:[ |
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
3386 |
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
|
3387 |
] |
96 | 3388 |
]. |
3389 |
^ info |
|
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3390 |
|
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3391 |
" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3392 |
SourceCodeManager revisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' |
96 | 3393 |
SourceCodeManager revisionLogOf:XtBoxNew |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3394 |
" |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3395 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
3396 |
"Created: / 06-11-1995 / 18:56:00 / cg" |
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
3397 |
"Modified: / 23-08-2006 / 14:10:50 / cg" |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3398 |
! |
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
3399 |
|
935
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3400 |
revisionLogOf:aClass numberOfRevisions:numRevisions |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3401 |
"return info about the repository container and |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3402 |
(part of) the revisionlog (numRevisions newest revisions) |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3403 |
as a collection of revision entries. |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3404 |
Return nil on failure. |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3405 |
|
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3406 |
The returned information is a structure (IdentityDictionary) |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3407 |
filled with: |
4158 | 3408 |
#container -> the container file name (for container-based SCMs) |
935
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3409 |
#filename -> the actual source file name |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3410 |
#newestRevision -> the revisionString of the newest revision |
1069 | 3411 |
#numberOfRevisions -> the number of revisions in the container (nil for all) |
935
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3412 |
#revisions -> collection of per-revision info (see below) |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3413 |
|
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3414 |
for some classes, additional info is returned: |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3415 |
|
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3416 |
#renamed -> true if the class has been renamed or copied |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3417 |
and the sourceInfo is from the previous one |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3418 |
#expectedFileName -> the filename we would expect (i.e. for the new class) |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3419 |
|
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3420 |
rev1 / rev2 specify from which revisions a logEntry is wanted: |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3421 |
If rev1 is nil, the first revision is the initial revision |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3422 |
otherwise, the log starts with that revision. |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3423 |
If rev2 is nil, the last revision is the newest revision |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3424 |
otherwise, the log ends with that revision. |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3425 |
If both are nil, no logEntries are extracted (i.e. only the header). |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3426 |
|
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3427 |
per revision info consists of one record per revision: |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3428 |
|
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3429 |
#revision -> the revision string |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3430 |
#author -> who checked that revision into the repository |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3431 |
#date -> when was it checked in |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3432 |
#state -> the RCS state |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3433 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3434 |
#logMessage -> the checkIn log message |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3435 |
|
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3436 |
revisions are ordered newest first |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3437 |
(i.e. the last entry is for the initial revision; |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3438 |
the first for the most recent one) |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3439 |
" |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3440 |
|
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3441 |
|sourceInfo packageDir moduleDir classFileName info| |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3442 |
|
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3443 |
sourceInfo := self sourceInfoOfClass:aClass. |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3444 |
sourceInfo isNil ifTrue:[^ nil]. |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3445 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
3446 |
packageDir := self directoryFromSourceInfo:sourceInfo. |
935
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3447 |
moduleDir := self moduleFromSourceInfo:sourceInfo. "/ use the modules name as CVS module |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3448 |
classFileName := self containerFromSourceInfo:sourceInfo. |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3449 |
|
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3450 |
info := self |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3451 |
revisionLogOf:aClass |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3452 |
numberOfRevisions:numRevisions |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3453 |
fileName:classFileName |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3454 |
directory:packageDir |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3455 |
module:moduleDir. |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3456 |
|
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3457 |
info notNil ifTrue:[ |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3458 |
"/ (sourceInfo includesKey:#renamed) ifTrue:[ |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3459 |
"/ info at:#renamed put:(sourceInfo at:#renamed) |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3460 |
"/ ]. |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3461 |
(sourceInfo includesKey:#expectedFileName) ifTrue:[ |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3462 |
info at:#expectedFileName put:(sourceInfo at:#expectedFileName) |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3463 |
] |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3464 |
]. |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3465 |
^ info |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3466 |
|
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3467 |
" |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3468 |
SourceCodeManager revisionLogOf:Array numberOfRevisions:10 |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3469 |
" |
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
3470 |
|
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
3471 |
"Modified: / 23-08-2006 / 14:10:52 / cg" |
935
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3472 |
! |
f5a8e98c8730
added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
3473 |
|
4453 | 3474 |
revisionLogOf:clsOrNil numberOfRevisions:numRevisions fileName:classFileName directory:packageDirOrNil module:moduleDirOrNil |
2600
893edc47b308
copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents:
2592
diff
changeset
|
3475 |
^ self |
893edc47b308
copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents:
2592
diff
changeset
|
3476 |
revisionLogOf:clsOrNil |
893edc47b308
copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents:
2592
diff
changeset
|
3477 |
fromRevision:nil |
893edc47b308
copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents:
2592
diff
changeset
|
3478 |
toRevision:nil |
893edc47b308
copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents:
2592
diff
changeset
|
3479 |
numberOfRevisions:numRevisions |
893edc47b308
copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents:
2592
diff
changeset
|
3480 |
fileName:classFileName |
4453 | 3481 |
directory:packageDirOrNil |
3482 |
module:moduleDirOrNil |
|
3483 |
||
3484 |
"Modified (format): / 07-07-2019 / 23:17:22 / Claus Gittinger" |
|
2600
893edc47b308
copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents:
2592
diff
changeset
|
3485 |
! |
893edc47b308
copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents:
2592
diff
changeset
|
3486 |
|
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3487 |
revisionLogOfContainer:classFileName directory:packageDir module:moduleDir |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3488 |
"return info about the repository container and |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3489 |
(part of) the revisionlog as a collection of revision entries. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3490 |
Return nil on failure. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3491 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3492 |
The returned information is a structure (IdentityDictionary) |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3493 |
filled with: |
4158 | 3494 |
#container -> the container file name (for container-based SCMs) |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3495 |
#filename -> the actual source file name |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3496 |
#newestRevision -> the revisionString of the newest revision |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3497 |
#numberOfRevisions -> the number of revisions in the container |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3498 |
#revisions -> collection of per-revision info (see below) |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3499 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3500 |
per revision info consists of one record per revision: |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3501 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3502 |
#revision -> the revision string |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3503 |
#author -> who checked that revision into the repository |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3504 |
#date -> when was it checked in |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3505 |
#state -> the RCS state |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3506 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3507 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3508 |
revisions are ordered newest first |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3509 |
(i.e. the last entry is for the initial revision; |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3510 |
the first for the most recent one) |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3511 |
" |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3512 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3513 |
^ self |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3514 |
revisionLogOf:nil |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3515 |
fromRevision:nil |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3516 |
toRevision:nil |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3517 |
fileName:classFileName |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3518 |
directory:packageDir |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3519 |
module:moduleDir |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3520 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3521 |
" |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3522 |
CVSSourceCodeManager |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3523 |
revisionLogInFile:'Array.st' directory:'libbasic' module:'stx' |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3524 |
" |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3525 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3526 |
"Modified: 10.1.1997 / 13:29:06 / cg" |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3527 |
! |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3528 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
3529 |
revisionLogOfContainer:fileName module:moduleDir directory:packageDir fromRevision:rev1 toRevision:rev2 |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3530 |
"return info about the repository container and |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3531 |
(part of) the revisionlog as a collection of revision entries. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3532 |
Return nil on failure. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3533 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3534 |
The returned information is a structure (IdentityDictionary) |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3535 |
filled with: |
4158 | 3536 |
#container -> the container file name (for container-based SCMs) |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3537 |
#filename -> the actual source file name |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3538 |
#newestRevision -> the revisionString of the newest revision |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3539 |
#numberOfRevisions -> the number of revisions in the container |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3540 |
#revisions -> collection of per-revision info (see below) |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3541 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3542 |
for some classes, additional info is returned: |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3543 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3544 |
#renamed -> true if the class has been renamed or copied |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3545 |
and the sourceInfo is from the previous one |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3546 |
#expectedFileName -> the filename we would expect (i.e. for the new class) |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3547 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3548 |
rev1 / rev2 specify from which revisions a logEntry is wanted: |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3549 |
If rev1 is nil, the first revision is the initial revision |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3550 |
otherwise, the log starts with that revision. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3551 |
If rev2 is nil, the last revision is the newest revision |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3552 |
otherwise, the log ends with that revision. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3553 |
If both are nil, no logEntries are extracted (i.e. only the header). |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3554 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3555 |
per revision info consists of one record per revision: |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3556 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3557 |
#revision -> the revision string |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3558 |
#author -> who checked that revision into the repository |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3559 |
#date -> when was it checked in |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3560 |
#state -> the RCS state |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3561 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3562 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3563 |
revisions are ordered newest first |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3564 |
(i.e. the last entry is for the initial revision; |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3565 |
the first for the most recent one) |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3566 |
" |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3567 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3568 |
|info| |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3569 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3570 |
info := self |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3571 |
revisionLogOf:nil |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3572 |
fromRevision:rev1 |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3573 |
toRevision:rev2 |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3574 |
fileName:fileName |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3575 |
directory:packageDir |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3576 |
module:moduleDir. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3577 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3578 |
^ info |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3579 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3580 |
" |
1980 | 3581 |
SourceCodeManager |
3582 |
revisionLogOfContainer:'Array.st' |
|
3583 |
module:'stx' |
|
3584 |
directory:'libbasic' |
|
3585 |
fromRevision:'1.1' |
|
3586 |
toRevision:nil |
|
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3587 |
" |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3588 |
|
1663
12a85dc6e7ef
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1594
diff
changeset
|
3589 |
"Created: / 23-08-2006 / 14:14:59 / cg" |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3590 |
! |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
919
diff
changeset
|
3591 |
|
4453 | 3592 |
revisionLogOfFile:aFilename fromRevision:rev1 toRevision:rev2 |
3593 |
"return info about the repository container and |
|
3594 |
(part of) the revisionlog as a collection of revision entries. |
|
3595 |
Return nil on failure. |
|
3596 |
||
3597 |
The returned information is a structure (IdentityDictionary) |
|
3598 |
filled with: |
|
3599 |
#container -> the container file name (for container-based SCMs) |
|
3600 |
#filename -> the actual source file name |
|
3601 |
#newestRevision -> the revisionString of the newest revision |
|
3602 |
#numberOfRevisions -> the number of revisions in the container |
|
3603 |
#revisions -> collection of per-revision info (see below) |
|
3604 |
||
3605 |
for some classes, additional info is returned: |
|
3606 |
||
3607 |
#renamed -> true if the class has been renamed or copied |
|
3608 |
and the sourceInfo is from the previous one |
|
3609 |
#expectedFileName -> the filename we would expect (i.e. for the new class) |
|
3610 |
||
3611 |
rev1 / rev2 specify from which revisions a logEntry is wanted: |
|
3612 |
If rev1 is nil, the first revision is the initial revision |
|
3613 |
otherwise, the log starts with that revision. |
|
3614 |
If rev2 is nil, the last revision is the newest revision |
|
3615 |
otherwise, the log ends with that revision. |
|
3616 |
If both are nil, no logEntries are extracted (i.e. only the header). |
|
3617 |
||
3618 |
per revision info consists of one record per revision: |
|
3619 |
||
3620 |
#revision -> the revision string |
|
3621 |
#author -> who checked that revision into the repository |
|
3622 |
#date -> when was it checked in |
|
3623 |
#state -> the RCS state |
|
3624 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
|
3625 |
||
3626 |
revisions are ordered newest first |
|
3627 |
(i.e. the last entry is for the initial revision; |
|
3628 |
the first for the most recent one) |
|
3629 |
" |
|
3630 |
||
3631 |
^ self |
|
3632 |
revisionLogOfFile:aFilename fromRevision:rev1 toRevision:rev2 |
|
3633 |
finishAfter:nil |
|
3634 |
||
3635 |
"Created: / 07-07-2019 / 23:27:36 / Claus Gittinger" |
|
3636 |
! |
|
3637 |
||
3638 |
revisionLogOfFile:aFilename fromRevision:rev1 toRevision:rev2 finishAfter:maxCountOrNil |
|
3639 |
"return info about the repository container and |
|
3640 |
(part of) the revisionlog as a collection of revision entries. |
|
3641 |
Return nil on failure. |
|
3642 |
||
3643 |
The returned information is a structure (IdentityDictionary) |
|
3644 |
filled with: |
|
3645 |
#container -> the container file name (for container-based SCMs) |
|
3646 |
#filename -> the actual source file name |
|
3647 |
#newestRevision -> the revisionString of the newest revision |
|
3648 |
#numberOfRevisions -> the number of revisions in the container |
|
3649 |
#revisions -> collection of per-revision info (see below) |
|
3650 |
||
3651 |
for some classes, additional info is returned: |
|
3652 |
||
3653 |
#renamed -> true if the class has been renamed or copied |
|
3654 |
and the sourceInfo is from the previous one |
|
3655 |
#expectedFileName -> the filename we would expect (i.e. for the new class) |
|
3656 |
||
3657 |
rev1 / rev2 specify from which revisions a logEntry is wanted: |
|
3658 |
If rev1 is nil, the first revision is the initial revision |
|
3659 |
otherwise, the log starts with that revision. |
|
3660 |
If rev2 is nil, the last revision is the newest revision |
|
3661 |
otherwise, the log ends with that revision. |
|
3662 |
If both are nil, no logEntries are extracted (i.e. only the header). |
|
3663 |
||
3664 |
per revision info consists of one record per revision: |
|
3665 |
||
3666 |
#revision -> the revision string |
|
3667 |
#author -> who checked that revision into the repository |
|
3668 |
#date -> when was it checked in |
|
3669 |
#state -> the RCS state |
|
3670 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
|
3671 |
||
3672 |
revisions are ordered newest first |
|
3673 |
(i.e. the last entry is for the initial revision; |
|
3674 |
the first for the most recent one) |
|
3675 |
" |
|
3676 |
||
3677 |
|info| |
|
3678 |
||
3679 |
info := self |
|
3680 |
revisionLogOf:nil |
|
3681 |
fromRevision:rev1 |
|
3682 |
toRevision:rev2 |
|
3683 |
numberOfRevisions:maxCountOrNil |
|
3684 |
fileName:aFilename |
|
3685 |
directory:nil |
|
3686 |
module:nil. |
|
3687 |
||
3688 |
^ info |
|
3689 |
||
3690 |
" |
|
3691 |
SourceCodeManager revisionLogOfFile:'../../libbasic/Array.st' fromRevision:'1.40' toRevision:'1.43' |
|
3692 |
" |
|
3693 |
||
3694 |
"Created: / 07-07-2019 / 23:28:38 / Claus Gittinger" |
|
3695 |
! |
|
3696 |
||
3697 |
revisionLogOfFile:aFilename numberOfRevisions:numRevisions |
|
3698 |
"return info about the repository container and |
|
3699 |
(part of) the revisionlog (numRevisions newest revisions) |
|
3700 |
as a collection of revision entries. |
|
3701 |
Return nil on failure. |
|
3702 |
||
3703 |
The returned information is a structure (IdentityDictionary) |
|
3704 |
filled with: |
|
3705 |
#container -> the container file name (for container-based SCMs) |
|
3706 |
#filename -> the actual source file name |
|
3707 |
#newestRevision -> the revisionString of the newest revision |
|
3708 |
#numberOfRevisions -> the number of revisions in the container (nil for all) |
|
3709 |
#revisions -> collection of per-revision info (see below) |
|
3710 |
||
3711 |
for some classes, additional info is returned: |
|
3712 |
||
3713 |
#renamed -> true if the class has been renamed or copied |
|
3714 |
and the sourceInfo is from the previous one |
|
3715 |
#expectedFileName -> the filename we would expect (i.e. for the new class) |
|
3716 |
||
3717 |
rev1 / rev2 specify from which revisions a logEntry is wanted: |
|
3718 |
If rev1 is nil, the first revision is the initial revision |
|
3719 |
otherwise, the log starts with that revision. |
|
3720 |
If rev2 is nil, the last revision is the newest revision |
|
3721 |
otherwise, the log ends with that revision. |
|
3722 |
If both are nil, no logEntries are extracted (i.e. only the header). |
|
3723 |
||
3724 |
per revision info consists of one record per revision: |
|
3725 |
||
3726 |
#revision -> the revision string |
|
3727 |
#author -> who checked that revision into the repository |
|
3728 |
#date -> when was it checked in |
|
3729 |
#state -> the RCS state |
|
3730 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
|
3731 |
#logMessage -> the checkIn log message |
|
3732 |
||
3733 |
revisions are ordered newest first |
|
3734 |
(i.e. the last entry is for the initial revision; |
|
3735 |
the first for the most recent one) |
|
3736 |
" |
|
3737 |
||
3738 |
|info| |
|
3739 |
||
3740 |
info := self |
|
3741 |
revisionLogOf:nil |
|
3742 |
numberOfRevisions:numRevisions |
|
3743 |
fileName:aFilename |
|
3744 |
directory:nil |
|
3745 |
module:nil. |
|
3746 |
||
3747 |
^ info |
|
3748 |
||
3749 |
" |
|
3750 |
SourceCodeManager revisionLogOfFile:'../../libbasic/Array.st' numberOfRevisions:10 |
|
3751 |
SourceCodeManager revisionLogOfFile:'../../libbasic/Array.st' numberOfRevisions:nil |
|
3752 |
" |
|
3753 |
||
3754 |
"Created: / 07-07-2019 / 23:15:44 / Claus Gittinger" |
|
3755 |
! |
|
3756 |
||
3597
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3757 |
revisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName revision:revisionString |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3758 |
"utility function: return a string usable as initial revision string. |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3759 |
Can be redefined in subclasses" |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3760 |
|
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3761 |
^ self standardRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName revision:revisionString |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3762 |
|
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3763 |
" |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3764 |
self |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3765 |
revisionStringFor:Array |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3766 |
inModule:'stx' |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3767 |
directory:'libbasic' |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3768 |
container:'Array.st' |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3769 |
revision:'123' |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3770 |
" |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3771 |
! |
f433e8d02208
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3595
diff
changeset
|
3772 |
|
213 | 3773 |
revisionsOf:aClass |
3774 |
"return a collection of revisions (as strings) found in the repository. |
|
3775 |
The most recent (newest) revision will be the first in the list. |
|
3776 |
Return nil on failure." |
|
3777 |
||
3778 |
|log revisions| |
|
3779 |
||
3780 |
log := self revisionLogOf:aClass. |
|
3781 |
log isNil ifTrue:[^ nil]. |
|
3782 |
revisions := log at:#revisions ifAbsent:nil. |
|
3783 |
revisions isNil ifTrue:[^ nil]. |
|
4350 | 3784 |
^ revisions collectColumn:#revision. |
213 | 3785 |
|
3786 |
" |
|
3787 |
SourceCodeManager revisionsOf:Array |
|
3788 |
SourceCodeManager newestRevisionOf:Array |
|
3789 |
" |
|
3790 |
||
4350 | 3791 |
"Modified: / 10-04-1996 / 23:14:24 / cg" |
3792 |
"Created: / 19-04-1996 / 17:24:34 / cg" |
|
3793 |
"Modified: / 22-09-2018 / 11:20:34 / Claus Gittinger" |
|
213 | 3794 |
! |
3795 |
||
2842
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3796 |
standardRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName revision:revisionString |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3797 |
"utility function: return a string usable as initial revision string" |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3798 |
|
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3799 |
^ 'Path: %1/%2/%3, Version: %4, User: %5, Time: %6' |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3800 |
bindWith:moduleDir |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3801 |
with:packageDir |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3802 |
with:fileName |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3803 |
with:revisionString |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3804 |
with:(OperatingSystem getLoginName) |
4316 | 3805 |
with:(Timestamp now printStringIso8601) |
2842
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3806 |
|
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3807 |
" |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3808 |
self |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3809 |
revisionStringFor:Array |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3810 |
inModule:'stx' |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3811 |
directory:'libbasic' |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3812 |
container:'Array.st' |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3813 |
revision:'123' |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3814 |
" |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3815 |
|
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3816 |
"Created: / 23-07-2012 / 18:46:29 / cg" |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3817 |
! |
e707972b6af6
comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents:
2838
diff
changeset
|
3818 |
|
2173 | 3819 |
withSourceRewriteHandlerDo:aBlock |
2380
d17747baf9e9
comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents:
2350
diff
changeset
|
3820 |
"hook for just-in-time rewriting of a method's sourceCode while filing out |
3746
a1c99e6f50b4
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3710
diff
changeset
|
3821 |
used when saving version_XXX methods in a non-XXX sourceCodeManager, |
a1c99e6f50b4
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3710
diff
changeset
|
3822 |
or when generating sourcecode for another Smalltalk system (VSE fileout)" |
2173 | 3823 |
|
3824 |
AbstractSourceFileWriter methodSourceRewriteQuery handle:[:rewriteQuery | |
|
3249
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
3825 |
|m newSource selector| |
2173 | 3826 |
|
3827 |
m := rewriteQuery method. |
|
3828 |
m isVersionMethod ifFalse:[ |
|
3829 |
rewriteQuery proceedWith:rewriteQuery source. |
|
3830 |
]. |
|
3249
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
3831 |
selector := m selector. |
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
3832 |
|
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
3833 |
((self isVersionMethodSelector:selector) "selector = self nameOfVersionMethodInClasses" |
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
3834 |
or:[(self isExtensionsVersionMethodSelector:selector) "selector = self nameOfVersionMethodForExtensions" |
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
3835 |
or:[selector = Class nameOfOldVersionMethod]]) ifTrue:[ |
2173 | 3836 |
"/ it's my version method - make sure that it has $'s around... |
3837 |
newSource := self ensureDollarsInVersionMethod:rewriteQuery source. |
|
3249
ed05b7d7550d
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
3838 |
(selector = Class nameOfOldVersionMethod) ifTrue:[ |
2527
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
3839 |
"/ #version method: make sure that it contains proper |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
3840 |
"/ keyword (Header for CVS/P4, Id for SVN... |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
3841 |
newSource := self ensureKeywordInVersionMethod: newSource. |
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
3842 |
] |
2173 | 3843 |
] ifFalse:[ |
3844 |
"/ it's another manager's version method - make sure that it has NONONO $'s around... |
|
3845 |
newSource := self ensureNoDollarsInVersionMethod:rewriteQuery source. |
|
3846 |
]. |
|
3847 |
rewriteQuery proceedWith:newSource |
|
3848 |
] do:aBlock. |
|
2527
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
3849 |
|
a466b74c0db4
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents:
2510
diff
changeset
|
3850 |
"Modified: / 27-09-2011 / 16:48:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2173 | 3851 |
! |
3852 |
||
3595
507b779720f9
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3587
diff
changeset
|
3853 |
writeHistoryLogSince:timeGoal filterSTSources:filterSTSourcesBoolean |
507b779720f9
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3587
diff
changeset
|
3854 |
filterUser:userFilter filterRepository:repositoryFilter filterModules:moduleFilter |
507b779720f9
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3587
diff
changeset
|
3855 |
filterProjects:projectFilterArg to:aStream |
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3856 |
"send a full historyLog to some stream. |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3857 |
This walks over all possible repository roots." |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3858 |
|
1784 | 3859 |
|projectFilter goalString prevUser prevCvsRoot | |
3860 |
||
3861 |
projectFilter := projectFilterArg isEmptyOrNil ifTrue:nil ifFalse:projectFilterArg. |
|
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3862 |
|
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3863 |
goalString := ''. |
1784 | 3864 |
projectFilter notNil ifTrue:[ |
3865 |
projectFilter size == 1 ifTrue:[ |
|
3866 |
goalString := goalString , 'of ',projectFilter first. |
|
3867 |
] ifFalse:[ |
|
3868 |
projectFilter size == 2 ifTrue:[ |
|
3869 |
goalString := goalString , 'of ',projectFilter first,' and ',projectFilter second. |
|
3870 |
] ifFalse:[ |
|
3871 |
goalString := goalString , 'of ',projectFilter size printString,' projects'. |
|
3872 |
]. |
|
3873 |
]. |
|
3874 |
goalString := goalString,' ' |
|
3875 |
]. |
|
1447
2ac1cf09722b
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
3876 |
(timeGoal notEmptyOrNil) ifTrue:[ |
1784 | 3877 |
goalString := goalString , 'since ' , timeGoal,' '. |
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3878 |
]. |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3879 |
userFilter notNil ifTrue:[ |
1220 | 3880 |
userFilter isString ifTrue:[ |
1784 | 3881 |
goalString := 'by user ',userFilter |
1220 | 3882 |
] ifFalse:[ |
3883 |
userFilter size == 1 ifTrue:[ |
|
1784 | 3884 |
goalString := 'by user ',(userFilter first) |
1220 | 3885 |
] ifFalse:[ |
1784 | 3886 |
goalString := 'by users ',(userFilter first),'...',(userFilter last) |
1220 | 3887 |
] |
3888 |
]. |
|
1784 | 3889 |
goalString := goalString,' '. |
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3890 |
]. |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3891 |
|
1784 | 3892 |
aStream nextPutLine:'**** repository history ' , goalString , '****'. |
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3893 |
aStream cr. |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3894 |
|
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3895 |
self |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3896 |
reportHistoryLogSince:timeGoal |
2100 | 3897 |
filterSTSources:filterSTSourcesBoolean |
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3898 |
filterUser:userFilter |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3899 |
filterRepository:repositoryFilter |
1038 | 3900 |
filterModules:moduleFilter |
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3901 |
inTo:[:info | |
1784 | 3902 |
|user recordType fileName date time rev pkgDir |
3903 |
module directory pkg |
|
3904 |
clsName cvsRoot cls clsRev revInfo| |
|
3905 |
||
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3906 |
pkgDir := info at:#directory ifAbsent:'?'. |
1784 | 3907 |
module := pkgDir upTo:$/. |
3908 |
directory := pkgDir copyFrom:(module size+2). |
|
1910 | 3909 |
pkg := (PackageId module:module directory:directory) asString. |
1784 | 3910 |
|
3911 |
(projectFilter isEmptyOrNil |
|
3595
507b779720f9
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3587
diff
changeset
|
3912 |
or:[ projectFilter contains:[:pat | pat match:pkg caseSensitive:false] ] |
507b779720f9
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
3587
diff
changeset
|
3913 |
) ifTrue:[ |
1784 | 3914 |
|
3915 |
user := info at:#user ifAbsent:'?'. |
|
3916 |
recordType := info at:#cvsRecordType ifAbsent:'?'. |
|
3917 |
fileName := info at:#fileName ifAbsent:'?'. |
|
3918 |
date := info at:#date ifAbsent:'?'. |
|
3919 |
time := info at:#time ifAbsent:'?'. |
|
3920 |
rev := info at:#revision ifAbsent:'?'. |
|
3921 |
||
3922 |
clsName := info at:#className ifAbsent:'?'. |
|
3923 |
cvsRoot := info at:#cvsRoot ifAbsent:'?'. |
|
3924 |
||
3925 |
cvsRoot ~= prevCvsRoot ifTrue:[ |
|
3926 |
aStream cr. |
|
3927 |
aStream nextPutLine:'>>>> repository: ' , cvsRoot , ' <<<<'. |
|
3928 |
aStream cr; cr. |
|
3929 |
aStream nextPutLine:' Date Time User Rev File Package'. |
|
3930 |
prevUser := nil. |
|
3931 |
prevCvsRoot := cvsRoot. |
|
3932 |
]. |
|
3933 |
prevUser ~= user ifTrue:[ |
|
3934 |
aStream cr. |
|
3935 |
prevUser := user. |
|
3936 |
]. |
|
3937 |
aStream |
|
3938 |
nextPutAll:recordType; space; |
|
3939 |
nextPutAll:(date printString paddedTo:10); space; nextPutAll:(time printString paddedTo:5); space; |
|
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3940 |
nextPutAll:(user leftPaddedTo:10); space; |
1784 | 3941 |
nextPutAll:(rev decimalPaddedTo:8 and:4 at:$. withLeft:(Character space) right:nil); tab; |
3942 |
nextPutAll:(fileName paddedTo:30); space; |
|
3943 |
nextPutAll:pkg. |
|
3944 |
||
3945 |
"/ |
|
3946 |
"/ for your convenience: |
|
3947 |
"/ check what the actual version is in the image |
|
3948 |
"/ |
|
3949 |
clsName notNil ifTrue:[ |
|
3950 |
revInfo := nil. |
|
3951 |
cls := Smalltalk classNamed:clsName. |
|
3952 |
(cls notNil and:[(clsRev := cls revision) notNil]) ifTrue:[ |
|
3953 |
rev ~= clsRev ifTrue:[ |
|
3954 |
revInfo := (' current: ' , clsRev) |
|
3955 |
] |
|
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3956 |
] ifFalse:[ |
1784 | 3957 |
cls isNil ifTrue:[ |
3958 |
revInfo := (' current: ** none **') |
|
1480 | 3959 |
] ifFalse:[ |
1784 | 3960 |
cls isLoaded ifTrue:[ |
3961 |
revInfo := (' current: ** no revision info **') |
|
3962 |
] ifFalse:[ |
|
3963 |
revInfo := (' current: ** not loaded **') |
|
3964 |
] |
|
3965 |
] |
|
3966 |
]. |
|
3967 |
revInfo notNil ifTrue:[ |
|
3968 |
aStream nextPutAll:revInfo |
|
3969 |
]. |
|
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3970 |
]. |
1784 | 3971 |
aStream cr |
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3972 |
]. |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3973 |
]. |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
3974 |
|
1784 | 3975 |
"Created: / 12-09-2006 / 15:18:35 / cg" |
1910 | 3976 |
"Modified: / 18-11-2006 / 17:09:55 / cg" |
1784 | 3977 |
! |
3978 |
||
3979 |
writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter filterRepository:repositoryFilter filterModules:moduleFilter to:aStream |
|
3980 |
"send a full historyLog to some stream. |
|
3981 |
This walks over all possible repository roots." |
|
3982 |
||
3983 |
self |
|
3984 |
writeHistoryLogSince:timeGoal |
|
3985 |
filterSTSources:filter |
|
3986 |
filterUser:userFilter |
|
3987 |
filterRepository:repositoryFilter |
|
3988 |
filterModules:moduleFilter |
|
3989 |
filterProjects:nil |
|
3990 |
to:aStream |
|
3991 |
||
3992 |
"Modified: / 12-09-2006 / 15:19:11 / cg" |
|
1038 | 3993 |
! |
3994 |
||
3995 |
writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter filterRepository:repositoryFilter to:aStream |
|
3996 |
"send a full historyLog to some stream. |
|
3997 |
This walks over all possible repository roots." |
|
3998 |
||
3999 |
^self |
|
4000 |
writeHistoryLogSince:timeGoal |
|
4001 |
filterSTSources:filter |
|
4002 |
filterUser:userFilter |
|
4003 |
filterRepository:repositoryFilter |
|
4004 |
filterModules:nil to:aStream |
|
4005 |
||
4006 |
"Modified: / 17.1.2001 / 13:15:54 / cg" |
|
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4007 |
! |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4008 |
|
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4009 |
writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter to:aStream |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4010 |
"send a full historyLog to some stream. |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4011 |
This walks over all possible repository roots." |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4012 |
|
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4013 |
^ self |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4014 |
writeHistoryLogSince:timeGoal |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4015 |
filterSTSources:filter |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4016 |
filterUser:userFilter |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4017 |
filterRepository:nil |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4018 |
to:aStream |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4019 |
! |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4020 |
|
147 | 4021 |
writeHistoryLogSince:timeGoal filterSTSources:filter to:aStream |
472 | 4022 |
"send a repositories historyLog to some stream" |
4023 |
||
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4024 |
^ self |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4025 |
writeHistoryLogSince:timeGoal |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4026 |
filterSTSources:filter |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4027 |
filterUser:nil |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4028 |
filterRepository:nil |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4029 |
to:aStream |
147 | 4030 |
|
472 | 4031 |
"Modified: 12.9.1996 / 02:36:32 / cg" |
147 | 4032 |
! |
4033 |
||
4034 |
writeHistoryLogSince:timeGoal to:aStream |
|
472 | 4035 |
"send a repositories historyLog to some stream" |
4036 |
||
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4037 |
^ self |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4038 |
writeHistoryLogSince:timeGoal |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4039 |
filterSTSources:true |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4040 |
filterUser:nil |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4041 |
filterRepository:nil |
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4042 |
to:aStream |
147 | 4043 |
|
4044 |
"Created: 13.12.1995 / 10:28:27 / cg" |
|
472 | 4045 |
"Modified: 12.9.1996 / 02:36:38 / cg" |
147 | 4046 |
! |
4047 |
||
96 | 4048 |
writeRevisionLogMessagesFrom:log to:aStream |
4049 |
"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
|
4050 |
|
855
ba84e3e5572d
made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents:
853
diff
changeset
|
4051 |
^ self writeRevisionLogMessagesFrom:log withHeader:true to:aStream |
138
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
4052 |
|
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
4053 |
"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
|
4054 |
! |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
4055 |
|
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
4056 |
writeRevisionLogMessagesFrom:log withHeader:header to:aStream |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
4057 |
"helper; send the revisionlog to aStream" |
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
4058 |
|
1451 | 4059 |
|tags| |
4060 |
||
138
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
4061 |
header ifTrue:[ |
179 | 4062 |
"/ (log at:#renamed ifAbsent:false) ifTrue:[ |
4063 |
"/ aStream nextPutAll:' Class was probably renamed; revision info is from original class.'. |
|
4064 |
"/ aStream cr; nextPutAll:' You may have to create a new container for it.'. |
|
4065 |
"/ aStream cr; cr. |
|
4066 |
"/ ]. |
|
138
386f2d831989
optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents:
135
diff
changeset
|
4067 |
|
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
4068 |
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
|
4069 |
aStream nextPutAll:' Newest revision: '; nextPutLine:(log at:#newestRevision) printString. |
1451 | 4070 |
tags := log at:#symbolicNames ifAbsent:nil. |
4071 |
tags notNil ifTrue:[ |
|
4554 | 4072 |
aStream nextPutAll:' Stable revision: '; nextPutLine:(tags at:'stable' ifAbsent:'none'). |
4073 |
aStream nextPutLine:' Symbolic names: '. |
|
1451 | 4074 |
"sort tags by tag name" |
4331 | 4075 |
tags := tags associations sort:[:a :b| (a value compareAsVersionNumberWith:b value) > 0]. |
1451 | 4076 |
tags do:[:eachAssociation| |
4077 |
aStream tab; nextPutAll:eachAssociation key; |
|
4078 |
nextPutAll:': '; |
|
4554 | 4079 |
nextPutLine:eachAssociation value. |
1451 | 4080 |
] |
4081 |
]. |
|
96 | 4082 |
]. |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
4083 |
|
2821
687ec021401e
changed: #writeRevisionLogMessagesFrom:withHeader:to:
Stefan Vogel <sv@exept.de>
parents:
2788
diff
changeset
|
4084 |
(log at:#revisions ifAbsent:#()) do:[:entry | |
4235 | 4085 |
|logMsg color firstLine| |
96 | 4086 |
|
127
7686a4413407
more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents:
123
diff
changeset
|
4087 |
aStream cr. |
2668 | 4088 |
aStream nextPutAll:' revision '; |
3899 | 4089 |
show:(entry at:#revision) allBold; tab. |
2668 | 4090 |
aStream nextPutAll:' date: '; |
4091 |
show:((entry at:#date ifAbsent:nil) ? '?'); space; |
|
4092 |
show:((entry at:#time ifAbsent:nil) ? '?'); tab. |
|
4093 |
aStream nextPutAll:' author: '; |
|
3899 | 4094 |
show:((entry at:#author ifAbsent:nil) ? '?') allBold; tab. |
2668 | 4095 |
aStream nextPutAll:' lines: '; |
4554 | 4096 |
showCR:(entry at:#numberOfChangedLines ifAbsent:nil) ? '?'. |
2668 | 4097 |
|
4098 |
logMsg := entry at:#logMessage ifAbsent:''. |
|
3899 | 4099 |
color := Color orange. |
1467 | 4100 |
(logMsg isBlank or:[logMsg withoutSeparators = '.']) ifTrue:[ |
3899 | 4101 |
logMsg := '*** empty log message ***'. |
4102 |
color := Color red. |
|
4235 | 4103 |
] ifFalse:[ |
4104 |
firstLine := (logMsg upTo:Character cr). |
|
4105 |
((firstLine startsWith:'#') not or:[ (firstLine startsWith:'#BUGFIX') ]) ifTrue:[ |
|
4106 |
color := Color red. |
|
4107 |
] ifFalse:[ |
|
4108 |
(firstLine startsWith:'#DOCUMENTATION') ifTrue:[ |
|
4489 | 4109 |
color := Color gray. |
4235 | 4110 |
]. |
4111 |
]. |
|
4112 |
]. |
|
3899 | 4113 |
logMsg asCollectionOfLines do:[:eachLine | |
4114 |
aStream tab. |
|
4030 | 4115 |
aStream nextPutAllText:(eachLine withColor:color); cr. |
3899 | 4116 |
]. |
93
83042eccb8d1
revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents:
87
diff
changeset
|
4117 |
]. |
96 | 4118 |
|
2668 | 4119 |
"Created: / 16-11-1995 / 13:25:30 / cg" |
4120 |
"Modified: / 27-11-1996 / 18:26:30 / stefan" |
|
4235 | 4121 |
"Modified (format): / 16-05-2017 / 12:21:32 / cg" |
4331 | 4122 |
"Modified: / 20-06-2018 / 11:08:34 / Stefan Vogel" |
4424 | 4123 |
"Modified (comment): / 12-05-2019 / 13:01:29 / Claus Gittinger" |
73 | 4124 |
! |
4125 |
||
2052
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4126 |
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 finishAfter:maxCount to:aStream |
73 | 4127 |
"extract a classes log and append it to aStream." |
4128 |
||
96 | 4129 |
|log | |
73 | 4130 |
|
2052
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4131 |
log := self revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 finishAfter:maxCount. |
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
4132 |
log isNil ifTrue:[ |
1024
7344e4e24b1c
missing repository-log message beautified
Claus Gittinger <cg@exept.de>
parents:
1021
diff
changeset
|
4133 |
aStream cr; nextPutAll:' ** No revision log available **'. |
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
4134 |
^ false |
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
4135 |
]. |
96 | 4136 |
|
4137 |
self writeRevisionLogMessagesFrom:log to:aStream. |
|
4138 |
^ true |
|
73 | 4139 |
|
4140 |
" |
|
77 | 4141 |
SourceCodeManager writeRevisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' to:Transcript |
73 | 4142 |
" |
4143 |
||
4144 |
"Created: 6.11.1995 / 18:56:00 / cg" |
|
545
198957db4e32
restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents:
537
diff
changeset
|
4145 |
"Modified: 14.2.1997 / 21:11:57 / cg" |
77 | 4146 |
! |
4147 |
||
2052
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4148 |
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 to:aStream |
87 | 4149 |
"extract a classes log and append it to aStream." |
4150 |
||
4151 |
^ self |
|
2052
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4152 |
writeRevisionLogOf:aClass |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4153 |
fromRevision:rev1 toRevision:rev2 |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4154 |
finishAfter:nil to:aStream |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4155 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4156 |
" |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4157 |
SourceCodeManager writeRevisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' to:Transcript |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4158 |
" |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4159 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4160 |
"Created: 6.11.1995 / 18:56:00 / cg" |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4161 |
"Modified: 14.2.1997 / 21:11:57 / cg" |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4162 |
! |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4163 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4164 |
writeRevisionLogOf:aClass short:shortOrNot to:aStream |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4165 |
"extract a classes log and append it to aStream." |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4166 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4167 |
^ self |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4168 |
writeRevisionLogOf:aClass |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4169 |
fromRevision:nil |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4170 |
toRevision:nil |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4171 |
finishAfter:(shortOrNot ifTrue:20 ifFalse:nil) |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4172 |
to:aStream |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4173 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4174 |
" |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4175 |
SourceCodeManager writeRevisionLogOf:Array to:Transcript |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4176 |
" |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4177 |
! |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4178 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4179 |
writeRevisionLogOf:aClass to:aStream |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4180 |
"extract a classes log and append it to aStream." |
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4181 |
|
61be9856344e
+option to show a short revision log
Claus Gittinger <cg@exept.de>
parents:
2043
diff
changeset
|
4182 |
^ self writeRevisionLogOf:aClass short:false to:aStream |
77 | 4183 |
|
87 | 4184 |
" |
4185 |
SourceCodeManager writeRevisionLogOf:Array to:Transcript |
|
4186 |
" |
|
4187 |
! ! |
|
77 | 4188 |
|
4158 | 4189 |
!AbstractSourceCodeManager class methodsFor:'source code utilities'! |
4190 |
||
4191 |
diffListFor:clsOrNil fileName:classFileName directory:packageDir module:moduleDir revision1:rev1 revision2:rev2 |
|
4192 |
"return diff info. This is supposed to return a standard diff-like |
|
4193 |
list of lines, representing the diffs between two revisions. |
|
4194 |
experimental (for ownershipGraph)" |
|
4195 |
||
4196 |
^ self |
|
4197 |
diffListFor:clsOrNil fileName:classFileName directory:packageDir module:moduleDir revision1:rev1 revision2:rev2 |
|
4198 |
cache:true |
|
4199 |
! |
|
4200 |
||
4201 |
diffListFor:clsOrNil fileName:classFileNameArg directory:packageDirArg module:moduleDirArg revision1:rev1 revision2:rev2 cache:cacheIt |
|
4202 |
"return diff info. This is supposed to return a standard diff-like |
|
4203 |
list of lines, representing the diffs between two revisions. |
|
4204 |
experimental (for ownershipGraph). |
|
4205 |
This fallback retrieves the two versions and calls a diff" |
|
4206 |
||
4207 |
|fullName modulePath inStream list msg cacheDir cachedFile classFileName diffDir |
|
4208 |
sourceStream1 sourceStream2 source1 source2 tmpSource1 tmpSource2 |
|
4209 |
moduleDir packageDir| |
|
4210 |
||
4211 |
moduleDir := moduleDirArg. |
|
4212 |
packageDir := packageDirArg. |
|
4213 |
||
4214 |
clsOrNil notNil ifTrue:[ |
|
4215 |
modulePath := clsOrNil package copyReplaceAll:$: with:$/. |
|
4216 |
moduleDir := clsOrNil package asPackageId module. |
|
4217 |
packageDir := clsOrNil package asPackageId directory. |
|
4218 |
fullName := modulePath , '/' , (classFileName := clsOrNil classFilename). |
|
4219 |
] ifFalse:[ |
|
4220 |
modulePath := moduleDir , '/' , packageDir. |
|
4221 |
fullName := modulePath , '/' , (classFileName := classFileNameArg). |
|
4222 |
]. |
|
4223 |
||
4224 |
(cacheIt) ifTrue:[ |
|
4225 |
(cacheDir := self sourceCacheDirectory) isNil ifTrue:[ |
|
4226 |
('SourceCodeManager [warning]: no source cache directory') infoPrintCR. |
|
4227 |
] ifFalse:[ |
|
4415 | 4228 |
diffDir := cacheDir / modulePath / '.diffs'. |
4158 | 4229 |
diffDir exists ifFalse:[ |
4415 | 4230 |
diffDir |
4231 |
recursiveMakeDirectoryForEachCreatedDo:[:dirName| dirName accessRights:cacheDir accessRights]. |
|
4158 | 4232 |
]. |
4233 |
cachedFile := diffDir / (classFileName,'_',rev1,'_',rev2). |
|
4234 |
cachedFile exists ifTrue:[ |
|
4235 |
^ cachedFile contents |
|
4236 |
]. |
|
4237 |
]. |
|
4238 |
]. |
|
4239 |
||
4240 |
msg := 'SourceCodeManager: Fetching diff list of '. |
|
4241 |
clsOrNil isNil ifTrue:[ |
|
4242 |
msg := msg , fullName. |
|
4243 |
] ifFalse:[ |
|
4244 |
msg := msg , clsOrNil name. |
|
4245 |
]. |
|
4246 |
msg := msg , ' ' , rev1 , ' vs. ' , rev2. |
|
4247 |
self activityNotification:msg. |
|
4248 |
||
4249 |
sourceStream1 := self |
|
4250 |
streamForClass:clsOrNil |
|
4251 |
fileName:classFileName |
|
4252 |
revision:rev1 |
|
4253 |
directory:packageDir |
|
4254 |
module:moduleDir |
|
4255 |
cache:cacheIt. |
|
4256 |
source1 := sourceStream1 contents. |
|
4257 |
sourceStream1 close. |
|
4258 |
tmpSource1 := Filename newTemporary. |
|
4259 |
tmpSource1 contents:source1. |
|
4260 |
||
4261 |
sourceStream2 := self |
|
4262 |
streamForClass:clsOrNil |
|
4263 |
fileName:classFileName |
|
4264 |
revision:rev2 |
|
4265 |
directory:packageDir |
|
4266 |
module:moduleDir |
|
4267 |
cache:cacheIt. |
|
4268 |
source2 := sourceStream2 contents. |
|
4269 |
sourceStream2 close. |
|
4270 |
tmpSource2 := Filename newTemporary. |
|
4271 |
tmpSource2 contents:source2. |
|
4272 |
||
4399 | 4273 |
list := [ |
4158 | 4274 |
inStream := PipeStream readingFrom:('diff %1 %2' bindWith:tmpSource1 pathName with:tmpSource1 pathName ). |
4275 |
inStream isNil ifTrue:[ |
|
4276 |
('SourceCodeManager [error]: cannot open pipe to diff ', fullName) errorPrintCR. |
|
4277 |
^ nil |
|
4278 |
]. |
|
4399 | 4279 |
inStream contents. |
4158 | 4280 |
] ensure:[ |
4399 | 4281 |
inStream notNil ifTrue:[ |
4282 |
inStream close. |
|
4283 |
]. |
|
4158 | 4284 |
tmpSource1 remove. |
4285 |
tmpSource2 remove. |
|
4286 |
]. |
|
4287 |
list := list reject:[:line | line startsWith:'\ ']. |
|
4288 |
||
4289 |
cachedFile notNil ifTrue:[ |
|
4290 |
cachedFile contents:list. |
|
4291 |
]. |
|
4292 |
^ list |
|
4399 | 4293 |
|
4294 |
"Modified: / 12-02-2019 / 20:01:35 / Stefan Vogel" |
|
4158 | 4295 |
! |
4296 |
||
4297 |
ensureDollarsInVersionMethod:aString |
|
4298 |
"given the source code of my version method, ensure that it contains dollars for |
|
4299 |
proper keyword expansion" |
|
4300 |
||
4301 |
|versionString| |
|
4302 |
||
4449 | 4303 |
versionString := aString copyWithout: $§. |
4158 | 4304 |
^ self ensureKeywordExpansionWith: $$ inVersionMethod:versionString. |
4305 |
||
4306 |
" |
|
4307 |
self ensureDollarsInVersionMethod:'foo ^ ''hello'' ' |
|
4449 | 4308 |
self ensureDollarsInVersionMethod:'foo ^ ''§hello§'' ' |
4158 | 4309 |
self ensureDollarsInVersionMethod:'foo ^ '' hello '' ' |
4310 |
self ensureDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' ' |
|
4398 | 4311 |
self ensureDollarsInVersionMethod:'foo ^ ''$Head'' ' |
4158 | 4312 |
-- errors: |
4313 |
self ensureDollarsInVersionMethod:'foo ^ ''Header$'' ' |
|
4314 |
" |
|
4398 | 4315 |
|
4316 |
"Modified (comment): / 12-02-2019 / 00:03:45 / Claus Gittinger" |
|
4158 | 4317 |
! |
4318 |
||
4319 |
ensureKeyword: keyword inVersionMethod: source |
|
4320 |
||
4321 |
| startQuote endQuote doubleColon | |
|
4322 |
||
4323 |
"/nil keyword means that given source code management system |
|
4324 |
"/does not expand keywords (StORE or Monticello, for example) |
|
4325 |
keyword isNil ifTrue:[ |
|
4326 |
^source. |
|
4327 |
]. |
|
4328 |
||
4329 |
startQuote := source indexOf: $'. |
|
4330 |
startQuote == 0 ifTrue:[ |
|
4331 |
self error:'Does not seem to be a valid version method source. Invalid source?' |
|
4332 |
]. |
|
4333 |
(source at: startQuote + 1) == $$ ifFalse:[ |
|
4334 |
self error:'Does not seem to be a valid version method source. Invalid source?' |
|
4335 |
]. |
|
4336 |
||
4337 |
endQuote := source lastIndexOf: $'. |
|
4338 |
startQuote == endQuote ifTrue:[ |
|
4339 |
self error:'Does not seem to be a valid version method source. Invalid source?' |
|
4340 |
]. |
|
4341 |
(source at: endQuote - 1) == $$ ifFalse:[ |
|
4342 |
self error:'Does not seem to be a valid version method source. Invalid source?' |
|
4343 |
]. |
|
4344 |
||
4345 |
doubleColon := source indexOf: $: startingAt: startQuote + 2. |
|
4346 |
"/ There may be no double colon at all, if the version method |
|
4347 |
"/ is fresh, like 'dollar-Header-dollar' (no real dollar here, as cvs expands the string) |
|
4348 |
(doubleColon == 0 or:[doubleColon > endQuote]) ifTrue:[ |
|
4349 |
doubleColon := endQuote - 1. |
|
4350 |
]. |
|
4351 |
||
4352 |
(source copyFrom: startQuote + 2 to: doubleColon - 1) = keyword ifTrue:[ |
|
4353 |
"/ Good, desired keyword is already there |
|
4354 |
^source |
|
4355 |
]. |
|
4356 |
||
4357 |
^(source copyTo: startQuote + 1) , keyword , (source copyFrom: doubleColon) |
|
4358 |
||
4359 |
"Created: / 27-09-2011 / 15:00:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4360 |
"Modified (comment): / 26-01-2012 / 14:52:19 / cg" |
|
4361 |
! |
|
4362 |
||
4363 |
ensureKeywordExpansionWith: aCharacter inVersionMethod:aString |
|
4364 |
"given the source code of my version method, ensure that it contains aCharacter for |
|
4365 |
proper keyword expansion" |
|
4366 |
||
4398 | 4367 |
|indexOfFirstQuote indexOfSecondQuote |
4368 |
indexOfNextAfterFirstQuote indexOfSecondDollar indexOfNextAfterSecondDollar indexOfLastQuote| |
|
4158 | 4369 |
|
4370 |
indexOfFirstQuote := aString indexOf:$'. |
|
4371 |
indexOfFirstQuote == 0 ifTrue:[ |
|
4372 |
"/ no ' found - mhmh is this a valid version method's source ? |
|
4373 |
^ aString |
|
4374 |
]. |
|
4375 |
indexOfNextAfterFirstQuote := aString indexOfNonSeparatorStartingAt:indexOfFirstQuote+1. |
|
4376 |
(aString at:indexOfNextAfterFirstQuote) = aCharacter ifTrue:[ |
|
4377 |
indexOfSecondDollar := aString indexOf:aCharacter startingAt:indexOfNextAfterFirstQuote+1. |
|
4378 |
((indexOfSecondDollar == 0) |
|
4379 |
or:[ indexOfNextAfterSecondDollar := aString indexOfNonSeparatorStartingAt:indexOfSecondDollar+1. |
|
4380 |
(aString at:indexOfNextAfterSecondDollar) ~= $' |
|
4381 |
]) ifTrue:[ |
|
4398 | 4382 |
indexOfSecondQuote := aString indexOf:$' startingAt:indexOfFirstQuote+1. |
4383 |
indexOfSecondQuote ~~ 0 ifTrue:[ |
|
4384 |
^ (aString copyTo:indexOfSecondQuote-1),aCharacter asString,(aString copyFrom:indexOfSecondQuote) |
|
4385 |
]. |
|
4158 | 4386 |
self error:'invalid source (no valid version method string)' |
4387 |
]. |
|
4388 |
"/ fine |
|
4389 |
^ aString |
|
4390 |
]. |
|
4391 |
||
4392 |
indexOfLastQuote := aString lastIndexOf:$'. |
|
4393 |
||
4394 |
^ (aString copyTo:indexOfFirstQuote) |
|
4395 |
, aCharacter asString |
|
4396 |
,(aString copyFrom:indexOfFirstQuote+1 to:indexOfLastQuote-1) |
|
4397 |
,aCharacter asString ,(aString copyFrom:indexOfLastQuote) |
|
4398 |
||
4399 |
" |
|
4449 | 4400 |
self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''hello'' ' |
4401 |
self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ '' hello '' ' |
|
4402 |
self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.218 2009/10/07 12:12:30 fm Exp §'' ' |
|
4158 | 4403 |
|
4404 |
self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''hello'' ' |
|
4405 |
self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ '' hello '' ' |
|
4406 |
self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' ' |
|
4407 |
||
4449 | 4408 |
self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Head'' ' |
4409 |
self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''Header§'' ' |
|
4158 | 4410 |
" |
4398 | 4411 |
|
4412 |
"Modified: / 12-02-2019 / 00:12:06 / Claus Gittinger" |
|
4158 | 4413 |
! |
4414 |
||
4415 |
ensureKeywordInVersionMethod: source |
|
4416 |
||
4398 | 4417 |
^self ensureKeyword:(self versionMethodKeyword) inVersionMethod: source |
4158 | 4418 |
|
4419 |
"Created: / 27-09-2011 / 14:50:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4398 | 4420 |
"Modified (format): / 12-02-2019 / 00:04:07 / Claus Gittinger" |
4158 | 4421 |
! |
4422 |
||
4423 |
ensureNoDollarsInVersionMethod:aString |
|
4424 |
"given the source code of another manager's version method, ensure that it does NOT |
|
4449 | 4425 |
contain dollars and add $§ instead, to avoid that CVS expands keywords in it" |
4158 | 4426 |
|
4427 |
|versionString| |
|
4428 |
||
4429 |
versionString := aString copyWithout: $$. |
|
4449 | 4430 |
^ self ensureKeywordExpansionWith: $§ inVersionMethod:versionString. |
4158 | 4431 |
|
4432 |
" |
|
4433 |
self ensureNoDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' ' |
|
4434 |
self ensureNoDollarsInVersionMethod:'foo ^ ''$','Head'' ' |
|
4435 |
self ensureNoDollarsInVersionMethod:'foo ^ ''Header$'' ' |
|
4449 | 4436 |
self ensureNoDollarsInVersionMethod:'foo ^ ''§Header§'' ' |
4158 | 4437 |
|
4438 |
-- errors: |
|
4439 |
||
4449 | 4440 |
self ensureNoDollarsInVersionMethod:'foo ^ ''§Header'' ' |
4441 |
self ensureNoDollarsInVersionMethod:'foo ^ ''Header§'' ' |
|
4158 | 4442 |
|
4443 |
" |
|
4444 |
! |
|
4445 |
||
4446 |
extractKeyValueFor:key fromRevisionString:aString |
|
4447 |
"{ Pragma: +optSpace }" |
|
4448 |
||
4449 |
"extract a particular value from a string which has the format: |
|
4450 |
key1: value1, key2: value2, .... keyN: valueN" |
|
4451 |
||
4452 |
|value idx1 idx2| |
|
4453 |
||
4454 |
"/ 'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826' |
|
4455 |
||
4456 |
idx1 := aString indexOfSubCollection:(key,': '). |
|
4457 |
idx1 ~~ 0 ifTrue:[ |
|
4458 |
idx1 := idx1 + (key,': ') size. |
|
4459 |
idx2 := aString indexOfSubCollection:', ' startingAt:idx1. |
|
4460 |
idx2 == 0 ifTrue:[ idx2 := aString size + 1 ]. |
|
4461 |
value := aString copyFrom:idx1 to:idx2-1. |
|
4462 |
]. |
|
4463 |
^ value |
|
4464 |
||
4465 |
" |
|
4466 |
self |
|
4467 |
extractKeyValueFor:'Path' |
|
4468 |
fromRevisionString:'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826' |
|
4469 |
||
4470 |
self |
|
4471 |
extractKeyValueFor:'Time' |
|
4472 |
fromRevisionString:'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826' |
|
4473 |
" |
|
4474 |
! ! |
|
4475 |
||
1205 | 4476 |
!AbstractSourceCodeManager class methodsFor:'subclass responsibility'! |
4477 |
||
4478 |
reportHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter |
|
4479 |
filterRepository:repositoryFilter filterModules:moduleFilter inTo:aBlock |
|
4480 |
||
4420 | 4481 |
"process a full historyLog, evaluate aBlock for each entry, passing |
4482 |
each logs' info in a dictionary. |
|
4483 |
This walks over all possible repositories. |
|
4484 |
filterRep may be a collection of repository names (eg. 'stx', 'exept', 'phx' etc.) to only report changes made to one |
|
4485 |
of those repositories. |
|
4486 |
userFilter, if a non-nil string or stringCollection, |
|
4487 |
will filter only changes made by that user(s) (eg. 'sv' or #('sv' 'cg')). |
|
4488 |
filterModules, if non-empty, will only present changes in that module (eg. 'stx:libbasic')" |
|
4489 |
||
1205 | 4490 |
^ self subclassResponsibility |
4420 | 4491 |
|
4492 |
"Modified (comment): / 08-05-2019 / 10:22:30 / Claus Gittinger" |
|
1205 | 4493 |
! ! |
4494 |
||
1527 | 4495 |
!AbstractSourceCodeManager class methodsFor:'testing'! |
4496 |
||
4497 |
isCVS |
|
4498 |
^ false |
|
4499 |
||
4500 |
"Created: / 16-08-2006 / 10:58:27 / cg" |
|
4501 |
! |
|
4502 |
||
2786 | 4503 |
isGit |
4504 |
^ false |
|
4505 |
||
4506 |
"Created: / 02-03-2012 / 16:44:02 / cg" |
|
4507 |
! |
|
4508 |
||
2725 | 4509 |
isMercurial |
4510 |
^ false |
|
4511 |
||
4512 |
"Created: / 14-01-2012 / 21:54:19 / cg" |
|
4513 |
! |
|
4514 |
||
2199 | 4515 |
isSVN |
1527 | 4516 |
^ false |
4517 |
||
2199 | 4518 |
"Created: / 16-08-2006 / 10:58:27 / cg" |
1527 | 4519 |
! |
4520 |
||
1890 | 4521 |
isSmallTeam |
1889 | 4522 |
^ false |
4523 |
||
1890 | 4524 |
"Created: / 09-11-2006 / 14:30:22 / cg" |
1889 | 4525 |
! |
4526 |
||
1527 | 4527 |
isStore |
4528 |
^ false |
|
4529 |
||
4530 |
"Created: / 16-08-2006 / 10:59:26 / cg" |
|
4531 |
! ! |
|
4532 |
||
2445 | 4533 |
!AbstractSourceCodeManager::PackageAndManager class methodsFor:'instance creation'! |
4534 |
||
4535 |
package: package manager: manager |
|
4536 |
||
4537 |
^self new |
|
4538 |
package: package; |
|
4539 |
manager: manager. |
|
4540 |
||
4541 |
"Created: / 09-07-2011 / 13:58:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4542 |
! ! |
|
4543 |
||
4544 |
!AbstractSourceCodeManager::PackageAndManager methodsFor:'accessing'! |
|
4545 |
||
4546 |
manager |
|
4547 |
||
4548 |
^AbstractSourceCodeManager named: managerTypeName |
|
4549 |
||
4550 |
"Created: / 09-07-2011 / 13:52:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4551 |
! |
|
4552 |
||
4553 |
manager: aSourceCodeManager |
|
4554 |
||
4555 |
managerTypeName := aSourceCodeManager managerTypeName |
|
4556 |
||
4557 |
"Created: / 09-07-2011 / 13:59:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4558 |
! |
|
4559 |
||
4560 |
managerTypeName |
|
4561 |
^ managerTypeName |
|
4562 |
! |
|
4563 |
||
4564 |
managerTypeName:something |
|
4565 |
managerTypeName := something. |
|
4566 |
! |
|
4567 |
||
4568 |
package |
|
4569 |
^ package |
|
4570 |
! |
|
4571 |
||
4572 |
package:something |
|
4573 |
package := something. |
|
4574 |
! ! |
|
4575 |
||
2477 | 4576 |
!AbstractSourceCodeManager::PackageAndManager methodsFor:'comparing'! |
4577 |
||
4578 |
= aPackageAndManagerOrNil |
|
4579 |
aPackageAndManagerOrNil isNil ifTrue:[^ false]. |
|
4580 |
aPackageAndManagerOrNil package = package ifFalse:[^ false]. |
|
4581 |
aPackageAndManagerOrNil managerTypeName = managerTypeName ifFalse:[^ false]. |
|
4582 |
^ true |
|
4583 |
||
4584 |
"Created: / 19-08-2011 / 01:47:34 / cg" |
|
4585 |
! |
|
4586 |
||
4587 |
hash |
|
4588 |
^ package hash bitXor: managerTypeName hash |
|
4589 |
||
4590 |
"Created: / 19-08-2011 / 01:47:56 / cg" |
|
4591 |
! ! |
|
4592 |
||
2445 | 4593 |
!AbstractSourceCodeManager::PackageAndManager methodsFor:'displaying'! |
4594 |
||
4595 |
displayStringForManagerTypeName |
|
4596 |
^ self manager isNil |
|
4597 |
ifFalse:[ managerTypeName ] |
|
4598 |
ifTrue: |
|
4489 | 4599 |
[ (managerTypeName , ' (unavailable)') allGray ]. |
2445 | 4600 |
|
4601 |
"Created: / 09-07-2011 / 14:05:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4602 |
! |
|
4603 |
||
4604 |
displayStringForPackage |
|
4605 |
^ self manager isNil |
|
4489 | 4606 |
ifTrue:[ package allGray ] |
2445 | 4607 |
ifFalse:[ package ] |
4608 |
||
4609 |
"Created: / 09-07-2011 / 14:05:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2638
b987066502c4
added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents:
2634
diff
changeset
|
4610 |
"Modified: / 03-12-2011 / 11:31:49 / cg" |
2445 | 4611 |
! ! |
4612 |
||
2623
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4613 |
!AbstractSourceCodeManager::PackageAndManager methodsFor:'printing & storing'! |
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4614 |
|
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4615 |
printOn:aStream |
4068 | 4616 |
"append a printed representation of the receiver to the argument, aStream" |
2623
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4617 |
|
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4618 |
super printOn:aStream. |
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4619 |
aStream nextPut: $(. |
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4620 |
package printOn:aStream. |
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4621 |
aStream nextPutAll:' -> '. |
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4622 |
managerTypeName printOn:aStream. |
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4623 |
aStream nextPut: $). |
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4624 |
|
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4625 |
"Modified: / 25-11-2011 / 18:35:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4626 |
! ! |
4ba16827aa35
added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents:
2606
diff
changeset
|
4627 |
|
2445 | 4628 |
!AbstractSourceCodeManager::PackageAndManager methodsFor:'queries'! |
4629 |
||
4630 |
match: packageId |
|
4158 | 4631 |
| manager packageMatches| |
2606 | 4632 |
|
2445 | 4633 |
manager := self manager. |
2606 | 4634 |
manager isNil ifTrue:[^false]. |
4635 |
||
4158 | 4636 |
packageMatches := package includesMatchCharacters |
4637 |
ifTrue:[ package match: packageId ] |
|
4638 |
ifFalse:[ packageId startsWith:(package,':') ]. |
|
4639 |
^ packageMatches and: [manager isResponsibleForPackage: packageId] |
|
2445 | 4640 |
|
4641 |
" |
|
4642 |
self managerForModule:'stx:libbasic' |
|
4643 |
self managerForModule:'stx:libbasic2' |
|
4644 |
self managerForModule:'exept:expecco' |
|
4645 |
" |
|
4646 |
||
4647 |
"Created: / 09-07-2011 / 14:26:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2606 | 4648 |
"Modified (format): / 18-11-2011 / 14:07:53 / cg" |
2445 | 4649 |
! ! |
4650 |
||
513
10707a1c366f
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
4651 |
!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
|
4652 |
|
2529
302c2c58caa7
changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
4653 |
version |
3888
202109d7ba22
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3815
diff
changeset
|
4654 |
^ '$Header$' |
2851
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
4655 |
! |
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
4656 |
|
3c62bf0dcacb
added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents:
2842
diff
changeset
|
4657 |
version_CVS |
3888
202109d7ba22
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3815
diff
changeset
|
4658 |
^ '$Header$' |
2529
302c2c58caa7
changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
4659 |
! |
302c2c58caa7
changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
4660 |
|
2838 | 4661 |
version_SVN |
3888
202109d7ba22
class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
3815
diff
changeset
|
4662 |
^ '$Id$' |
123
9a1dff152656
dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents:
122
diff
changeset
|
4663 |
! ! |
1202 | 4664 |
|
3131
d203000b91af
class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents:
2980
diff
changeset
|
4665 |
|
158
27f76f9d8a25
preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
4666 |
AbstractSourceCodeManager initialize! |