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