1
|
1 |
"{ Package: 'stx:goodies/metacello' }"
|
|
2 |
|
|
3 |
MetacelloScriptNotification subclass:#MetacelloResolveProjectUpgrade
|
|
4 |
instanceVariableNames:'existingProjectRegistration newProjectRegistration'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Metacello-Core-Scripts'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MetacelloResolveProjectUpgrade methodsFor:'accessing'!
|
|
12 |
|
|
13 |
existingProjectRegistration
|
|
14 |
^ existingProjectRegistration
|
|
15 |
!
|
|
16 |
|
|
17 |
existingProjectRegistration: anObject
|
|
18 |
existingProjectRegistration := anObject
|
|
19 |
!
|
|
20 |
|
|
21 |
newProjectRegistration
|
|
22 |
^ newProjectRegistration
|
|
23 |
!
|
|
24 |
|
|
25 |
newProjectRegistration: anObject
|
|
26 |
newProjectRegistration := anObject
|
|
27 |
!
|
|
28 |
|
|
29 |
operationString
|
|
30 |
self subclassResponsibility
|
|
31 |
! !
|
|
32 |
|
|
33 |
!MetacelloResolveProjectUpgrade methodsFor:'exception handling'!
|
|
34 |
|
|
35 |
allow
|
|
36 |
self checkAllowed.
|
|
37 |
self resume: self newProjectRegistration
|
|
38 |
!
|
|
39 |
|
|
40 |
allowEvenIfLocked
|
|
41 |
self resume: self newProjectRegistration
|
|
42 |
!
|
|
43 |
|
|
44 |
defaultAction
|
|
45 |
"Result of signal should be the projectRegistration to be used to perform the load ... default is to disallow"
|
|
46 |
|
|
47 |
^ self existingProjectRegistration
|
|
48 |
!
|
|
49 |
|
|
50 |
disallow
|
|
51 |
"default action"
|
|
52 |
|
|
53 |
self resume: self existingProjectRegistration
|
|
54 |
! !
|
|
55 |
|
|
56 |
!MetacelloResolveProjectUpgrade methodsFor:'handlers'!
|
|
57 |
|
|
58 |
handleOnDownGrade: onDownGradeBlock onUpgrade: onUpgradeBlock
|
|
59 |
self subclassResponsibility
|
|
60 |
! !
|
|
61 |
|
|
62 |
!MetacelloResolveProjectUpgrade methodsFor:'private'!
|
|
63 |
|
|
64 |
checkAllowed
|
|
65 |
self existingProjectRegistration locked
|
|
66 |
ifTrue: [
|
|
67 |
MetacelloLockedProjectError
|
|
68 |
signal:
|
|
69 |
'Attempt to perform' , self operationString printString , ' a locked project: '
|
|
70 |
, self existingProjectRegistration printString ]
|
|
71 |
! !
|
|
72 |
|
|
73 |
!MetacelloResolveProjectUpgrade class methodsFor:'documentation'!
|
|
74 |
|
|
75 |
version_SVN
|
|
76 |
^ '$Id:: $'
|
|
77 |
! !
|