360
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
MCDialog subclass:#MCCommitDialog
|
|
4 |
instanceVariableNames:'workingCopyHolder repositoryHolder versionNameHolder
|
742
|
5 |
messageHolder messageView versionNameFinderProcess
|
|
6 |
includeExtrasForSTX'
|
569
|
7 |
classVariableNames:'LastRepository'
|
360
|
8 |
poolDictionaries:''
|
580
|
9 |
category:'SCM-Monticello-St/X UI'
|
360
|
10 |
!
|
|
11 |
|
|
12 |
|
742
|
13 |
!MCCommitDialog class methodsFor:'help specs'!
|
|
14 |
|
|
15 |
flyByHelpSpec
|
|
16 |
"This resource specification was automatically generated
|
|
17 |
by the UIHelpTool of ST/X."
|
|
18 |
|
|
19 |
"Do not manually edit this!! If it is corrupted,
|
|
20 |
the UIHelpTool may not be able to read the specification."
|
|
21 |
|
|
22 |
"
|
|
23 |
UIHelpTool openOnClass:MCCommitDialog
|
|
24 |
"
|
|
25 |
|
|
26 |
<resource: #help>
|
|
27 |
|
|
28 |
^ super flyByHelpSpec addPairsFrom:#(
|
|
29 |
|
|
30 |
#commitMessage
|
|
31 |
'A log message describing this version (your changes)'
|
|
32 |
|
|
33 |
#includeExtrasForSTX
|
|
34 |
'Include extra support files (makefiles) needed to build a binary class library under ST/X.
|
|
35 |
If this is not checked, only the plain code is saved which is needed to load the package as bytecode.
|
|
36 |
Notice, that those files are not strictly required - they can easily be recreated by loading the package,
|
|
37 |
and then recreating the support files from the system browser on the target system.
|
|
38 |
Turn this off, if this package is meant to be transported to or shared with other Smalltalk dialects.
|
|
39 |
(however, this is transparent to other Smalltalk dialects - these will simply ignore these additional definitions)'
|
|
40 |
|
|
41 |
#repository
|
|
42 |
'A repository or the name of a directory where the generated package file is to be stored'
|
|
43 |
|
|
44 |
#versionName
|
|
45 |
'The name of the version (will also be the name of the generated package file)'
|
|
46 |
|
|
47 |
)
|
|
48 |
! !
|
|
49 |
|
360
|
50 |
!MCCommitDialog class methodsFor:'interface specs'!
|
|
51 |
|
|
52 |
contentSpec
|
|
53 |
"This resource specification was automatically generated
|
|
54 |
by the UIPainter of ST/X."
|
|
55 |
|
|
56 |
"Do not manually edit this!! If it is corrupted,
|
|
57 |
the UIPainter may not be able to read the specification."
|
|
58 |
|
|
59 |
"
|
|
60 |
UIPainter new openOnClass:MCCommitDialog andSelector:#contentSpec
|
|
61 |
MCCommitDialog new openInterface:#contentSpec
|
|
62 |
"
|
|
63 |
|
|
64 |
<resource: #canvas>
|
|
65 |
|
|
66 |
^
|
|
67 |
#(FullSpec
|
|
68 |
name: contentSpec
|
|
69 |
window:
|
|
70 |
(WindowSpec
|
|
71 |
label: 'Commit Dialog'
|
|
72 |
name: 'Commit Dialog'
|
|
73 |
min: (Point 10 10)
|
742
|
74 |
bounds: (Rectangle 0 0 555 303)
|
360
|
75 |
)
|
|
76 |
component:
|
|
77 |
(SpecCollection
|
|
78 |
collection: (
|
537
|
79 |
(LabelSpec
|
|
80 |
label: 'Repository:'
|
|
81 |
name: 'Label1'
|
|
82 |
layout: (LayoutFrame 3 0 4 0 94 0 26 0)
|
742
|
83 |
activeHelpKey: repository
|
537
|
84 |
translateLabel: true
|
|
85 |
adjust: left
|
|
86 |
)
|
360
|
87 |
(ComboListSpec
|
|
88 |
name: 'RepositoryList'
|
537
|
89 |
layout: (LayoutFrame 101 0 0 0 0 1 25 0)
|
742
|
90 |
activeHelpKey: repository
|
360
|
91 |
model: repositoryHolder
|
|
92 |
comboList: repositoryList
|
|
93 |
useIndex: false
|
|
94 |
)
|
537
|
95 |
(LabelSpec
|
|
96 |
label: 'Version:'
|
|
97 |
name: 'Label2'
|
|
98 |
layout: (LayoutFrame 3 0 30 0 94 0 52 0)
|
742
|
99 |
activeHelpKey: versionName
|
537
|
100 |
translateLabel: true
|
|
101 |
adjust: left
|
|
102 |
)
|
360
|
103 |
(InputFieldSpec
|
|
104 |
name: 'VersionName'
|
537
|
105 |
layout: (LayoutFrame 101 0 30 0 0 1 55 0)
|
742
|
106 |
activeHelpKey: versionName
|
360
|
107 |
model: versionNameHolder
|
|
108 |
immediateAccept: true
|
|
109 |
acceptOnReturn: true
|
|
110 |
acceptOnTab: true
|
|
111 |
acceptOnPointerLeave: true
|
|
112 |
)
|
|
113 |
(TextEditorSpec
|
|
114 |
name: 'CommitMessage'
|
742
|
115 |
layout: (LayoutFrame 0 0 90 0 0 1 0 1)
|
|
116 |
activeHelpKey: commitMessage
|
360
|
117 |
model: messageHolder
|
|
118 |
hasHorizontalScrollBar: true
|
|
119 |
hasVerticalScrollBar: true
|
|
120 |
hasKeyboardFocusInitially: false
|
|
121 |
postBuildCallback: postBuildMessageView:
|
|
122 |
)
|
742
|
123 |
(CheckBoxSpec
|
|
124 |
label: 'Include ST/X Support Files'
|
|
125 |
name: 'CheckBox1'
|
|
126 |
layout: (LayoutFrame 96 0 63 0 232 1 85 0)
|
|
127 |
activeHelpKey: includeExtrasForSTX
|
|
128 |
model: includeExtrasForSTX
|
|
129 |
translateLabel: true
|
|
130 |
)
|
360
|
131 |
)
|
|
132 |
|
|
133 |
)
|
|
134 |
)
|
|
135 |
! !
|
|
136 |
|
|
137 |
!MCCommitDialog methodsFor:'accessing'!
|
|
138 |
|
|
139 |
workingCopy: aMCWorkingCopy
|
|
140 |
|
|
141 |
^self workingCopyHolder value: aMCWorkingCopy
|
|
142 |
|
|
143 |
"Created: / 14-09-2010 / 23:43:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
144 |
! !
|
|
145 |
|
|
146 |
!MCCommitDialog methodsFor:'accessing - defaults'!
|
|
147 |
|
|
148 |
defaultTitle
|
|
149 |
"superclass MCDialog says that I am responsible to implement this method"
|
|
150 |
|
537
|
151 |
^ 'Monticello Commit'
|
360
|
152 |
|
|
153 |
"Modified: / 14-09-2010 / 23:00:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
537
|
154 |
"Modified: / 02-12-2011 / 15:44:08 / cg"
|
360
|
155 |
! !
|
|
156 |
|
|
157 |
!MCCommitDialog methodsFor:'actions'!
|
|
158 |
|
|
159 |
doAccept
|
537
|
160 |
self acceptEnabled ifFalse:[^self].
|
360
|
161 |
|
537
|
162 |
self withWaitCursorDo:[
|
|
163 |
|workingCopy version repository newVersionString stxPackageID defClass|
|
|
164 |
|
|
165 |
workingCopy := self workingCopyHolder value.
|
569
|
166 |
repository := self repositoryHolder value.
|
|
167 |
LastRepository := repository.
|
|
168 |
|
537
|
169 |
[
|
|
170 |
version := workingCopy newVersion
|
|
171 |
] on: MCVersionNameAndMessageRequest do:[:n |
|
|
172 |
n resume: (Array with: self versionNameHolder value
|
|
173 |
with: messageView contents asText string)
|
|
174 |
].
|
|
175 |
|
|
176 |
stxPackageID := version package name.
|
|
177 |
defClass := ProjectDefinition definitionClassForPackage:stxPackageID.
|
|
178 |
newVersionString := MCSourceCodeManager revisionStringForVersion:version.
|
360
|
179 |
|
537
|
180 |
"/ update all project classes version_MC
|
|
181 |
defClass allClasses do:[:cls |
|
|
182 |
MCSourceCodeManager
|
|
183 |
updateVersionMethod:(MCSourceCodeManager nameOfVersionMethodInClasses)
|
|
184 |
of:cls
|
|
185 |
for:newVersionString.
|
|
186 |
].
|
|
187 |
|
|
188 |
"/ update the project definition classes version_MC
|
|
189 |
MCSourceCodeManager
|
|
190 |
updateVersionMethod:(MCSourceCodeManager nameOfVersionMethodInClasses)
|
|
191 |
of:defClass
|
|
192 |
for:newVersionString.
|
|
193 |
MCSourceCodeManager
|
|
194 |
updateVersionMethod:(MCSourceCodeManager nameOfVersionMethodForExtensions)
|
|
195 |
of:defClass
|
|
196 |
for:newVersionString.
|
|
197 |
|
|
198 |
"/ sigh: make a new snapshot (now with updated version methods)
|
|
199 |
version snapshot:version package snapshot.
|
742
|
200 |
version cachable:false. "/ force new a write (otherwise, the mcz is not rewritten)
|
|
201 |
version snapshot includeExtrasForSTX:(self includeExtrasForSTX value).
|
537
|
202 |
repository storeVersion: version.
|
|
203 |
super doAccept.
|
|
204 |
].
|
360
|
205 |
|
|
206 |
"Created: / 15-09-2010 / 14:07:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
569
|
207 |
"Modified: / 24-07-2012 / 16:33:56 / cg"
|
360
|
208 |
! !
|
|
209 |
|
|
210 |
!MCCommitDialog methodsFor:'aspects'!
|
|
211 |
|
742
|
212 |
includeExtrasForSTX
|
|
213 |
includeExtrasForSTX isNil ifTrue:[
|
757
|
214 |
includeExtrasForSTX := false "true" asValue.
|
742
|
215 |
].
|
|
216 |
^ includeExtrasForSTX
|
|
217 |
!
|
|
218 |
|
360
|
219 |
messageHolder
|
|
220 |
"return/create the 'messageHolder' value holder (automatically generated)"
|
|
221 |
|
|
222 |
messageHolder isNil ifTrue:[
|
|
223 |
messageHolder := ValueHolder with: ('Commit message' asText colorizeAllWith: Color gray).
|
|
224 |
messageHolder addDependent:self.
|
|
225 |
].
|
|
226 |
^ messageHolder
|
|
227 |
|
|
228 |
"Modified: / 15-09-2010 / 13:58:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
229 |
!
|
|
230 |
|
|
231 |
messageHolder:something
|
|
232 |
"set the 'messageHolder' value holder (automatically generated)"
|
|
233 |
|
|
234 |
|oldValue newValue|
|
|
235 |
|
|
236 |
messageHolder notNil ifTrue:[
|
|
237 |
oldValue := messageHolder value.
|
|
238 |
messageHolder removeDependent:self.
|
|
239 |
].
|
|
240 |
messageHolder := something.
|
|
241 |
messageHolder notNil ifTrue:[
|
|
242 |
messageHolder addDependent:self.
|
|
243 |
].
|
|
244 |
newValue := messageHolder value.
|
|
245 |
oldValue ~~ newValue ifTrue:[
|
|
246 |
self update:#value with:newValue from:messageHolder.
|
|
247 |
].
|
|
248 |
!
|
|
249 |
|
|
250 |
repositoryHolder
|
|
251 |
"return/create the 'repositoryHolder' value holder (automatically generated)"
|
|
252 |
|
569
|
253 |
|initial|
|
|
254 |
|
360
|
255 |
repositoryHolder isNil ifTrue:[
|
|
256 |
repositoryHolder := ValueHolder new.
|
569
|
257 |
initial := LastRepository.
|
|
258 |
initial isNil ifTrue:[
|
|
259 |
initial := UserPreferences current at:#mcPrimaryRepository ifAbsent:nil.
|
|
260 |
].
|
|
261 |
repositoryHolder value:initial.
|
360
|
262 |
repositoryHolder addDependent:self.
|
|
263 |
].
|
|
264 |
^ repositoryHolder
|
529
|
265 |
|
569
|
266 |
"Modified: / 24-07-2012 / 16:32:01 / cg"
|
360
|
267 |
!
|
|
268 |
|
|
269 |
repositoryHolder:something
|
|
270 |
"set the 'repositoryHolder' value holder (automatically generated)"
|
|
271 |
|
|
272 |
|oldValue newValue|
|
|
273 |
|
|
274 |
repositoryHolder notNil ifTrue:[
|
|
275 |
oldValue := repositoryHolder value.
|
|
276 |
repositoryHolder removeDependent:self.
|
|
277 |
].
|
|
278 |
repositoryHolder := something.
|
|
279 |
repositoryHolder notNil ifTrue:[
|
|
280 |
repositoryHolder addDependent:self.
|
|
281 |
].
|
|
282 |
newValue := repositoryHolder value.
|
|
283 |
oldValue ~~ newValue ifTrue:[
|
|
284 |
self update:#value with:newValue from:repositoryHolder.
|
|
285 |
].
|
|
286 |
!
|
|
287 |
|
|
288 |
repositoryList
|
|
289 |
|
573
|
290 |
^[MCRepositoryGroup default repositories
|
|
291 |
, #(nil)
|
|
292 |
, (Array with:(resources string:'Add Repository...')) ]
|
360
|
293 |
|
|
294 |
"Created: / 14-09-2010 / 23:16:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
573
|
295 |
"Modified: / 31-08-2012 / 11:39:42 / cg"
|
360
|
296 |
!
|
|
297 |
|
|
298 |
versionNameHolder
|
|
299 |
"return/create the 'versionNameHolder' value holder (automatically generated)"
|
|
300 |
|
|
301 |
versionNameHolder isNil ifTrue:[
|
|
302 |
versionNameHolder := ValueHolder new.
|
|
303 |
versionNameHolder addDependent:self.
|
|
304 |
].
|
|
305 |
^ versionNameHolder
|
|
306 |
!
|
|
307 |
|
|
308 |
versionNameHolder:something
|
|
309 |
"set the 'versionNameHolder' value holder (automatically generated)"
|
|
310 |
|
|
311 |
|oldValue newValue|
|
|
312 |
|
|
313 |
versionNameHolder notNil ifTrue:[
|
|
314 |
oldValue := versionNameHolder value.
|
|
315 |
versionNameHolder removeDependent:self.
|
|
316 |
].
|
|
317 |
versionNameHolder := something.
|
|
318 |
versionNameHolder notNil ifTrue:[
|
|
319 |
versionNameHolder addDependent:self.
|
|
320 |
].
|
|
321 |
newValue := versionNameHolder value.
|
|
322 |
oldValue ~~ newValue ifTrue:[
|
|
323 |
self update:#value with:newValue from:versionNameHolder.
|
|
324 |
].
|
|
325 |
!
|
|
326 |
|
|
327 |
workingCopyHolder
|
|
328 |
"return/create the 'workingCopyHolder' value holder (automatically generated)"
|
|
329 |
|
|
330 |
workingCopyHolder isNil ifTrue:[
|
|
331 |
workingCopyHolder := ValueHolder new.
|
|
332 |
workingCopyHolder addDependent:self.
|
|
333 |
].
|
|
334 |
^ workingCopyHolder
|
|
335 |
!
|
|
336 |
|
|
337 |
workingCopyHolder:something
|
|
338 |
"set the 'workingCopyHolder' value holder (automatically generated)"
|
|
339 |
|
|
340 |
|oldValue newValue|
|
|
341 |
|
|
342 |
workingCopyHolder notNil ifTrue:[
|
|
343 |
oldValue := workingCopyHolder value.
|
|
344 |
workingCopyHolder removeDependent:self.
|
|
345 |
].
|
|
346 |
workingCopyHolder := something.
|
|
347 |
workingCopyHolder notNil ifTrue:[
|
|
348 |
workingCopyHolder addDependent:self.
|
|
349 |
].
|
|
350 |
newValue := workingCopyHolder value.
|
|
351 |
oldValue ~~ newValue ifTrue:[
|
|
352 |
self update:#value with:newValue from:workingCopyHolder.
|
|
353 |
].
|
|
354 |
! !
|
|
355 |
|
|
356 |
!MCCommitDialog methodsFor:'change & update'!
|
|
357 |
|
573
|
358 |
findUniqueVersionNumber
|
|
359 |
| wc versionName |
|
|
360 |
|
|
361 |
self versionNameHolder value:('One Moment, please...' colorizeAllWith:Color grey).
|
|
362 |
|
|
363 |
wc := self workingCopyHolder value.
|
|
364 |
self assert:wc notNil.
|
|
365 |
|
|
366 |
self subtitle: wc package name.
|
|
367 |
versionName := wc uniqueVersionName.
|
|
368 |
self
|
|
369 |
enqueueMessage:#updateVersionNumberTo:
|
|
370 |
for:self
|
|
371 |
arguments: { versionName }
|
|
372 |
|
|
373 |
"Created: / 31-08-2012 / 11:49:56 / cg"
|
|
374 |
!
|
|
375 |
|
360
|
376 |
messageChanged
|
|
377 |
|
|
378 |
self halt
|
|
379 |
|
|
380 |
"Created: / 15-09-2010 / 10:04:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
381 |
!
|
|
382 |
|
|
383 |
repositoryChanged
|
573
|
384 |
self repositoryHolder value isString ifTrue:[
|
|
385 |
MCSettingsApp open.
|
|
386 |
self repositoryHolder
|
|
387 |
value:(self repositoryList value first)
|
|
388 |
withoutNotifying:self.
|
|
389 |
].
|
360
|
390 |
|
|
391 |
self updateAcceptEnabled
|
|
392 |
|
|
393 |
"Created: / 15-09-2010 / 14:02:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
573
|
394 |
"Modified: / 31-08-2012 / 12:01:02 / cg"
|
360
|
395 |
!
|
|
396 |
|
|
397 |
update:something with:aParameter from:changedObject
|
|
398 |
"Invoked when an object that I depend upon sends a change notification."
|
|
399 |
|
|
400 |
"stub code automatically generated - please change as required"
|
|
401 |
|
|
402 |
changedObject == workingCopyHolder ifTrue:[
|
|
403 |
self workingCopyChanged.
|
|
404 |
^ self.
|
|
405 |
].
|
|
406 |
|
|
407 |
changedObject == messageHolder ifTrue:[
|
|
408 |
self messageChanged.
|
|
409 |
^ self.
|
|
410 |
].
|
|
411 |
changedObject == repositoryHolder ifTrue:[
|
|
412 |
self repositoryChanged.
|
|
413 |
^ self.
|
|
414 |
].
|
|
415 |
|
|
416 |
super update:something with:aParameter from:changedObject
|
|
417 |
|
|
418 |
"Modified: / 15-09-2010 / 14:02:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
419 |
!
|
|
420 |
|
|
421 |
updateAcceptEnabled
|
573
|
422 |
| enabled |
|
360
|
423 |
|
|
424 |
enabled := true.
|
|
425 |
enabled := enabled and:[self workingCopyHolder value notNil].
|
|
426 |
enabled := enabled and:[self repositoryHolder value notNil].
|
|
427 |
self acceptEnabledHolder value: enabled.
|
|
428 |
|
|
429 |
"Created: / 15-09-2010 / 14:01:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
573
|
430 |
"Modified: / 31-08-2012 / 11:59:09 / cg"
|
|
431 |
!
|
|
432 |
|
|
433 |
updateVersionNumberTo:versionName
|
|
434 |
self versionNameHolder value: versionName.
|
|
435 |
self updateAcceptEnabled
|
|
436 |
|
|
437 |
"Created: / 31-08-2012 / 11:54:15 / cg"
|
360
|
438 |
!
|
|
439 |
|
|
440 |
workingCopyChanged
|
573
|
441 |
|p|
|
360
|
442 |
|
573
|
443 |
self window isNil ifTrue:[
|
|
444 |
versionNameFinderProcess isNil ifTrue:[
|
|
445 |
versionNameFinderProcess :=
|
|
446 |
[
|
|
447 |
self findUniqueVersionNumber.
|
|
448 |
] fork.
|
|
449 |
].
|
|
450 |
^ self.
|
|
451 |
].
|
|
452 |
|
|
453 |
(self workingCopyHolder value) notNil ifTrue:[
|
|
454 |
(p := versionNameFinderProcess) notNil ifTrue:[
|
|
455 |
versionNameFinderProcess := nil.
|
|
456 |
p terminateAndWait.
|
|
457 |
].
|
|
458 |
self findUniqueVersionNumber.
|
|
459 |
].
|
360
|
460 |
|
|
461 |
"Created: / 15-09-2010 / 09:30:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
462 |
"Modified: / 15-09-2010 / 14:01:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
573
|
463 |
"Modified: / 31-08-2012 / 11:53:32 / cg"
|
360
|
464 |
! !
|
|
465 |
|
|
466 |
!MCCommitDialog methodsFor:'hooks'!
|
|
467 |
|
|
468 |
postBuildMessageView: aView
|
|
469 |
|
|
470 |
messageView := aView scrolledView
|
|
471 |
|
|
472 |
"Created: / 15-09-2010 / 13:56:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
473 |
! !
|
|
474 |
|
|
475 |
!MCCommitDialog class methodsFor:'documentation'!
|
|
476 |
|
|
477 |
version
|
757
|
478 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCCommitDialog.st,v 1.9 2013-03-21 17:40:07 cg Exp $'
|
360
|
479 |
!
|
|
480 |
|
|
481 |
version_CVS
|
757
|
482 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCCommitDialog.st,v 1.9 2013-03-21 17:40:07 cg Exp $'
|
573
|
483 |
!
|
|
484 |
|
|
485 |
version_MC
|
|
486 |
^ '§stx:goodies/monticello-cg.3 4e70fe70-f030-11e1-ac62-001f3bda2d09 2012-08-27T12:16:46 cg§'
|
360
|
487 |
!
|
|
488 |
|
|
489 |
version_SVN
|
|
490 |
^ '§Id: MCCommitDialog.st 12 2010-09-15 13:13:22Z vranyj1 §'
|
|
491 |
! !
|
742
|
492 |
|