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