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