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