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