author | Claus Gittinger <cg@exept.de> |
Sun, 26 Oct 2003 16:26:20 +0100 | |
changeset 1338 | bad5961fbff1 |
parent 1323 | 18fefc941a32 |
child 1339 | 9a1e91c28cb3 |
permissions | -rw-r--r-- |
906 | 1 |
" |
2 |
COPYRIGHT (c) 2000 eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
920 | 14 |
"{ Package: 'stx:libbasic3' }" |
15 |
||
873 | 16 |
Object subclass:#SourceCodeManagerUtilities |
1053
bbf6a1d5d3f7
Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
1051
diff
changeset
|
17 |
instanceVariableNames:'' |
bbf6a1d5d3f7
Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
1051
diff
changeset
|
18 |
classVariableNames:'LastSourceLogMessage LastModule LastPackage YesToAllQuery |
bbf6a1d5d3f7
Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
1051
diff
changeset
|
19 |
YesToAllNotification' |
bbf6a1d5d3f7
Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
1051
diff
changeset
|
20 |
poolDictionaries:'' |
bbf6a1d5d3f7
Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
1051
diff
changeset
|
21 |
category:'System-SourceCodeManagement' |
873 | 22 |
! |
23 |
||
24 |
!SourceCodeManagerUtilities class methodsFor:'documentation'! |
|
25 |
||
906 | 26 |
copyright |
27 |
" |
|
28 |
COPYRIGHT (c) 2000 eXept Software AG |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
||
39 |
! |
|
40 |
||
873 | 41 |
documentation |
42 |
" |
|
43 |
utility code which is useful at more than one place |
|
44 |
(extracted from the browser) |
|
45 |
||
46 |
[author:] |
|
47 |
Claus Gittinger (cg@exept) |
|
48 |
||
49 |
[see also:] |
|
50 |
||
51 |
[instance variables:] |
|
52 |
||
53 |
[class variables:] |
|
54 |
" |
|
55 |
! ! |
|
56 |
||
992 | 57 |
!SourceCodeManagerUtilities class methodsFor:'Signal constants'! |
58 |
||
59 |
yesToAllNotification |
|
60 |
YesToAllNotification isNil ifTrue:[ |
|
61 |
YesToAllNotification := QuerySignal new. |
|
62 |
]. |
|
63 |
^ YesToAllNotification |
|
64 |
! |
|
65 |
||
66 |
yesToAllQuery |
|
67 |
YesToAllQuery isNil ifTrue:[ |
|
68 |
YesToAllQuery := QuerySignal new. |
|
69 |
]. |
|
70 |
^ YesToAllQuery |
|
71 |
! ! |
|
72 |
||
1084 | 73 |
!SourceCodeManagerUtilities class methodsFor:'accessing'! |
74 |
||
75 |
lastModule |
|
76 |
"return the value of the static variable 'LastModule' (automatically generated)" |
|
77 |
||
78 |
^ LastModule |
|
79 |
! |
|
80 |
||
81 |
lastModule:something |
|
82 |
"set the value of the static variable 'LastModule' (automatically generated)" |
|
83 |
||
84 |
LastModule := something. |
|
85 |
! |
|
86 |
||
87 |
lastPackage |
|
88 |
"return the value of the static variable 'LastPackage' (automatically generated)" |
|
89 |
||
90 |
^ LastPackage |
|
91 |
! |
|
92 |
||
93 |
lastPackage:something |
|
94 |
"set the value of the static variable 'LastPackage' (automatically generated)" |
|
95 |
||
96 |
LastPackage := something. |
|
97 |
! ! |
|
98 |
||
873 | 99 |
!SourceCodeManagerUtilities class methodsFor:'utilities'! |
100 |
||
893 | 101 |
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName |
102 |
"open a dialog asking for a source container; |
|
103 |
return a dictionary containing module, package and filename, |
|
104 |
or nil if canceled." |
|
105 |
||
1030 | 106 |
^ self |
107 |
askForContainer:boxText title:title note:notice |
|
108 |
initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName |
|
109 |
forNewContainer:true |
|
110 |
! |
|
111 |
||
112 |
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName forNewContainer:forNewContainer |
|
113 |
"open a dialog asking for a source container; |
|
114 |
return a dictionary containing module, package and filename, |
|
115 |
or nil if canceled." |
|
116 |
||
1065
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
117 |
|box y component resources answer |
893 | 118 |
moduleHolder packageHolder fileNameHolder |
933
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
119 |
module package fileName |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
120 |
knownContainers knownPackages packageUpdater |
1030 | 121 |
packageBoxComponent fileNameBoxComponent fileNameUpdater| |
933
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
122 |
|
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
123 |
knownContainers := Set new. |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
124 |
Smalltalk allClassesDo:[:cls | |pckg| |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
125 |
pckg := cls package. |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
126 |
pckg size > 0 ifTrue:[ |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
127 |
knownContainers add:(pckg upTo:$:) |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
128 |
] |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
129 |
]. |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
130 |
knownContainers := knownContainers asOrderedCollection. |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
131 |
knownContainers := knownContainers select:[:module | module isBlank not]. |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
132 |
knownContainers sort. |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
133 |
|
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
134 |
packageUpdater := [ |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
135 |
|theModulePrefix| |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
136 |
|
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
137 |
theModulePrefix := moduleHolder value , ':'. |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
138 |
|
1030 | 139 |
Cursor wait showWhile:[ |
140 |
knownPackages := Set new. |
|
141 |
Smalltalk allClassesDo:[:cls | |pckg idx| |
|
142 |
pckg := cls package. |
|
143 |
pckg size > 0 ifTrue:[ |
|
144 |
(pckg startsWith:theModulePrefix) ifTrue:[ |
|
145 |
idx := pckg indexOf:$:. |
|
146 |
knownPackages add:(pckg copyFrom:idx + 1) |
|
147 |
] |
|
933
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
148 |
] |
1030 | 149 |
]. |
150 |
knownPackages := knownPackages asOrderedCollection. |
|
151 |
knownPackages := knownPackages select:[:package | package isBlank not]. |
|
152 |
knownPackages sort. |
|
153 |
packageBoxComponent list:knownPackages. |
|
933
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
154 |
]. |
1030 | 155 |
]. |
156 |
||
157 |
fileNameUpdater := [ |
|
158 |
|module package files| |
|
159 |
||
160 |
Cursor read showWhile:[ |
|
161 |
module := moduleHolder value ? '__NoProject__'. |
|
162 |
package := packageHolder value ? '__NoProject__'. |
|
163 |
||
164 |
files := SourceCodeManager getExistingContainersInModule:module package:package. |
|
165 |
files := files asOrderedCollection. |
|
166 |
files := files select:[:eachFile | eachFile asFilename hasSuffix:'st']. |
|
167 |
files sort. |
|
168 |
fileNameBoxComponent list:files. |
|
169 |
]. |
|
933
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
170 |
]. |
893 | 171 |
|
172 |
moduleHolder := initialModule asValue. |
|
173 |
packageHolder := initialPackage asValue. |
|
174 |
fileNameHolder := initialFileName asValue. |
|
175 |
||
176 |
resources := ResourcePack for:self. |
|
177 |
||
178 |
"/ |
|
179 |
"/ open a dialog for this |
|
180 |
"/ |
|
181 |
box := DialogBox new. |
|
182 |
box label:title. |
|
183 |
||
184 |
component := box addTextLabel:boxText withCRs. |
|
185 |
component adjust:#left; borderWidth:0. |
|
186 |
box addVerticalSpace. |
|
187 |
box addVerticalSpace. |
|
188 |
||
189 |
y := box yPosition. |
|
190 |
component := box addTextLabel:(resources string:'Module:'). |
|
191 |
component width:0.4; adjust:#right. |
|
192 |
box yPosition:y. |
|
933
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
193 |
component := box addComboBoxOn:moduleHolder tabable:true. |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
194 |
component list:knownContainers. |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
195 |
|
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
196 |
"/ component := box addInputFieldOn:moduleHolder tabable:true. |
893 | 197 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
198 |
||
199 |
box addVerticalSpace. |
|
200 |
y := box yPosition. |
|
982 | 201 |
component := box addTextLabel:(resources string:'Package:'). |
893 | 202 |
component width:0.4; adjust:#right. |
203 |
box yPosition:y. |
|
933
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
204 |
packageBoxComponent := component := box addComboBoxOn:packageHolder tabable:true. |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
205 |
"/ component := box addInputFieldOn:packageHolder tabable:true. |
1084 | 206 |
component width:0.6; left:0.4; "immediateAccept:true; "acceptOnLeave:true; cursorMovementWhenUpdating:#beginOfLine. |
933
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
207 |
packageUpdater value. |
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
208 |
moduleHolder onChangeEvaluate:packageUpdater. |
893 | 209 |
|
210 |
box addVerticalSpace. |
|
211 |
y := box yPosition. |
|
982 | 212 |
component := box addTextLabel:(resources string:'Filename:'). |
893 | 213 |
component width:0.4; adjust:#right. |
214 |
box yPosition:y. |
|
1030 | 215 |
|
216 |
forNewContainer ifTrue:[ |
|
217 |
component := box addInputFieldOn:fileNameHolder tabable:true. |
|
218 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
219 |
] ifFalse:[ |
|
220 |
fileNameBoxComponent := component := box addComboBoxOn:fileNameHolder tabable:true. |
|
221 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
222 |
fileNameUpdater value. |
|
223 |
packageHolder onChangeEvaluate:fileNameUpdater. |
|
224 |
]. |
|
893 | 225 |
|
226 |
box addVerticalSpace. |
|
227 |
||
228 |
notice notNil ifTrue:[ |
|
229 |
component := box addTextLabel:notice. |
|
230 |
component adjust:#left; borderWidth:0. |
|
231 |
]. |
|
232 |
||
233 |
box addVerticalSpace. |
|
234 |
box addAbortAndOkButtons. |
|
235 |
||
1065
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
236 |
(YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[ |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
237 |
component := Button label:'Yes to all'. |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
238 |
component action:[ |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
239 |
YesToAllNotification queryWith:true. |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
240 |
box doAccept. |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
241 |
]. |
1210 | 242 |
(DialogBox defaultOKButtonAtLeft) ifTrue:[ |
1065
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
243 |
box addButton:component after:nil. |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
244 |
] ifFalse:[ |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
245 |
box addButton:component before:nil. |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
246 |
]. |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
247 |
]. |
1185 | 248 |
(AbortAllSignal isHandled) ifTrue:[ |
249 |
component := Button label:'Cancel all'. |
|
250 |
component action:[ |
|
1193 | 251 |
box hide. |
252 |
AbortAllSignal raiseSignal. |
|
1185 | 253 |
]. |
1210 | 254 |
(DialogBox defaultOKButtonAtLeft) ifTrue:[ |
1185 | 255 |
box addButton:component before:nil. |
256 |
] ifFalse:[ |
|
257 |
box addButton:component after:nil. |
|
258 |
]. |
|
259 |
]. |
|
1065
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
260 |
|
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
261 |
(YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[ |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
262 |
answer := YesToAllQuery query. |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
263 |
]. |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
264 |
|
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
265 |
answer isNil ifTrue:[ |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
266 |
box showAtPointer. |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
267 |
answer := box accepted |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
268 |
]. |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
269 |
|
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
270 |
box destroy. |
68dbb6841e29
added 'yes to all' when asking for initial container:
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
271 |
answer ifFalse:[ |
893 | 272 |
^ nil |
273 |
]. |
|
274 |
||
275 |
module := moduleHolder value withoutSpaces. |
|
276 |
package := packageHolder value withoutSpaces. |
|
277 |
fileName := fileNameHolder value withoutSpaces. |
|
278 |
^ Dictionary new |
|
279 |
at:#module put:module; |
|
280 |
at:#package put:package; |
|
281 |
at:#fileName put:fileName; |
|
282 |
yourself |
|
283 |
||
284 |
" |
|
285 |
self |
|
286 |
askForContainer:'enter container' title:'container' note:'some note' |
|
287 |
initialModule:'foo' initialPackage:'bar' initialFileName:'baz' |
|
288 |
" |
|
289 |
! |
|
290 |
||
936
def2b1c81bcf
renamed askForExistingRevision
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
291 |
askForExistingRevision:boxText title:title class:aClass |
934
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
292 |
"open a dialog asking for a containers revision; |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
293 |
return a revision number, or nil if canceled." |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
294 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
295 |
|mgr sourceInfo module package fileName| |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
296 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
297 |
mgr := aClass sourceCodeManager. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
298 |
sourceInfo := mgr sourceInfoOfClass:aClass. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
299 |
sourceInfo isNil ifTrue:[^ nil]. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
300 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
301 |
package := mgr packageFromSourceInfo:sourceInfo. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
302 |
module := mgr moduleFromSourceInfo:sourceInfo. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
303 |
fileName := mgr containerFromSourceInfo:sourceInfo. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
304 |
^ self |
936
def2b1c81bcf
renamed askForExistingRevision
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
305 |
askForExistingRevision:boxText |
934
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
306 |
title:title |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
307 |
class:aClass |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
308 |
manager:mgr |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
309 |
module:module package:package fileName:fileName |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
310 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
311 |
" |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
312 |
SourceCodeManagerUtilities |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
313 |
askForRevisionToCompare:'enter revision' |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
314 |
title:'revision' |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
315 |
class:Array |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
316 |
" |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
317 |
! |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
318 |
|
936
def2b1c81bcf
renamed askForExistingRevision
Claus Gittinger <cg@exept.de>
parents:
934
diff
changeset
|
319 |
askForExistingRevision:boxText title:title class:clsOrNil manager:aSourceCodeManager module:module package:package fileName:fileName |
934
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
320 |
"open a dialog asking for a containers revision; |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
321 |
return a revision number, or nil if canceled." |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
322 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
323 |
|partialLog revisions items newestRev |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
324 |
box y component resources |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
325 |
revisionHolder| |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
326 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
327 |
partialLog := aSourceCodeManager |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
328 |
revisionLogOf:clsOrNil |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
329 |
numberOfRevisions:20 |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
330 |
fileName:fileName |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
331 |
directory:package |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
332 |
module:module. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
333 |
partialLog notNil ifTrue:[ |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
334 |
newestRev := partialLog at:#newestRevision. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
335 |
revisions := partialLog at:#revisions. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
336 |
items := revisions collect:[:each | |rev date who| |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
337 |
rev := each at:#revision. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
338 |
date := each at:#date. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
339 |
who := each at:#author. |
1019 | 340 |
rev allBold , ' [' , date , ' by ' , who , ']' |
934
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
341 |
]. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
342 |
revisions := revisions collect:[:each | each at:#revision]. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
343 |
] ifFalse:[ |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
344 |
newestRev := aSourceCodeManager newestRevisionInFile:fileName directory:package module:module. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
345 |
revisions := items := nil. |
1262 | 346 |
|
347 |
newestRev isNil ifTrue:[ |
|
348 |
(aSourceCodeManager checkForExistingContainerInModule:module package:package container:fileName) |
|
349 |
ifFalse:[ |
|
350 |
self warn:'Could not find/access the container for ',fileName,' in the repository. |
|
351 |
This could be due to: |
|
352 |
- invalid/wrong CVS-Root setting. |
|
353 |
- missing CVS access rights. |
|
354 |
- changed CVSRoot after compilation |
|
355 |
(i.e. wrong CVS-path in classes version method) |
|
356 |
'. |
|
357 |
^ nil |
|
358 |
] |
|
359 |
] |
|
934
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
360 |
]. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
361 |
revisionHolder := newestRev asValue. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
362 |
resources := ResourcePack for:self. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
363 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
364 |
revisionHolder onChangeEvaluate:[ |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
365 |
"/ cut off everything after revision |
937 | 366 |
|s first words| |
934
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
367 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
368 |
s := revisionHolder value. |
937 | 369 |
words := s asCollectionOfWords. |
370 |
words size > 0 ifTrue:[ |
|
371 |
first := words first string. |
|
372 |
first ~= s ifTrue:[ |
|
373 |
revisionHolder value:first |
|
374 |
] |
|
934
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
375 |
] |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
376 |
]. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
377 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
378 |
"/ |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
379 |
"/ open a dialog for this |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
380 |
"/ |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
381 |
box := DialogBox new. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
382 |
box label:title. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
383 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
384 |
component := box addTextLabel:boxText withCRs. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
385 |
component adjust:#left; borderWidth:0. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
386 |
box addVerticalSpace. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
387 |
box addVerticalSpace. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
388 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
389 |
y := box yPosition. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
390 |
component := box addTextLabel:(resources string:'Revision:'). |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
391 |
component width:0.4; adjust:#right. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
392 |
box yPosition:y. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
393 |
component := box addComboBoxOn:revisionHolder tabable:true. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
394 |
component list:items. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
395 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
396 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
397 |
box addVerticalSpace. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
398 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
399 |
box addAbortAndOkButtons. |
990 | 400 |
|
401 |
Object abortAllSignal isHandled ifTrue:[ |
|
1121 | 402 |
(box addAbortButtonLabelled:'Cancel all') action:[AbortAllSignal raise]. |
990 | 403 |
]. |
404 |
||
934
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
405 |
box showAtPointer. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
406 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
407 |
box accepted ifFalse:[ |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
408 |
box destroy. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
409 |
^ nil |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
410 |
]. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
411 |
box destroy. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
412 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
413 |
^ revisionHolder value withoutSpaces. |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
414 |
|
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
415 |
" |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
416 |
SourceCodeManagerUtilities |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
417 |
askForRevisionToCompare:'enter revision' |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
418 |
title:'revision' |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
419 |
class:nil |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
420 |
manager:SourceCodeManager |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
421 |
module:'stx' |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
422 |
package:'libbasic' |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
423 |
fileName:'Array.st' |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
424 |
" |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
425 |
! |
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
426 |
|
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
427 |
checkAndWarnAboutBadMessagesInClass:aClass |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
428 |
"check if a class contains message-sends to: |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
429 |
#halt |
1053
bbf6a1d5d3f7
Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
1051
diff
changeset
|
430 |
#halt: |
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
431 |
#error |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
432 |
(and maybe more in the future)" |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
433 |
|
1160 | 434 |
|badStuff whatIsBad msg answer labels values| |
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
435 |
|
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
436 |
badStuff := #( |
1053
bbf6a1d5d3f7
Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
1051
diff
changeset
|
437 |
( #halt 'sent of #halt (use for debugging only) - better use #error:''some message''' ) |
bbf6a1d5d3f7
Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
1051
diff
changeset
|
438 |
( #halt: 'sent of #halt: (use for debugging only) - better use #error:' ) |
bbf6a1d5d3f7
Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
1051
diff
changeset
|
439 |
( #error 'sent of #error without descriptive message - better use #error:''some message''' ) |
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
440 |
). |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
441 |
|
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
442 |
whatIsBad := Set new. |
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1076
diff
changeset
|
443 |
aClass theNonMetaclass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
1012
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
444 |
|setOfLiterals setOfSentMessages| |
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
445 |
|
1012
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
446 |
setOfLiterals := mthd literals. "/ try without parsing first. |
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
447 |
(badStuff contains:[:eachEntry | setOfLiterals includes:eachEntry first]) ifTrue:[ |
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
448 |
setOfSentMessages := mthd messagesSent. |
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
449 |
badStuff do:[:eachEntry | |
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
450 |
(setOfSentMessages includes:eachEntry first) ifTrue:[ |
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
451 |
whatIsBad add:eachEntry second |
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
452 |
] |
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
453 |
]. |
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
454 |
]. |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
455 |
]. |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
456 |
whatIsBad notEmpty ifTrue:[ |
992 | 457 |
(YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[ |
458 |
answer := YesToAllQuery query. |
|
459 |
answer notNil ifTrue:[ ^ answer ]. |
|
460 |
]. |
|
461 |
||
1012
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
462 |
msg := '%1 contains the following (considered bad style) message sends:\\'. |
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
463 |
whatIsBad do:[:each | |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
464 |
msg := msg , ' ' , each , '\' |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
465 |
]. |
1012
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
466 |
msg := msg , '\\' , 'Do you really want to checkIn the %1 class ?'. |
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
467 |
msg := msg bindWith:aClass name. |
992 | 468 |
(YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[ |
1160 | 469 |
labels := #('Yes' 'Yes to all' 'No' 'No to all' 'Cancel'). |
470 |
values := #(true #yesToAll false #noToAll nil). |
|
471 |
AbortAllSignal isHandled ifTrue:[ |
|
472 |
labels := labels , #('Cancel All'). |
|
473 |
values := values , #(#cancelAll). |
|
474 |
]. |
|
992 | 475 |
answer := OptionBox |
476 |
request:msg withCRs |
|
477 |
label:'Really checkIn ?' |
|
478 |
form:(InfoBox iconBitmap) |
|
1160 | 479 |
buttonLabels:labels |
480 |
values:values |
|
1056
c9cc2b5d065e
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
1055
diff
changeset
|
481 |
default:#yesToAll |
1160 | 482 |
onCancel:nil. |
483 |
answer isNil ifTrue:[ |
|
484 |
AbortSignal raise. |
|
485 |
]. |
|
486 |
answer == #cancelAll ifTrue:[ |
|
487 |
AbortAllSignal raise. |
|
488 |
]. |
|
489 |
||
992 | 490 |
answer == #yesToAll ifTrue:[ |
1053
bbf6a1d5d3f7
Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
1051
diff
changeset
|
491 |
YesToAllNotification queryWith:true. |
992 | 492 |
^ true |
493 |
]. |
|
494 |
answer == #noToAll ifTrue:[ |
|
1053
bbf6a1d5d3f7
Raise query signals proceedable.
Stefan Vogel <sv@exept.de>
parents:
1051
diff
changeset
|
495 |
YesToAllNotification queryWith:false. |
992 | 496 |
^ false |
497 |
]. |
|
498 |
^ answer |
|
499 |
] ifFalse:[ |
|
500 |
^ self confirm:msg withCRs |
|
501 |
] |
|
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
502 |
]. |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
503 |
^ true. |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
504 |
|
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
505 |
" |
983 | 506 |
self checkAndWarnAboutBadMessagesInClass:(SourceCodeManagerUtilities) |
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
507 |
" |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
508 |
! |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
509 |
|
1158 | 510 |
checkForExistingModule:module package:package container:containerFileName using:mgr allowCreate:allowCreate |
511 |
|resources moduleName packageName containerName| |
|
512 |
||
513 |
resources := ResourcePack for:self. |
|
514 |
moduleName := module allBold. |
|
515 |
packageName := package allBold. |
|
516 |
containerName := containerFileName allBold. |
|
517 |
||
518 |
"/ |
|
519 |
"/ check for the container |
|
520 |
"/ |
|
521 |
(mgr checkForExistingContainerInModule:module package:package container:containerFileName) ifFalse:[ |
|
522 |
allowCreate ifFalse:[ |
|
523 |
self warn:(resources string:'A container for ''%1'' does not exist in ''%2:%3''' |
|
524 |
with:containerName with:moduleName with:packageName) withCRs. |
|
525 |
^ false |
|
526 |
]. |
|
527 |
(Dialog |
|
528 |
confirm:(resources string:'''%1'' is a new container (in ''%2:%3'').\\Create it ?' |
|
529 |
with:containerName with:moduleName with:packageName) withCRs |
|
530 |
noLabel:'Cancel') |
|
531 |
ifFalse:[ |
|
532 |
^ false. |
|
533 |
]. |
|
534 |
(mgr createContainerForText:'' inModule:module package:package container:containerFileName) ifFalse:[ |
|
535 |
self warn:(resources string:'Cannot create new container: ''%1'' (in ''%2:%3'')' |
|
536 |
with:containerName with:moduleName with:packageName). |
|
537 |
^ false. |
|
538 |
] |
|
539 |
]. |
|
540 |
^ true. |
|
541 |
! |
|
542 |
||
543 |
checkForExistingModule:module package:package using:mgr allowCreate:allowCreate |
|
544 |
|resources moduleName packageName| |
|
545 |
||
546 |
resources := ResourcePack for:self. |
|
547 |
moduleName := module allBold. |
|
548 |
packageName := package allBold. |
|
549 |
||
550 |
"/ |
|
551 |
"/ check for the package |
|
552 |
"/ |
|
553 |
(mgr checkForExistingModule:module package:package) ifFalse:[ |
|
554 |
allowCreate ifFalse:[ |
|
555 |
self warn:(resources string:'A package named ''%1'' does not exist in module ''%2''' |
|
556 |
with:packageName with:moduleName) withCRs. |
|
557 |
^ false |
|
558 |
]. |
|
559 |
(Dialog |
|
560 |
confirm:(resources string:'''%1'' is a new package in module ''%2''.\\create it ?' |
|
561 |
with:packageName with:moduleName) withCRs |
|
562 |
noLabel:'Cancel') |
|
563 |
ifFalse:[ |
|
564 |
^ false. |
|
565 |
]. |
|
566 |
(mgr createModule:module package:package) ifFalse:[ |
|
567 |
self warn:(resources string:'Cannot create new package: ''%1'' in module ''%2''' |
|
568 |
with:packageName with:moduleName) withCRs. |
|
569 |
^ false. |
|
570 |
] |
|
571 |
]. |
|
572 |
^ true. |
|
573 |
! |
|
574 |
||
575 |
checkForExistingModule:module using:mgr allowCreate:allowCreate |
|
576 |
|resources moduleName| |
|
577 |
||
578 |
(mgr checkForExistingModule:module) ifFalse:[ |
|
579 |
resources := ResourcePack for:self. |
|
580 |
moduleName := module allBold. |
|
581 |
||
582 |
allowCreate ifFalse:[ |
|
583 |
self warn:(resources string:'A module named ''%1'' does not exist in the repository' |
|
584 |
with:moduleName) withCRs. |
|
585 |
^ false |
|
586 |
]. |
|
587 |
||
588 |
(Dialog |
|
589 |
confirm:(resources string:'''%1'' is a new module.\\create it ?' with:moduleName) withCRs |
|
590 |
noLabel:'Cancel') |
|
591 |
ifFalse:[ |
|
592 |
^ false. |
|
593 |
]. |
|
594 |
(mgr createModule:module) ifFalse:[ |
|
595 |
self warn:(resources string:'Cannot create new module: ''%1''' with:moduleName) withCRs. |
|
596 |
^ false. |
|
597 |
] |
|
598 |
]. |
|
599 |
^ true. |
|
600 |
! |
|
601 |
||
886 | 602 |
checkinClass:aClass |
603 |
"check a class into the source repository. |
|
604 |
Asks interactively for log-message." |
|
882 | 605 |
|
606 |
^ self checkinClass:aClass withLog:nil |
|
607 |
! |
|
608 |
||
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
609 |
checkinClass:aClass withLog:aLogMessageOrNil |
886 | 610 |
"check a class into the source repository. |
611 |
If the argument, aLogMessageOrNil isNil, ask interactively for log-message." |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
612 |
|
977 | 613 |
^ self checkinClass:aClass withLog:aLogMessageOrNil withCheck:true |
614 |
! |
|
615 |
||
616 |
checkinClass:aClass withLog:aLogMessageOrNil withCheck:doCheckClass |
|
617 |
"check a class into the source repository. |
|
618 |
If the argument, aLogMessageOrNil isNil, ask interactively for log-message." |
|
619 |
||
1078 | 620 |
|logMessage info mgr pri resources newSelectors initialLog| |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
621 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
622 |
aClass isLoaded ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
623 |
self information:'cannot checkin unloaded classes (' , aClass name , ').'. |
881 | 624 |
^ false. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
625 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
626 |
|
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
627 |
mgr := self sourceCodeManagerFor:aClass. |
954 | 628 |
mgr isNil ifTrue:[ |
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
629 |
^ false |
954 | 630 |
]. |
631 |
||
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
632 |
aLogMessageOrNil isNil ifTrue:[ |
1078 | 633 |
newSelectors := aClass selectors asSet. |
634 |
newSelectors addAll:(aClass class selectors). |
|
635 |
newSelectors size == 1 ifTrue:[ |
|
636 |
initialLog := 'Added/changed #' , newSelectors first |
|
637 |
"/ ] ifFalse:[ |
|
638 |
"/ newSelectors size > 1 ifTrue:[ |
|
639 |
"/ initialLog := 'Added/changed some methods' |
|
640 |
"/ ] |
|
641 |
]. |
|
642 |
||
643 |
logMessage := self |
|
1207 | 644 |
getLogMessageFor:aClass name |
1078 | 645 |
initialAnswer:initialLog. |
1048 | 646 |
logMessage isNil ifTrue:[^ false]. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
647 |
] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
648 |
logMessage := aLogMessageOrNil |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
649 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
650 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
651 |
resources := ResourcePack for:self. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
652 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
653 |
info := mgr sourceInfoOfClass:aClass. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
654 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
655 |
(info isNil |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
656 |
or:[(info at:#fileName ifAbsent:nil) isNil |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
657 |
or:[(info at:#module ifAbsent:nil) isNil |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
658 |
or:[(info at:#directory ifAbsent:nil) isNil]]]) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
659 |
(self createSourceContainerForClass:aClass) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
660 |
"/ self warn:'did not create a container for ''' , aClass name , ''''. |
881 | 661 |
^ false |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
662 |
]. |
881 | 663 |
^ true. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
664 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
665 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
666 |
self activityNotification:(resources string:'checking in %1' with:aClass name). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
667 |
pri := Processor activePriority. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
668 |
Processor activeProcess withPriority:pri-1 to:pri |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
669 |
do:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
670 |
|revision aborted freshCreated| |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
671 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
672 |
freshCreated := false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
673 |
revision := aClass revision. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
674 |
revision isNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
675 |
"/ mhmh - check if it has a container. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
676 |
(mgr checkForExistingContainerForClass:aClass) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
677 |
(self createSourceContainerForClass:aClass) ifFalse:[ |
1030 | 678 |
self warn:'Did not create/change repository container for ''' , aClass name allBold , ''''. |
679 |
^ false. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
680 |
] ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
681 |
freshCreated := true. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
682 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
683 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
684 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
685 |
|
977 | 686 |
doCheckClass ifTrue:[ |
687 |
"/ check if the class contains halts, error-sends etc. |
|
688 |
(self checkAndWarnAboutBadMessagesInClass:aClass) ifFalse:[ |
|
689 |
^ false |
|
690 |
]. |
|
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
691 |
]. |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
692 |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
693 |
freshCreated ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
694 |
aborted := false. |
1113
30540d5fc3b7
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
1095
diff
changeset
|
695 |
AbortOperationRequest handle:[:ex | |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
696 |
aborted := true. |
881 | 697 |
ex return. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
698 |
] do:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
699 |
(mgr checkinClass:aClass logMessage:logMessage) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
700 |
Transcript showCR:'checkin of ''' , aClass name , ''' failed'. |
1019 | 701 |
self warn:'checkin of ''' , aClass name allBold , ''' failed'. |
881 | 702 |
^ false. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
703 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
704 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
705 |
aborted ifTrue:[ |
1158 | 706 |
Transcript showCR:'Checkin of ''' , aClass name , ''' aborted'. |
1032 | 707 |
AbortAllSignal isHandled ifTrue:[ |
708 |
(Dialog |
|
1158 | 709 |
confirm:('Checkin of ''' , aClass name , ''' aborted.\\Cancel all ?')withCRs |
1032 | 710 |
default:false) |
711 |
ifTrue:[ |
|
1022 | 712 |
AbortAllSignal raise. |
1032 | 713 |
] |
1016 | 714 |
]. |
881 | 715 |
^ false. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
716 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
717 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
718 |
]. |
881 | 719 |
^ true |
1113
30540d5fc3b7
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
1095
diff
changeset
|
720 |
|
30540d5fc3b7
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
1095
diff
changeset
|
721 |
"Modified: / 16.11.2001 / 17:39:21 / cg" |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
722 |
! |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
723 |
|
920 | 724 |
checkinClasses:aCollectionOfClass |
886 | 725 |
"check a collection of classes into the source repository. |
726 |
Asks interactively for log-message." |
|
727 |
||
920 | 728 |
^ self checkinClasses:aCollectionOfClass withLog:nil |
886 | 729 |
! |
730 |
||
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
731 |
checkinClasses:aCollectionOfClasses withLog:aLogMessageOrNil |
886 | 732 |
"check a bunch of classes into the source repository. |
733 |
If the argument, aLogMessageOrNil isNil, ask interactively for log-message." |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
734 |
|
992 | 735 |
^ self |
1142
cba1ede48a4a
allow check for halt/error to be turned off via userPrefs
Claus Gittinger <cg@exept.de>
parents:
1137
diff
changeset
|
736 |
checkinClasses:aCollectionOfClasses |
cba1ede48a4a
allow check for halt/error to be turned off via userPrefs
Claus Gittinger <cg@exept.de>
parents:
1137
diff
changeset
|
737 |
withLog:aLogMessageOrNil |
cba1ede48a4a
allow check for halt/error to be turned off via userPrefs
Claus Gittinger <cg@exept.de>
parents:
1137
diff
changeset
|
738 |
withCheck:(UserPreferences current at:#checkClassesWhenCheckingIn ifAbsent:true) |
992 | 739 |
! |
740 |
||
741 |
checkinClasses:aCollectionOfClasses withLog:aLogMessageOrNil withCheck:doCheckClasses |
|
742 |
"check a bunch of classes into the source repository. |
|
743 |
If the argument, aLogMessageOrNil isNil, ask interactively for log-message." |
|
744 |
||
745 |
|classes logMessage resources yesOrNoToAll| |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
746 |
|
920 | 747 |
"/ ignore private classes |
748 |
classes := aCollectionOfClasses select:[:aClass | aClass owningClass isNil]. |
|
749 |
classes isEmpty ifTrue:[ |
|
750 |
self information:'Only private classes given - nothing checked in.'. |
|
751 |
^ self |
|
752 |
]. |
|
753 |
classes := classes select:[:aClass | aClass isLoaded]. |
|
754 |
classes isEmpty ifTrue:[ |
|
755 |
self information:'Only unloaded classes given - nothing checked in.'. |
|
756 |
^ self |
|
757 |
]. |
|
958 | 758 |
classes size == 1 ifTrue:[ |
992 | 759 |
^ self checkinClass:classes first withLog:aLogMessageOrNil withCheck:doCheckClasses. |
958 | 760 |
]. |
920 | 761 |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
762 |
resources := ResourcePack for:self. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
763 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
764 |
(logMessage := aLogMessageOrNil) isNil ifTrue:[ |
957 | 765 |
logMessage := SourceCodeManagerUtilities getLogMessageFor:(resources string:'%1 classes to checkin' with:aCollectionOfClasses size). |
766 |
||
767 |
logMessage isNil ifTrue:[ |
|
768 |
^ self |
|
769 |
]. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
770 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
771 |
|
1016 | 772 |
AbortAllSignal handle:[:ex | |
773 |
ex return |
|
992 | 774 |
] do:[ |
1016 | 775 |
self yesToAllNotification handle:[:ex | |
776 |
yesOrNoToAll := ex parameter. |
|
777 |
ex proceed |
|
992 | 778 |
] do:[ |
1016 | 779 |
self yesToAllQuery handle:[:ex | |
780 |
ex proceedWith:yesOrNoToAll |
|
781 |
] do:[ |
|
782 |
classes do:[:aClass | |
|
1137
239b07db4478
dont check twice for bad messages (halt etc.)
Claus Gittinger <cg@exept.de>
parents:
1131
diff
changeset
|
783 |
self activityNotification:(resources string:'checking in %1' with:aClass name). |
239b07db4478
dont check twice for bad messages (halt etc.)
Claus Gittinger <cg@exept.de>
parents:
1131
diff
changeset
|
784 |
"/ ca does not want boxes to pop up all over ... |
1245 | 785 |
UserInformation handle:[:ex | |
786 |
Transcript showCR:ex description |
|
1137
239b07db4478
dont check twice for bad messages (halt etc.)
Claus Gittinger <cg@exept.de>
parents:
1131
diff
changeset
|
787 |
] do:[ |
1160 | 788 |
AbortSignal handle:[:ex | |
789 |
] do:[ |
|
790 |
self checkinClass:aClass withLog:logMessage withCheck:doCheckClasses |
|
791 |
] |
|
992 | 792 |
]. |
1016 | 793 |
] |
992 | 794 |
] |
1016 | 795 |
]. |
992 | 796 |
]. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
797 |
! |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
798 |
|
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
799 |
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withLog:aLogMessageOrNil |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
800 |
"checkin a projects extensions into the source repository. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
801 |
If the argument, aLogMessageOrNil isNil, ask interactively for log-message." |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
802 |
|
1120 | 803 |
|logMessage mgr pri resources module package i containerFileName s |
1015 | 804 |
methodSource methodsSortedByName| |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
805 |
|
957 | 806 |
resources := ResourcePack for:self. |
807 |
||
958 | 808 |
mgr := aCollectionOfMethods first mclass theNonMetaclass sourceCodeManager. |
957 | 809 |
mgr isNil ifTrue:[ |
810 |
self warn:'No sourceCode manager defined - cannot checkin.'. |
|
811 |
"/ self error:'No sourceCode manager defined' mayProceed:true. |
|
812 |
^ false. |
|
813 |
]. |
|
814 |
i := aPackageID indexOf:$:. |
|
815 |
i == 0 ifTrue:[ |
|
816 |
self warn:'Cannot extract module/package from the packageID (invalid format)\\Please change the packageID to be of the form <module>:<subdirectory>,\and try again.\Or, alternatively, move the extensions to their classes project and checkIn the class(es).' withCRs. |
|
817 |
"/ self error:'cannot extract module/package from packageID' mayProceed:true. |
|
818 |
^ false. |
|
819 |
]. |
|
820 |
module := aPackageID copyTo:i-1. |
|
821 |
package := aPackageID copyFrom:i+1. |
|
1120 | 822 |
(package startsWith:$:) ifTrue:[ |
823 |
package := package copyFrom:2. |
|
824 |
]. |
|
957 | 825 |
|
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
826 |
containerFileName := 'extensions.st'. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
827 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
828 |
aLogMessageOrNil isNil ifTrue:[ |
1019 | 829 |
logMessage := SourceCodeManagerUtilities getLogMessageFor:containerFileName allBold. |
1120 | 830 |
logMessage isNil ifTrue:[^ false]. |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
831 |
] ifFalse:[ |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
832 |
logMessage := aLogMessageOrNil |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
833 |
]. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
834 |
|
1158 | 835 |
(self checkForExistingModule:module using:mgr allowCreate:true) ifFalse:[^ false]. |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
836 |
LastModule := module. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
837 |
|
1158 | 838 |
(self checkForExistingModule:module package:package using:mgr allowCreate:true) ifFalse:[^ false]. |
839 |
LastPackage := package. |
|
1015 | 840 |
|
1158 | 841 |
(self checkForExistingModule:module package:package container:containerFileName using:mgr allowCreate:true) ifFalse:[^ false]. |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
842 |
|
1120 | 843 |
self activityNotification:(resources string:'Checking in %1' with:containerFileName). |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
844 |
pri := Processor activePriority. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
845 |
Processor activeProcess withPriority:pri-1 to:pri |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
846 |
do:[ |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
847 |
s := '' writeStream. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
848 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
849 |
s nextPutAll:'"{ Package: '''. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
850 |
s nextPutAll:aPackageID asString. |
923 | 851 |
s nextPutAll:''' }"'; cr; nextPutChunkSeparator; cr; cr. |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
852 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
853 |
"/ s nextPutAll:(Smalltalk timeStamp). |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
854 |
"/ s nextPutChunkSeparator. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
855 |
"/ s cr; cr. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
856 |
|
1015 | 857 |
"/ sort them by name (to avoid conflict due to CVS merge) |
858 |
methodsSortedByName := aCollectionOfMethods asOrderedCollection. |
|
859 |
methodsSortedByName sort:[:a :b | |
|
860 |
|clsA clsB| |
|
861 |
||
862 |
clsA := a mclass name. |
|
863 |
clsB := b mclass name. |
|
864 |
clsA < clsB ifTrue:[ |
|
865 |
true |
|
866 |
] ifFalse:[ |
|
867 |
clsA > clsB ifTrue:[ |
|
868 |
false |
|
869 |
] ifFalse:[ |
|
870 |
a selector < b selector |
|
871 |
] |
|
872 |
] |
|
873 |
]. |
|
874 |
methodsSortedByName do:[:aMethod | |
|
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
875 |
aMethod mclass fileOutMethod:aMethod on:s. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
876 |
s cr. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
877 |
]. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
878 |
methodSource := s contents. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
879 |
|
1245 | 880 |
UserInformation handle:[:ex | |
1323 | 881 |
Transcript showCR:ex description. |
882 |
ex proceed. |
|
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
883 |
] do:[ |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
884 |
(mgr |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
885 |
checkin:containerFileName |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
886 |
text:methodSource |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
887 |
directory:package |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
888 |
module:module |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
889 |
logMessage:aLogMessageOrNil |
1090
8608e5b91fa7
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
890 |
force:false) |
8608e5b91fa7
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
891 |
ifFalse:[ |
1120 | 892 |
Transcript showCR:'Checkin of ''' , containerFileName , ''' failed'. |
893 |
self warn:'Checkin of ''' , containerFileName allBold , ''' failed'. |
|
1090
8608e5b91fa7
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
894 |
^ false. |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
895 |
]. |
1090
8608e5b91fa7
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
896 |
mgr postCheckInExtensionsForPackage:aPackageID |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
897 |
]. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
898 |
]. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
899 |
^ true |
1090
8608e5b91fa7
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
900 |
|
8608e5b91fa7
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
901 |
"Modified: / 5.11.2001 / 17:06:00 / cg" |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
902 |
! |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
903 |
|
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
904 |
checkoutClass:aClass askForMerge:askForMerge |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
905 |
"check-out a class from the source repository." |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
906 |
|
1006 | 907 |
self |
908 |
checkoutClass:aClass |
|
909 |
askForRevision:true |
|
910 |
askForMerge:askForMerge |
|
911 |
! |
|
912 |
||
913 |
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge |
|
914 |
"check-out a class from the source repository. |
|
915 |
If askForRevision is false, check-out the newest version." |
|
916 |
||
1084 | 917 |
|mgr resources sourceInfo |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
918 |
currentClass |
1055
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
919 |
aStream sourceToLoad currentSource rev revString |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
920 |
nm msg rev2 newestRev |
1030 | 921 |
containerModule containerPackage containerFile rslt |
922 |
pkg listHere listRep diffSet |
|
1054 | 923 |
changed onlyHere onlyInRep answer labels values singleChangeSelector |
1051 | 924 |
changedClasses default versionMethodsHere versionMethodsRep changedClassDefinitions| |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
925 |
|
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
926 |
aClass isNil ifTrue:[self error:'nil class']. |
1158 | 927 |
|
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
928 |
resources := ResourcePack for:self. |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
929 |
|
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
930 |
currentClass := aClass theNonMetaclass. |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
931 |
|
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
932 |
nm := currentClass name. |
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
933 |
mgr := self sourceCodeManagerFor:currentClass. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
934 |
mgr isNil ifTrue:[ |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
935 |
^ self |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
936 |
]. |
1084 | 937 |
|
938 |
sourceInfo := mgr sourceInfoOfClass:currentClass. |
|
939 |
sourceInfo notNil ifTrue:[ |
|
940 |
currentClass package ~= Project defaultProject package ifTrue:[ |
|
941 |
containerPackage := mgr packageFromSourceInfo:sourceInfo. |
|
942 |
containerModule := mgr moduleFromSourceInfo:sourceInfo. |
|
943 |
]. |
|
944 |
containerFile := mgr containerFromSourceInfo:sourceInfo. |
|
945 |
]. |
|
946 |
||
989
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
947 |
currentClass isLoaded ifTrue:[ |
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
948 |
rev := currentClass binaryRevision. |
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
949 |
rev2 := currentClass revision. |
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
950 |
rev isNil ifTrue:[ |
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
951 |
rev := rev2 |
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
952 |
]. |
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
953 |
rev isNil ifTrue:[ |
1084 | 954 |
pkg := currentClass package. |
955 |
(pkg notNil and:[pkg ~= Project defaultProject package]) ifTrue:[ |
|
1019 | 956 |
containerModule := pkg upTo:$:. |
957 |
containerPackage := pkg copyFrom:(containerModule size + 2). |
|
958 |
]. |
|
959 |
containerModule size == 0 ifTrue:[ |
|
1084 | 960 |
containerModule := (SourceCodeManagerUtilities lastModule ) ? Project current repositoryModule. |
1019 | 961 |
]. |
962 |
containerPackage size == 0 ifTrue:[ |
|
1084 | 963 |
containerPackage := (SourceCodeManagerUtilities lastPackage ) ? Project current package. |
1019 | 964 |
]. |
1030 | 965 |
answer := self confirmWithCancel:(resources |
1035 | 966 |
string:'The class %3 seems to have no (valid) repository information.\\I assume you want to check it out from: %1/%2.' |
1030 | 967 |
with:containerModule allBold |
1035 | 968 |
with:containerPackage allBold |
1084 | 969 |
with:currentClass name allBold) withCRs. |
1030 | 970 |
answer isNil ifTrue:[^ self "cancelled"]. |
971 |
answer ifFalse:[ |
|
972 |
rslt := SourceCodeManagerUtilities |
|
973 |
askForContainer:(resources string:'The class seems to have no repository information.\\Do you want to checkOut from an existing containers contents ?') |
|
974 |
title:'Container to load from' note:nil |
|
975 |
initialModule:containerModule |
|
976 |
initialPackage:containerPackage |
|
1158 | 977 |
initialFileName:(currentClass nameWithoutPrefix , '.st') |
1030 | 978 |
forNewContainer:false. |
1084 | 979 |
|
1030 | 980 |
rslt isNil ifTrue:[ |
981 |
"/ canel |
|
982 |
^ self |
|
983 |
]. |
|
984 |
containerModule := "lastModule :=" rslt at:#module. |
|
985 |
containerPackage := "lastPackage :=" rslt at:#package. |
|
986 |
containerFile := rslt at:#fileName. |
|
987 |
]. |
|
1019 | 988 |
|
989 |
"/ rslt := SourceCodeManagerUtilities |
|
990 |
"/ askForContainer:(resources string:'The class seems to have no (valid) repository information.\\Do you want to check it out from an existing container ?') |
|
991 |
"/ title:'Container to checkOut' note:nil |
|
992 |
"/ initialModule:containerModule |
|
993 |
"/ initialPackage:containerPackage |
|
994 |
"/ initialFileName:(currentClass name , '.st'). |
|
1030 | 995 |
"/ forNewContainer:false. |
1019 | 996 |
"/ rslt isNil ifTrue:[^ self]. |
997 |
"/ self warn:(resources string:'Class %1 seems to be not yet in the repository' with:currentClass name allBold). |
|
998 |
"/ ^ self |
|
989
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
999 |
]. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1000 |
]. |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1001 |
|
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1002 |
"/ |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1003 |
"/ class in repository - ask for revision |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1004 |
"/ |
1084 | 1005 |
"/ newestRev := mgr newestRevisionOf:currentClass. |
1006 |
newestRev := mgr newestRevisionInFile:containerFile directory:containerPackage module:containerModule. |
|
1006 | 1007 |
askForRevision ifFalse:[ |
1008 |
rev := newestRev ? '' |
|
1009 |
] ifTrue:[ |
|
1019 | 1010 |
msg := resources string:'CheckOut which revision of ''%1'': (empty for newest)' with:nm allBold. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1011 |
rev notNil ifTrue:[ |
1006 | 1012 |
msg := msg , '\\' , (resources string:'Current ''%1'' is based upon rev %2.' |
1019 | 1013 |
with:nm allBold with:rev). |
1006 | 1014 |
(rev2 notNil and:[rev2 ~= rev]) ifTrue:[ |
1015 |
msg := msg , '\' , (resources string:'And has been checked into the repository as %1.' |
|
1016 |
with:rev2) |
|
1017 |
] |
|
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1018 |
]. |
1006 | 1019 |
newestRev notNil ifTrue:[ |
1020 |
msg := msg , '\' , (resources string:'Newest in reporitory is %1.' |
|
1021 |
with:newestRev) |
|
989
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
1022 |
]. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1023 |
|
1006 | 1024 |
rev := SourceCodeManagerUtilities |
1025 |
askForExistingRevision:msg |
|
1026 |
title:'CheckOut from repository' |
|
1027 |
class:currentClass. |
|
1028 |
rev isNil ifTrue:[ |
|
1029 |
"/ cancelled |
|
1030 |
^ self |
|
987 | 1031 |
]. |
1006 | 1032 |
]. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1033 |
|
1006 | 1034 |
rev withoutSpaces isEmpty ifTrue:[ |
1035 |
msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'. |
|
1036 |
"/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm. |
|
1037 |
aStream := mgr getSourceStreamFor:currentClass revision:newestRev. |
|
1038 |
revString := '(newest: ' , (newestRev ? '???') , ')'. |
|
1039 |
] ifFalse:[ |
|
1040 |
msg := 'extracting previous %1'. |
|
1084 | 1041 |
"/ aStream := mgr getSourceStreamFor:currentClass revision:rev. |
1042 |
"/ revString := rev |
|
1043 |
aStream := mgr |
|
1044 |
streamForClass:currentClass |
|
1045 |
fileName:containerFile |
|
1046 |
revision:rev |
|
1047 |
directory:containerPackage |
|
1048 |
module:containerModule |
|
1049 |
cache:true. |
|
1006 | 1050 |
]. |
996 | 1051 |
|
1006 | 1052 |
aStream isNil ifTrue:[ |
1035 | 1053 |
self warn:(resources string:'could not extract source of %1 from repository' with:aClass name allBold). |
1006 | 1054 |
^ self |
1055 |
]. |
|
1056 |
aStream class readErrorSignal handle:[:ex | |
|
1245 | 1057 |
self warn:('read error while reading extracted source\\' , ex description) withCRs. |
1006 | 1058 |
aStream close. |
1059 |
^ self |
|
1060 |
] do:[ |
|
1061 |
sourceToLoad := aStream contents asString. |
|
1062 |
]. |
|
1063 |
aStream close. |
|
987 | 1064 |
|
1006 | 1065 |
currentClass isLoaded ifFalse:[ |
1066 |
rev = newestRev ifTrue:[ |
|
1067 |
currentClass autoload. |
|
996 | 1068 |
] ifFalse:[ |
1006 | 1069 |
sourceToLoad readStream fileIn. |
996 | 1070 |
]. |
1006 | 1071 |
^ self. |
1072 |
]. |
|
1073 |
||
1074 |
self activityNotification:'generating current source...'. |
|
1075 |
||
1076 |
aStream := '' writeStream. |
|
1077 |
Method flushSourceStreamCache. |
|
1078 |
currentClass fileOutOn:aStream withTimeStamp:false. |
|
1079 |
currentSource := aStream contents asString. |
|
1080 |
aStream close. |
|
1081 |
||
1082 |
self activityNotification:'comparing...'. |
|
1083 |
||
1084 |
sourceToLoad = currentSource ifTrue:[ |
|
1085 |
"/ make all methods belong to the classes project |
|
1086 |
self setPackageOfAllMethodsIn:aClass to:aClass package. |
|
1095 | 1087 |
"/ (ChangeSet current includesChangeForClass:aClass) ifTrue:[ |
1088 |
"/ (self confirm:(resources string:'Versions are identical: %1.\\Remove entries from changeSet ?' with:aClass name) withCRs) |
|
1089 |
"/ ifTrue:[ |
|
1090 |
"/ self halt |
|
1091 |
"/ ] |
|
1092 |
"/ ] ifFalse:[ |
|
1093 |
self information:(resources string:'Versions are identical: %1' with:aClass name). |
|
1094 |
"/ ]. |
|
1006 | 1095 |
^ self. |
1096 |
]. |
|
1097 |
||
1098 |
self activityNotification:'generating diffSet...'. |
|
1099 |
listHere := ChangeSet fromStream:(currentSource readStream). |
|
1100 |
listRep := ChangeSet fromStream:(sourceToLoad readStream). |
|
1051 | 1101 |
|
1102 |
versionMethodsHere := listHere select:[:change | (change isMethodChange |
|
1103 |
and:[change selector == #version |
|
1104 |
and:[change changeClass isMeta]])]. |
|
1105 |
||
1106 |
versionMethodsRep := listRep select:[:change | (change isMethodChange |
|
1107 |
and:[change selector == #version |
|
1108 |
and:[change changeClass isMeta]])]. |
|
1109 |
||
1044 | 1110 |
"/ compare all but the version methods |
1111 |
listHere := listHere select:[:change | (change isMethodChange |
|
1112 |
and:[change selector == #version |
|
1113 |
and:[change changeClass isMeta]]) not]. |
|
1114 |
listRep := listRep select:[:change | (change isMethodChange |
|
1115 |
and:[change selector == #version |
|
1116 |
and:[change changeClass isMeta]]) not]. |
|
1117 |
||
1006 | 1118 |
diffSet := listHere diffSetsAgainst:listRep. |
1157 | 1119 |
changed := diffSet changed. |
1120 |
onlyHere := diffSet onlyInReceiver. |
|
1121 |
onlyInRep := diffSet onlyInArg. |
|
1006 | 1122 |
|
1050 | 1123 |
changedClassDefinitions := changed select:[:eachChangePair | eachChangePair first isClassDefinitionChange]. |
1124 |
changed := changed reject:[:eachChangePair | eachChangePair first isClassDefinitionChange]. |
|
1125 |
||
1121 | 1126 |
labels := #('Cancel' 'Merge' 'Load'). |
1006 | 1127 |
values := #(nil #merge #load). |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1128 |
default := askForRevision |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1129 |
ifTrue:[3. "i.e. load"] |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1130 |
ifFalse:[2. "i.e. merge"]. |
1006 | 1131 |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1132 |
msg := 'About to change ''%4''.\\'. |
1006 | 1133 |
onlyInRep size > 0 ifTrue:[ |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1134 |
msg := msg , 'The repositories version contains %1 method(s) which are not in your current class.\'. |
1006 | 1135 |
]. |
1136 |
onlyHere size > 0 ifTrue:[ |
|
1137 |
onlyInRep size > 0 ifTrue:[ |
|
1138 |
msg := msg , 'And there '. |
|
1139 |
] ifFalse:[ |
|
1140 |
msg := msg , 'There '. |
|
996 | 1141 |
]. |
1006 | 1142 |
msg := msg , 'are %2 methods in your current class, which are not in the repository.\'. |
1143 |
]. |
|
1144 |
changed size > 0 ifTrue:[ |
|
1054 | 1145 |
changed size == 1 ifTrue:[ |
1146 |
msg := msg , 'the ''%6''-method is different (present in both).\\'. |
|
1291
60d89faa389f
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
1262
diff
changeset
|
1147 |
singleChangeSelector := changed first first selector allBold |
1054 | 1148 |
] ifFalse:[ |
1149 |
msg := msg , '%3 methods are different (present in both).\\'. |
|
1150 |
] |
|
1006 | 1151 |
]. |
1050 | 1152 |
changedClassDefinitions size > 0 ifTrue:[ |
1153 |
changedClassDefinitions size == 1 ifTrue:[ |
|
1154 |
msg := msg , 'the class definition is different.\\'. |
|
1155 |
] ifFalse:[ |
|
1156 |
msg := msg , '%5 class definitions are different.\\'. |
|
1157 |
] |
|
1158 |
]. |
|
996 | 1159 |
|
1006 | 1160 |
onlyHere isEmpty ifTrue:[ |
1161 |
onlyInRep isEmpty ifTrue:[ |
|
1050 | 1162 |
(changed isEmpty and:[changedClassDefinitions isEmpty]) ifTrue:[ |
1006 | 1163 |
"/ make all methods belong to the classes project |
1055
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1164 |
versionMethodsRep size == 1 ifTrue:[ |
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1165 |
"/ (self confirm:(resources string:'Versions are identical: %1\\Update the version-ID ?' with:aClass name) withCRs) ifTrue:[ |
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1166 |
versionMethodsRep first apply. |
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1167 |
"/ ] |
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1168 |
]. |
1006 | 1169 |
self setPackageOfAllMethodsIn:aClass to:aClass package. |
1170 |
^ self |
|
1171 |
]. |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1172 |
msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made).'. |
1121 | 1173 |
labels := #('Cancel' 'Load'). |
1006 | 1174 |
values := #(nil #load). |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1175 |
default := askForRevision |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1176 |
ifTrue:[2. "i.e. load"] |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1177 |
ifFalse:[1. "i.e. cancel"]. |
1006 | 1178 |
] ifFalse:[ |
1179 |
changed isEmpty ifTrue:[ |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1180 |
msg := msg , '\Attention:\Load will load methods which are not present in ''%4''.'. |
1121 | 1181 |
labels := #('Cancel' 'Load'). |
987 | 1182 |
values := #(nil #load). |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1183 |
default := askForRevision |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1184 |
ifTrue:[2. "i.e. load"] |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1185 |
ifFalse:[1. "i.e. cancel"]. |
987 | 1186 |
] ifFalse:[ |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1187 |
msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'. |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1188 |
msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'. |
1006 | 1189 |
]. |
1190 |
] |
|
1191 |
] ifFalse:[ |
|
1192 |
onlyInRep isEmpty ifTrue:[ |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1193 |
msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made),'. |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1194 |
msg := msg , '\and remove added methods which are not present in the repository version.'. |
1121 | 1195 |
labels := #('Cancel' 'Load'). |
1006 | 1196 |
values := #(nil #load). |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1197 |
default := askForRevision |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1198 |
ifTrue:[2. "i.e. load"] |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1199 |
ifFalse:[1. "i.e. cancel"]. |
1006 | 1200 |
] ifFalse:[ |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1201 |
msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'. |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1202 |
msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'. |
1006 | 1203 |
] |
1204 |
]. |
|
1050 | 1205 |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1206 |
msg := msg bindWith:onlyInRep size printString |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1207 |
with:onlyHere size printString |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1208 |
with:changed size printString |
1050 | 1209 |
with:aClass name allBold |
1054 | 1210 |
with:changedClassDefinitions size printString |
1211 |
with:singleChangeSelector. |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1212 |
|
1006 | 1213 |
answer := (Dialog confirmWithCancel:msg withCRs |
1214 |
labels:(resources array:labels) |
|
1215 |
values:values |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1216 |
default:default). |
1006 | 1217 |
answer isNil ifTrue:[^ self]. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1218 |
|
1006 | 1219 |
self activityNotification:'updating...'. |
1220 |
changedClasses := IdentitySet new. |
|
1000 | 1221 |
|
1058
90807c795eb5
do update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1057
diff
changeset
|
1222 |
"/ Class withoutUpdatingChangesDo:[ |
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1223 |
answer == #load ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1224 |
changedClassDefinitions do:[:eachChangeArr | "apply this change (go to rep-version)" |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1225 |
|cHere cRep| |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1226 |
cHere := eachChangeArr at:1. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1227 |
cRep := eachChangeArr at:2. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1228 |
cRep apply. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1229 |
cRep isMethodChange ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1230 |
cRep changeMethod setPackage:(cRep changeClass package). |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1231 |
changedClasses add:cRep changeClass. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1232 |
] |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1233 |
]. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1234 |
]. |
1006 | 1235 |
onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)" |
1236 |
eachChange apply. |
|
1237 |
eachChange isMethodChange ifTrue:[ |
|
1011
647a8c2fabc1
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
1238 |
eachChange changeMethod setPackage:(eachChange changeClass package). |
1006 | 1239 |
changedClasses add:eachChange changeClass. |
1240 |
] |
|
1241 |
]. |
|
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1242 |
answer == #load ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1243 |
onlyHere do:[:eachChange | "remove this change (method not present in rep-version)" |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1244 |
|cClass cSel| |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1245 |
eachChange isMethodChange ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1246 |
cClass := eachChange changeClass. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1247 |
cSel := eachChange selector. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1248 |
cClass removeSelector:cSel. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1249 |
] |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1250 |
]. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1251 |
changed do:[:eachChangeArr | "apply this change (go to rep-version)" |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1252 |
|cHere cRep| |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1253 |
cHere := eachChangeArr at:1. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1254 |
cRep := eachChangeArr at:2. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1255 |
cRep apply. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1256 |
cRep isMethodChange ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1257 |
cRep changeMethod setPackage:(cRep changeClass package). |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1258 |
changedClasses add:cRep changeClass. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1259 |
] |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1260 |
]. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1261 |
"/ make all methods belong to the classes project |
1055
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1262 |
self setPackageOfAllMethodsIn:aClass to:aClass package. |
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1263 |
versionMethodsRep size == 1 ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1264 |
versionMethodsRep first apply. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1265 |
self setPackageOfAllMethodsIn:aClass to:aClass package. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1266 |
] ifFalse:[ |
1194 | 1267 |
self error:'too many version methods'. |
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1268 |
]. |
1055
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1269 |
]. |
1058
90807c795eb5
do update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1057
diff
changeset
|
1270 |
"/ ]. |
1006 | 1271 |
changedClasses do:[:eachClass | |
1272 |
eachClass changed:#projectOrganization. |
|
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1273 |
]. |
1011
647a8c2fabc1
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
1274 |
Smalltalk changed:#projectOrganization. |
1044 | 1275 |
|
1276 |
"Modified: / 7.2.2001 / 18:18:32 / ps" |
|
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1277 |
! |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1278 |
|
957 | 1279 |
compareClassWithRepository:aClass |
1280 |
"open a diff-textView comparing the current (in-image) version |
|
1281 |
against its orgiginal version found in the repository." |
|
1282 |
||
1283 |
|currentClass resources |
|
1194 | 1284 |
aStream comparedSource currentSource rev revString thisRevString mgr |
957 | 1285 |
nm msg rev2 newestRev |
1194 | 1286 |
containerModule containerPackage containerFile| |
957 | 1287 |
|
1288 |
resources := ResourcePack for:self. |
|
1289 |
||
1290 |
currentClass := aClass theNonMetaclass. |
|
1291 |
||
1292 |
nm := currentClass name. |
|
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1293 |
mgr := self sourceCodeManagerFor:currentClass. |
957 | 1294 |
mgr isNil ifTrue:[ |
1295 |
^ self |
|
1296 |
]. |
|
1297 |
rev := currentClass binaryRevision. |
|
1298 |
rev2 := currentClass revision. |
|
1299 |
rev isNil ifTrue:[ |
|
1300 |
rev := rev2 |
|
1301 |
]. |
|
1302 |
rev isNil ifTrue:[ |
|
1303 |
self warn:'Class seems to be not yet in the repository'. |
|
1304 |
^ self |
|
1305 |
]. |
|
1306 |
||
1307 |
"/ |
|
1308 |
"/ class in repository - ask for revision |
|
1309 |
"/ |
|
1310 |
newestRev := mgr newestRevisionOf:currentClass. |
|
1311 |
||
1312 |
msg := resources string:'compare to revision: (empty for newest)'. |
|
1313 |
rev notNil ifTrue:[ |
|
1314 |
msg := msg , '\\' , (resources string:'Current %1 is based upon rev %2.' |
|
1019 | 1315 |
with:nm allBold with:rev). |
957 | 1316 |
(rev2 notNil and:[rev2 ~= rev]) ifTrue:[ |
1317 |
msg := msg , '\' , (resources string:'And has been checked into the repository as %1.' |
|
1318 |
with:rev2) |
|
1319 |
] |
|
1320 |
]. |
|
1321 |
newestRev notNil ifTrue:[ |
|
1322 |
msg := msg , '\' , (resources string:'Newest in reporitory is %1.' |
|
1323 |
with:newestRev) |
|
1324 |
]. |
|
1325 |
||
1326 |
rev := SourceCodeManagerUtilities |
|
1327 |
askForExistingRevision:msg |
|
1328 |
title:'Compare with repository' |
|
1329 |
class:currentClass. |
|
1330 |
||
1331 |
(rev notNil or:[containerFile notNil]) ifTrue:[ |
|
1332 |
rev notNil ifTrue:[ |
|
1333 |
rev withoutSpaces isEmpty ifTrue:[ |
|
1334 |
msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'. |
|
1335 |
"/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm. |
|
1336 |
aStream := mgr getSourceStreamFor:currentClass revision:newestRev. |
|
1337 |
revString := '(newest: ' , (newestRev ? '???') , ')'. |
|
1338 |
] ifFalse:[ |
|
1339 |
msg := 'extracting previous %1'. |
|
1340 |
aStream := mgr getSourceStreamFor:currentClass revision:rev. |
|
1341 |
revString := rev |
|
1342 |
]. |
|
1343 |
] ifFalse:[ |
|
1344 |
msg := 'extracting newest version from ' , containerModule , '/' , containerPackage, '/' , containerFile. |
|
1345 |
aStream := mgr streamForClass:nil fileName:containerFile revision:#newest directory:containerPackage module:containerModule cache:false. |
|
1346 |
revString := '???' |
|
1347 |
]. |
|
1348 |
||
1349 |
aStream isNil ifTrue:[ |
|
1350 |
self warn:'could not extract source from repository'. |
|
1351 |
^ self |
|
1352 |
]. |
|
1353 |
aStream class readErrorSignal handle:[:ex | |
|
1245 | 1354 |
self warn:('read error while reading extracted source\\' , ex description) withCRs. |
957 | 1355 |
aStream close. |
1356 |
^ self |
|
1357 |
] do:[ |
|
1358 |
comparedSource := aStream contents asString. |
|
1359 |
]. |
|
1360 |
aStream close. |
|
1361 |
||
1362 |
self activityNotification:'generating current source ...'. |
|
1363 |
||
1364 |
aStream := '' writeStream. |
|
1365 |
Method flushSourceStreamCache. |
|
1366 |
currentClass fileOutOn:aStream withTimeStamp:false. |
|
1367 |
currentSource := aStream contents asString. |
|
1368 |
aStream close. |
|
1369 |
||
1370 |
self activityNotification:'comparing ...'. |
|
1371 |
||
1372 |
comparedSource = currentSource ifTrue:[ |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1373 |
self information:(resources string:'Versions are identical: %1' with:currentClass name). |
957 | 1374 |
] ifFalse:[ |
1375 |
thisRevString := currentClass revision. |
|
1376 |
thisRevString isNil ifTrue:[ |
|
1377 |
thisRevString := 'no revision' |
|
1378 |
]. |
|
1379 |
||
1380 |
revString = '(newest)' ifTrue:[ |
|
1381 |
(rev := mgr newestRevisionOf:currentClass) notNil ifTrue:[ |
|
1382 |
revString := '(newest is ' , rev , ')' |
|
1383 |
] |
|
1384 |
]. |
|
1385 |
||
1386 |
self activityNotification:'comparing ...'. |
|
1387 |
||
1070 | 1388 |
(UserPreferences versionDiffViewerClass) |
957 | 1389 |
openOnClass:currentClass |
1390 |
labelA:('repository: ' , revString) |
|
1391 |
sourceA:comparedSource |
|
1392 |
labelB:('current: (based on: ' , thisRevString , ')') |
|
1393 |
sourceB:currentSource |
|
1394 |
title:('comparing ' , currentClass name). |
|
1395 |
]. |
|
1396 |
]. |
|
1397 |
||
1398 |
" |
|
997 | 1399 |
self compareClassWithRepository:Array |
957 | 1400 |
" |
1401 |
! |
|
1402 |
||
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1403 |
createSourceContainerForClass:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1404 |
"let user specify the source-repository values for aClass" |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1405 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1406 |
|resources| |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1407 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1408 |
resources := ResourcePack for:self. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1409 |
^ self |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1410 |
defineSourceContainerForClass:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1411 |
title:(resources string:'Repository information for %1' with:aClass name) |
1030 | 1412 |
text:(resources string:'Create new repository container for ''%1''' with:aClass name allBold) |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1413 |
createDirectories:true |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1414 |
createContainer:true. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1415 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1416 |
! |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1417 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1418 |
defineSourceContainerForClass:aClass title:title text:boxText createDirectories:createDirs createContainer:createContainer |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1419 |
"let user specify the source-repository values for aClass" |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1420 |
|
1158 | 1421 |
| className |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1422 |
oldModule oldPackage oldFileName |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1423 |
module package fileName nameSpace nameSpacePrefix |
1158 | 1424 |
info project nm mgr creatingNew msg |
952
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1425 |
answer doCheckinWithoutAsking forceCheckIn resources rslt note |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1426 |
requiredPackage| |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1427 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1428 |
resources := ResourcePack for:self. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1429 |
aClass isLoaded ifFalse:[ |
1076 | 1430 |
self warn:(resources string:'Please load the %1-class first' with:aClass name). |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1431 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1432 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1433 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1434 |
className := aClass name. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1435 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1436 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1437 |
"/ defaults, if nothing at all is known |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1438 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1439 |
(module := LastModule) isNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1440 |
module := (OperatingSystem getLoginName). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1441 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1442 |
(package := LastPackage) isNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1443 |
package := 'private'. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1444 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1445 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1446 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1447 |
"/ try to extract some useful defaults from the current project |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1448 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1449 |
(Project notNil and:[(project := Project current) notNil]) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1450 |
package isNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1451 |
(nm := project repositoryDirectory) isNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1452 |
nm := project name |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1453 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1454 |
package := nm. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1455 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1456 |
module isNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1457 |
(nm := project repositoryModule) notNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1458 |
module := nm |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1459 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1460 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1461 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1462 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1463 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1464 |
"/ ask the sourceCodeManager if it knows anything about that class |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1465 |
"/ if so, take that as a default. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1466 |
"/ |
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1467 |
mgr := self sourceCodeManagerFor:aClass. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1468 |
mgr isNil ifTrue:[ |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1469 |
^ false |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1470 |
]. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1471 |
|
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1472 |
info := mgr sourceInfoOfClass:aClass. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1473 |
info notNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1474 |
module ~= LastModule ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1475 |
(info includesKey:#module) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1476 |
module := (info at:#module). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1477 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1478 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1479 |
package ~= LastPackage ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1480 |
(info includesKey:#directory) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1481 |
package := (info at:#directory). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1482 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1483 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1484 |
fileName := mgr containerFromSourceInfo:info. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1485 |
(nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1486 |
nameSpacePrefix := nameSpace name , '::'. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1487 |
(fileName startsWith:nameSpacePrefix) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1488 |
fileName := fileName copyFrom:(nameSpacePrefix size + 1). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1489 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1490 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1491 |
"/ (info includesKey:#fileName) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1492 |
"/ fileName := (info at:#fileName). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1493 |
"/ ] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1494 |
"/ (info includesKey:#expectedFileName) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1495 |
"/ fileName := (info at:#expectedFileName). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1496 |
"/ ] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1497 |
"/ (info includesKey:#classFileNameBase) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1498 |
"/ fileName := (info at:#classFileNameBase) , '.st'. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1499 |
"/ ] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1500 |
"/ ] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1501 |
"/ ] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1502 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1503 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1504 |
fileName isNil ifTrue:[ |
1338 | 1505 |
fileName := (Smalltalk fileNameForClass:aClass) , '.st'. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1506 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1507 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1508 |
OperatingSystem isMSDOSlike ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1509 |
module replaceAll:$\ with:$/. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1510 |
package replaceAll:$\ with:$/. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1511 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1512 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1513 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1514 |
"/ check for conflicts (i.e. if such a container already exists) ... |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1515 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1516 |
doCheckinWithoutAsking := false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1517 |
(mgr checkForExistingContainerInModule:module |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1518 |
package:package |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1519 |
container:fileName) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1520 |
answer := Dialog confirmWithCancel:(resources |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1521 |
string:'About to change the source container. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1522 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1523 |
Notice: there is a container for %1 in: |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1524 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1525 |
%2 / %3 / %4 |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1526 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1527 |
Do you want to change it or check right into that container ?' |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1528 |
with:className |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1529 |
with:module |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1530 |
with:package |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1531 |
with:fileName) |
1076 | 1532 |
labels:(resources array:#('Cancel' 'Check in' 'Change')). |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1533 |
answer isNil ifTrue:[AbortSignal raise]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1534 |
answer ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1535 |
doCheckinWithoutAsking := false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1536 |
oldModule := module. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1537 |
oldPackage := package. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1538 |
oldFileName := fileName |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1539 |
] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1540 |
doCheckinWithoutAsking := true. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1541 |
creatingNew := false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1542 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1543 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1544 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1545 |
doCheckinWithoutAsking ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1546 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1547 |
"/ open a dialog for this |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1548 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1549 |
(mgr checkForExistingContainerInModule:module |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1550 |
package:package |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1551 |
container:fileName) ifFalse:[ |
893 | 1552 |
note := 'Notice: class seems to have no container yet.'. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1553 |
creatingNew := true. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1554 |
] ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1555 |
creatingNew := false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1556 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1557 |
|
893 | 1558 |
rslt := self |
1559 |
askForContainer:boxText title:title note:note |
|
1030 | 1560 |
initialModule:module initialPackage:package initialFileName:fileName |
1561 |
forNewContainer:true. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1562 |
|
893 | 1563 |
rslt isNil ifTrue:[ |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1564 |
^ false |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1565 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1566 |
|
893 | 1567 |
module := rslt at:#module. |
1568 |
package := rslt at:#package. |
|
1569 |
fileName := rslt at:#fileName. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1570 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1571 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1572 |
(fileName endsWith:',v') ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1573 |
fileName := fileName copyWithoutLast:2 |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1574 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1575 |
(fileName endsWith:'.st') ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1576 |
fileName := fileName , '.st' |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1577 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1578 |
|
952
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1579 |
"/ we require the packageID to be <module>:<container-dir> |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1580 |
"/ check for this ... |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1581 |
|
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1582 |
requiredPackage := ((module ? '') , ':' , (package ? '')) asSymbol. |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1583 |
requiredPackage ~= aClass package ifTrue:[ |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1584 |
"/ doCheckinWithoutAsking ifFalse:[ |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1585 |
"/ (self confirm:'Change the classes packageID to: ''', requiredPackage , ''' ?') |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1586 |
"/ ifFalse:[ |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1587 |
"/ ^ false |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1588 |
"/ ] |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1589 |
"/ ]. |
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1076
diff
changeset
|
1590 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:requiredPackage]. |
952
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1591 |
aClass package:requiredPackage. |
981 | 1592 |
aClass changed:#projectOrganization. |
1011
647a8c2fabc1
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
1593 |
Smalltalk changed:#projectOrganization with:(Array with:aClass). |
952
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1594 |
]. |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1595 |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1596 |
info := aClass revisionInfo. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1597 |
info notNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1598 |
(info includesKey:#repositoryPathName) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1599 |
info := nil |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1600 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1601 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1602 |
info isNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1603 |
creatingNew ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1604 |
doCheckinWithoutAsking ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1605 |
(Dialog |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1606 |
confirm:(resources string:'The repository already contains a container named "%3" in "%1/%2" !!\\Checkin %4 anyway ? (DANGER - be careful)' |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1607 |
withArgs:(Array with:module with:package with:fileName with:className)) withCRs |
1076 | 1608 |
noLabel:'Cancel') |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1609 |
ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1610 |
^ false |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1611 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1612 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1613 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1614 |
|
1004
1bd564960810
dont ask if a version method should be created - just do it.
Claus Gittinger <cg@exept.de>
parents:
1000
diff
changeset
|
1615 |
true "doCheckinWithoutAsking" ifFalse:[ |
979 | 1616 |
answer := Dialog |
1617 |
confirmWithCancel:(resources string:'%1 does not have any (usable) revision info (#version method)\\Shall I create one ?' with:className) withCRs |
|
1076 | 1618 |
labels:(resources array:#( 'Cancel' 'No' 'Yes')). |
979 | 1619 |
answer isNil ifTrue:[^ false]. |
1620 |
] ifTrue:[ |
|
1621 |
answer := true. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1622 |
]. |
979 | 1623 |
answer ifTrue:[ |
1624 |
aClass updateVersionMethodFor:(mgr initialRevisionStringFor:aClass |
|
1625 |
inModule:module |
|
1626 |
package:package |
|
1627 |
container:fileName). |
|
1628 |
]. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1629 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1630 |
|
1158 | 1631 |
(self checkForExistingModule:module using:mgr allowCreate:(createDirs or:[creatingNew])) |
1632 |
ifFalse:[^ false]. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1633 |
LastModule := module. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1634 |
|
1158 | 1635 |
(self checkForExistingModule:module package:package using:mgr allowCreate:(createDirs or:[creatingNew])) |
1636 |
ifFalse:[^ false]. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1637 |
LastPackage := package. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1638 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1639 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1640 |
"/ check for the container itself |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1641 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1642 |
(mgr checkForExistingContainerInModule:module package:package container:fileName) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1643 |
creatingNew ifTrue:[ |
1076 | 1644 |
self warn:(resources string:'Container for %1 already exists in %2/%3.' with:fileName with:module with:package) withCRs. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1645 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1646 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1647 |
"/ (oldModule notNil |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1648 |
"/ and:[(oldModule ~= module) |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1649 |
"/ or:[oldPackage ~= package |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1650 |
"/ or:[oldFileName ~= fileName]]]) |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1651 |
"/ ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1652 |
"/ self warn:(resources string:'no change'). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1653 |
"/ ^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1654 |
"/ ]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1655 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1656 |
doCheckinWithoutAsking ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1657 |
(Dialog |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1658 |
confirm:(resources string:'check %1 into the existing container |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1659 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1660 |
%2 / %3 / %4 ?' |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1661 |
with:className |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1662 |
with:module |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1663 |
with:package |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1664 |
with:fileName) withCRs |
1076 | 1665 |
noLabel:'Cancel') |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1666 |
ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1667 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1668 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1669 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1670 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1671 |
aClass updateVersionMethodFor:'$' , 'Header' , '$'. "/ concatenated to avoid RCS-expansion |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1672 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1673 |
oldFileName notNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1674 |
msg := ('forced checkin / source container change from ' , oldFileName). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1675 |
] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1676 |
msg := 'defined source container' |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1677 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1678 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1679 |
(forceCheckIn := doCheckinWithoutAsking) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1680 |
(mgr |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1681 |
checkinClass:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1682 |
fileName:fileName |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1683 |
directory:package |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1684 |
module:module |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1685 |
logMessage:msg) |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1686 |
ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1687 |
doCheckinWithoutAsking ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1688 |
(Dialog |
1076 | 1689 |
confirm:'No easy merge seems possible; force checkin (no merge) ?' |
1690 |
noLabel:'Cancel') |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1691 |
ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1692 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1693 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1694 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1695 |
forceCheckIn := true. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1696 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1697 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1698 |
forceCheckIn ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1699 |
(mgr |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1700 |
checkinClass:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1701 |
fileName:fileName |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1702 |
directory:package |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1703 |
module:module |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1704 |
logMessage:msg |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1705 |
force:true) |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1706 |
ifFalse:[ |
1076 | 1707 |
self warn:(resources string:'Failed to check into existing container.'). |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1708 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1709 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1710 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1711 |
^ true |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1712 |
] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1713 |
(createContainer or:[creatingNew]) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1714 |
(Dialog |
1076 | 1715 |
confirm:(resources string:'No container exists for %1 in %2/%3\\create ?' |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1716 |
with:fileName with:module with:package) withCRs |
1076 | 1717 |
noLabel:'Cancel') ifFalse:[ |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1718 |
^ false |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1719 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1720 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1721 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1722 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1723 |
(mgr |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1724 |
createContainerFor:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1725 |
inModule:module |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1726 |
package:package |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1727 |
container:fileName) ifFalse:[ |
1076 | 1728 |
self warn:(resources string:'Failed to create container.'). |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1729 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1730 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1731 |
^ true |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1732 |
! |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1733 |
|
873 | 1734 |
getLogMessageFor:aString |
1735 |
"get a log message for checking in a class. |
|
1736 |
Return the message or nil if aborted." |
|
1737 |
||
1078 | 1738 |
^ self getLogMessageFor:aString initialAnswer:LastSourceLogMessage |
1739 |
||
1740 |
" |
|
1741 |
SourceCodeManagerUtilities getLogMessageFor:'hello' |
|
1742 |
" |
|
1743 |
! |
|
1744 |
||
1745 |
getLogMessageFor:aString initialAnswer:initialAnswer |
|
1746 |
"get a log message for checking in a class. |
|
1747 |
Return the message or nil if aborted." |
|
1748 |
||
875 | 1749 |
|resources logMsg| |
873 | 1750 |
|
1751 |
resources := ResourcePack for:self. |
|
875 | 1752 |
logMsg := Dialog |
1207 | 1753 |
requestText:(resources string:'Enter log message for: %1' with:aString allBold) |
873 | 1754 |
lines:10 |
1755 |
columns:70 |
|
1131 | 1756 |
initialAnswer:(initialAnswer ? LastSourceLogMessage ? ''). |
1078 | 1757 |
|
875 | 1758 |
logMsg notNil ifTrue:[ |
1759 |
LastSourceLogMessage := logMsg |
|
1760 |
]. |
|
1761 |
^ logMsg |
|
873 | 1762 |
|
1763 |
" |
|
875 | 1764 |
SourceCodeManagerUtilities getLogMessageFor:'hello' |
873 | 1765 |
" |
957 | 1766 |
! |
1767 |
||
1768 |
getLogMessageFor:aString withButton:additionalButton |
|
1769 |
"get a log message for checking in a class. |
|
1770 |
Return the message or nil if aborted." |
|
1771 |
||
1772 |
|resources logMsg dialog textHolder| |
|
1773 |
||
1774 |
resources := ResourcePack for:self. |
|
1775 |
textHolder := '' asValue. |
|
1776 |
dialog := Dialog |
|
1777 |
forRequestText:(resources string:'enter log message for: %1' with:aString) |
|
1778 |
lines:10 |
|
1779 |
columns:70 |
|
1780 |
initialAnswer:LastSourceLogMessage |
|
1781 |
model:textHolder. |
|
1782 |
||
1783 |
additionalButton notNil ifTrue:[ |
|
1784 |
dialog addButton:additionalButton before:(dialog okButton). |
|
1785 |
]. |
|
1786 |
||
1787 |
dialog open. |
|
1788 |
dialog accepted ifFalse:[ |
|
1789 |
^ nil. |
|
1790 |
]. |
|
1791 |
logMsg := textHolder value. |
|
1792 |
"/ logMsg := Dialog |
|
1793 |
"/ requestText:(resources string:'enter log message for: %1' with:aString) |
|
1794 |
"/ lines:10 |
|
1795 |
"/ columns:70 |
|
1796 |
"/ initialAnswer:LastSourceLogMessage. |
|
1797 |
logMsg notNil ifTrue:[ |
|
1798 |
LastSourceLogMessage := logMsg |
|
1799 |
]. |
|
1800 |
^ logMsg |
|
1801 |
||
1802 |
" |
|
1803 |
SourceCodeManagerUtilities getLogMessageFor:'hello' |
|
1804 |
SourceCodeManagerUtilities getLogMessageFor:'hello' withButton:(Button label:'foo') |
|
1805 |
" |
|
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1806 |
! |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1807 |
|
1068
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1808 |
getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1809 |
"check-out all previous versions of aClass and retrieve the history of selector. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1810 |
Return a dictionary associating revision with a changeList entries for that method. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1811 |
Unfinished - need a GUI for that." |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1812 |
|
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1813 |
|mgr theClass revisionLog revisions items s entriesPerRevision previousVersion| |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1814 |
|
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1815 |
theClass := aClass theNonMetaclass. |
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1816 |
|
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1817 |
mgr := self sourceCodeManagerFor:theClass. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1818 |
mgr isNil ifTrue:[ |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1819 |
self error:'no sourceCodeManager'. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1820 |
]. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1821 |
|
1068
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1822 |
revisionLog := mgr |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1823 |
revisionLogOf:theClass |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1824 |
numberOfRevisions:numberOfRevisionsOrNil. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1825 |
|
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1826 |
revisions := revisionLog at:#revisions. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1827 |
items := revisions collect:[:each | |rev date who| |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1828 |
rev := each at:#revision. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1829 |
date := each at:#date. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1830 |
who := each at:#author. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1831 |
rev allBold , ' [' , date , ' by ' , who , ']' |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1832 |
]. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1833 |
|
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1834 |
revisions := revisions collect:[:each | each at:#revision]. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1835 |
revisions addFirst:#current. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1836 |
entriesPerRevision := Dictionary new. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1837 |
|
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1838 |
previousVersion := nil. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1839 |
revisions reverseDo:[:eachRevision | |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1840 |
|srcStream entries thisVersion| |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1841 |
|
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1842 |
eachRevision == #current ifTrue:[ |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1843 |
s := '' writeStream. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1844 |
theClass fileOutOn:s withTimeStamp:false. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1845 |
srcStream := s contents readStream. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1846 |
] ifFalse:[ |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1847 |
self activityNotification:('checking out revision ' , eachRevision , '...'). |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1848 |
srcStream := mgr getSourceStreamFor:theClass revision:eachRevision. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1849 |
]. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1850 |
|
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1851 |
entries := ChangeSet fromStream:srcStream. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1852 |
srcStream close. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1853 |
|
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1854 |
"/ remove all definitions |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1855 |
entries := entries select:[:each | each isMethodChange]. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1856 |
"/ remove all methods which are for other selectors |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1857 |
entries := entries select:[:each | each selector == selector]. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1858 |
"/ remove all methods which are for private subclasses |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1859 |
entries := entries select:[:each | each className = aClass name]. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1860 |
|
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1861 |
entries size == 1 ifTrue:[ |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1862 |
"/ the method is there |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1863 |
thisVersion := entries first. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1864 |
(previousVersion notNil and:[previousVersion sameAs:thisVersion]) ifTrue:[ |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1865 |
"/ no change |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1866 |
] ifFalse:[ |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1867 |
entriesPerRevision at:eachRevision put:thisVersion. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1868 |
]. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1869 |
] ifFalse:[ |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1870 |
"/ the method is not there |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1871 |
]. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1872 |
previousVersion := thisVersion. |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1873 |
]. |
1194 | 1874 |
self error:'unfinished code'. |
1068
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1875 |
|
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1876 |
" |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1877 |
self getMethodVersionsOfClass:MenuPanel selector:#'helpTextForItem:' numberOfRevisions:20 |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1878 |
self getMethodVersionsOfClass:NewLauncher class selector:#'menu' numberOfRevisions:20 |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1879 |
" |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1880 |
! |
200fbe3c8bf3
prepared method-history extraction support.
Claus Gittinger <cg@exept.de>
parents:
1065
diff
changeset
|
1881 |
|
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1882 |
removeSourceContainerForClass:aClass |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1883 |
"show container & let user confirm twice." |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1884 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1885 |
^ self removeSourceContainerForClass:aClass confirm:true warn:true |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1886 |
! |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1887 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1888 |
removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1889 |
"show container & optionally let user confirm twice." |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1890 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1891 |
|module package fileName info mgr resources| |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1892 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1893 |
resources := ResourcePack for:self. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1894 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1895 |
aClass isLoaded ifFalse:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1896 |
doWarn ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1897 |
self warn:(resources string:'Please load the class first.'). |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1898 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1899 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1900 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1901 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1902 |
"/ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1903 |
"/ ask the sourceCodeManager if it knows anything about that class |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1904 |
"/ if so, take that as a default. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1905 |
"/ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1906 |
mgr := aClass sourceCodeManager. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1907 |
mgr isNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1908 |
doWarn ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1909 |
self warn:(resources string:'No sourceCodeManagement.'). |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1910 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1911 |
^ false |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1912 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1913 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1914 |
info := mgr sourceInfoOfClass:aClass. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1915 |
info notNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1916 |
(info includesKey:#module) ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1917 |
module := (info at:#module). |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1918 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1919 |
(info includesKey:#directory) ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1920 |
package := (info at:#directory). |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1921 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1922 |
fileName := mgr containerFromSourceInfo:info. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1923 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1924 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1925 |
module isNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1926 |
doWarn ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1927 |
self warn:(resources string:'classes module is unknown.\\It seems to not have a container.') withCRs. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1928 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1929 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1930 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1931 |
package isNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1932 |
doWarn ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1933 |
self warn:(resources string:'classes package is unknown.\\It seems to not have a container.') withCRs. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1934 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1935 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1936 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1937 |
fileName isNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1938 |
doWarn ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1939 |
self warn:(resources string:'classes container fileName is unknown.\\It seems to not have a container.') withCRs. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1940 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1941 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1942 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1943 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1944 |
OperatingSystem isMSDOSlike ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1945 |
module replaceAll:$\ with:$/. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1946 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1947 |
OperatingSystem isMSDOSlike ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1948 |
package replaceAll:$\ with:$/. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1949 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1950 |
(mgr checkForExistingContainerInModule:module |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1951 |
package:package |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1952 |
container:fileName) ifFalse:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1953 |
doWarn ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1954 |
self warn:(resources string:'Class has no source container.') withCRs. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1955 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1956 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1957 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1958 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1959 |
doConfirm ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1960 |
(Dialog |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1961 |
choose:(resources |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1962 |
string:'Please confirm removal of the container for %1: |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1963 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1964 |
container: %2 / %3 / %4 |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1965 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1966 |
Really remove ?' |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1967 |
with:aClass name |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1968 |
with:module |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1969 |
with:package |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1970 |
with:fileName) |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1971 |
labels:(Array |
1129 | 1972 |
with:(resources string:'No') |
1973 |
with:(resources string:'Remove')) |
|
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1974 |
values:#(false true) |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1975 |
default:false) ifFalse:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1976 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1977 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1978 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1979 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1980 |
(mgr removeContainerFor:aClass |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1981 |
inModule:module |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1982 |
package:package |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1983 |
container:fileName) ifFalse:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1984 |
doWarn ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1985 |
self warn:(resources string:'failed to remove container.'). |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1986 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1987 |
^ true. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1988 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
1989 |
^ false |
1000 | 1990 |
! |
1991 |
||
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
1992 |
repositoryLogOf:aClass onto:aStream |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
1993 |
|info rv mgr info2 module fn msg s| |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
1994 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
1995 |
info := aClass revisionInfo. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
1996 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
1997 |
rv := aClass binaryRevision. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
1998 |
rv notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
1999 |
aStream nextPutLine:'**** Loaded classes binary information ****'; cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2000 |
aStream nextPutLine:' Binary based upon : ' , rv. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2001 |
aStream cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2002 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2003 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2004 |
info notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2005 |
mgr := aClass sourceCodeManager. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2006 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2007 |
(info includesKey:#revision) ifFalse:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2008 |
aStream nextPutLine:'WARNING:'; cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2009 |
aStream nextPutLine:' The class seems not to be loaded from the repository.'. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2010 |
aStream nextPutLine:' Check carefully before checking anything in.'. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2011 |
aStream nextPutLine:' (i.e. compare with repository for renamed class(es), same-name but unrelated etc.)'. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2012 |
aStream cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2013 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2014 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2015 |
aStream nextPutLine:'**** Classes source information ****'; cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2016 |
s := info at:#repositoryPath ifAbsent:nil. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2017 |
s notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2018 |
aStream nextPutLine:' Source repository : ' , s |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2019 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2020 |
aStream nextPutLine:' Filename ........ : ' , (info at:#fileName ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2021 |
aStream nextPutLine:' Revision ........ : ' , (info at:#revision ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2022 |
aStream nextPutLine:' Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , (info at:#time ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2023 |
aStream nextPutLine:' Checkin user .... : ' , (info at:#user ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2024 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2025 |
(info2 := aClass packageSourceCodeInfo) notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2026 |
aStream nextPutLine:' Repository: ..... : ' , (info2 at:#module ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2027 |
aStream nextPutLine:' Directory: ...... : ' , (info2 at:#directory ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2028 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2029 |
aStream nextPutLine:' Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2030 |
aStream cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2031 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2032 |
mgr notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2033 |
aStream nextPutLine:'**** Repository information ****'; cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2034 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2035 |
module := info2 at:#module ifAbsent:nil. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2036 |
module notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2037 |
aStream nextPutLine:(' CVS Root ......: ' , |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2038 |
((mgr repositoryNameForModule:module) ifNil:[mgr repositoryName , ' (default)'])). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2039 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2040 |
mgr writeRevisionLogOf:aClass to:aStream. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2041 |
] |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2042 |
] ifFalse:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2043 |
aStream nextPutLine:'No revision info found'. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2044 |
aClass isLoaded ifFalse:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2045 |
aStream cr; nextPutAll:'This is an autoloaded class - you may see more after its loaded.' |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2046 |
] ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2047 |
fn := aClass classFilename. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2048 |
aClass wasAutoloaded ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2049 |
msg := 'This class was autoloaded.'. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2050 |
fn notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2051 |
msg := msg , ' (from ''' , fn , ''')'. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2052 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2053 |
] ifFalse:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2054 |
fn notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2055 |
msg := 'This class was loaded from ''' , fn , '''.' |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2056 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2057 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2058 |
msg notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2059 |
aStream cr; nextPutAll:msg. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2060 |
] |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2061 |
] |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2062 |
] |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2063 |
! |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2064 |
|
1000 | 2065 |
setPackageOfAllMethodsIn:aClass to:aPackage |
2066 |
"make all methods belong to the classes project" |
|
2067 |
||
2068 |
|anyChange anyChangeHere| |
|
2069 |
||
2070 |
anyChange := false. |
|
2071 |
aClass withAllPrivateClassesDo:[:eachClass | |
|
2072 |
anyChangeHere := false. |
|
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1076
diff
changeset
|
2073 |
eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
1000 | 2074 |
mthd package ~= aPackage ifTrue:[ |
1011
647a8c2fabc1
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2075 |
mthd setPackage:aPackage. |
1000 | 2076 |
anyChangeHere := true. |
2077 |
]. |
|
2078 |
]. |
|
2079 |
anyChangeHere ifTrue:[ |
|
2080 |
eachClass changed:#projectOrganization |
|
2081 |
]. |
|
2082 |
anyChangeHere ifTrue:[anyChange := true]. |
|
2083 |
]. |
|
1011
647a8c2fabc1
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2084 |
anyChange ifTrue:[ |
647a8c2fabc1
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2085 |
Smalltalk changed:#projectOrganization |
647a8c2fabc1
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2086 |
]. |
1000 | 2087 |
^ anyChange |
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2088 |
! |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2089 |
|
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2090 |
sourceCodeManagerFor:aClass |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2091 |
|mgr| |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2092 |
|
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2093 |
mgr := (aClass sourceCodeManager). |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2094 |
mgr isNil ifTrue:[ |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2095 |
SourceCodeManager isNil ifTrue:[ |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2096 |
(self warn:'SourceCodeManagement is disabled or not configured.\\Please setup in the Launcher.' withCRs) ifFalse:[ |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2097 |
^ nil |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2098 |
]. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2099 |
]. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2100 |
(self confirm:'Class does not seem to provide a valid sourceCodeManager.\\Assume CVS ?' withCRs) ifFalse:[ |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2101 |
^ nil |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2102 |
]. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2103 |
mgr := CVSSourceCodeManager. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2104 |
]. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2105 |
^ mgr |
873 | 2106 |
! ! |
2107 |
||
2108 |
!SourceCodeManagerUtilities class methodsFor:'documentation'! |
|
2109 |
||
2110 |
version |
|
1338 | 2111 |
^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.93 2003-10-26 15:26:20 cg Exp $' |
873 | 2112 |
! ! |