author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 07 Sep 2015 15:37:41 +0100 | |
branch | jv |
changeset 1002 | 54b4906215ca |
parent 895 | b85534b16bd4 |
child 1100 | fa939598a32a |
permissions | -rw-r--r-- |
104 | 1 |
"{ Package: 'stx:goodies/monticello' }" |
2 |
||
1002
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
4 |
|
104 | 5 |
Object subclass:#MCSnapshot |
895
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
6 |
instanceVariableNames:'definitions' |
104 | 7 |
classVariableNames:'' |
8 |
poolDictionaries:'' |
|
681 | 9 |
category:'SCM-Monticello-Base' |
104 | 10 |
! |
11 |
||
12 |
||
13 |
!MCSnapshot class methodsFor:'as yet unclassified'! |
|
14 |
||
15 |
empty |
|
16 |
^ self fromDefinitions: #() |
|
17 |
! |
|
18 |
||
19 |
fromDefinitions: aCollection |
|
20 |
^ self new initializeWithDefinitions: aCollection |
|
21 |
! ! |
|
22 |
||
23 |
!MCSnapshot methodsFor:'accessing'! |
|
24 |
||
25 |
= other |
|
26 |
^ definitions asArray = other definitions asArray |
|
27 |
! |
|
28 |
||
29 |
definitions |
|
30 |
^ definitions |
|
31 |
! |
|
32 |
||
33 |
hash |
|
34 |
^ definitions asArray hash |
|
740 | 35 |
! |
36 |
||
37 |
includeExtrasForSTX |
|
1002
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
38 |
<resource: #obsolete> |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
39 |
|
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
40 |
self obsoleteFeatureWarning:'Use `options includeExtrasForSTX` instead'. |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
41 |
^ self options includeExtrasForSTX |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
42 |
|
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
43 |
"Modified: / 07-09-2015 / 15:28:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
44 |
! |
895
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
45 |
|
1002
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
46 |
includeExtrasForSTX: aBoolean |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
47 |
<resource: #obsolete> |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
48 |
|
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
49 |
self obsoleteFeatureWarning:'Use `options includeExtrasForSTX: aBoolean` instead'. |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
50 |
self options includeExtrasForSTX: aBoolean |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
51 |
|
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
52 |
"Modified: / 07-09-2015 / 15:27:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
740 | 53 |
! |
54 |
||
1002
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
55 |
options |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
56 |
"Return a snapshot options (as MCSnapshotOptions) with options |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
57 |
for the receiver. Options may be modified." |
895
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
58 |
|
1002
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
59 |
| options | |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
60 |
options := self objectAttributeAt: #options. |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
61 |
options isNil ifTrue:[ |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
62 |
options := MCSnapshotOptions new. |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
63 |
options := self objectAttributeAt: #options put: options. |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
64 |
]. |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
65 |
^ options |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
66 |
|
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
67 |
"Created: / 07-09-2015 / 15:24:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
68 |
! |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
69 |
|
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
70 |
options: aMCSnapshotOptions |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
71 |
self objectAttributeAt: #options put: aMCSnapshotOptions. |
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
72 |
|
54b4906215ca
Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
895
diff
changeset
|
73 |
"Created: / 07-09-2015 / 15:26:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
104 | 74 |
! ! |
75 |
||
203 | 76 |
!MCSnapshot methodsFor:'converting'! |
77 |
||
78 |
asChangeSet |
|
79 |
||
80 |
^(ChangeSet withAll: |
|
81 |
(self definitions collect:[:def|def asChange])) |
|
82 |
||
83 |
"Created: / 13-10-2010 / 17:18:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
84 |
"Modified: / 26-10-2010 / 23:05:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
85 |
! ! |
|
86 |
||
849
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
87 |
!MCSnapshot methodsFor:'copying'! |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
88 |
|
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
89 |
postCopy |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
90 |
"Do half-shallow copy of definitions to allow for their transformation" |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
91 |
definitions := definitions copy. |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
92 |
1 to: definitions size do:[:i| |
874 | 93 |
definitions at: i put: (definitions at:i) copy |
849
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
94 |
] |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
95 |
|
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
96 |
"Created: / 29-05-2013 / 01:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
874 | 97 |
"Modified: / 31-05-2013 / 00:54:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
849
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
98 |
! ! |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
99 |
|
104 | 100 |
!MCSnapshot methodsFor:'initializing'! |
101 |
||
102 |
initializeWithDefinitions: aCollection |
|
203 | 103 |
definitions := aCollection. |
104 | 104 |
! ! |
105 |
||
106 |
!MCSnapshot methodsFor:'loading'! |
|
107 |
||
108 |
install |
|
109 |
MCPackageLoader installSnapshot: self |
|
110 |
! |
|
111 |
||
112 |
updatePackage: aPackage |
|
113 |
MCPackageLoader updatePackage: aPackage withSnapshot: self |
|
114 |
! ! |
|
115 |
||
116 |
!MCSnapshot methodsFor:'patching'! |
|
117 |
||
118 |
patchRelativeToBase: aSnapshot |
|
119 |
^ MCPatch fromBase: aSnapshot target: self |
|
120 |
! ! |
|
121 |
||
862
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
122 |
!MCSnapshot methodsFor:'queries'! |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
123 |
|
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
124 |
includesClassNamed: className |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
125 |
definitions reverseDo:[:definition| |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
126 |
(definition isClassDefinition and:[definition className = className]) |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
127 |
ifTrue:[ ^ true ]. |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
128 |
]. |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
129 |
^false |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
130 |
|
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
131 |
"Created: / 31-05-2013 / 00:04:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
132 |
! ! |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
133 |
|
104 | 134 |
!MCSnapshot class methodsFor:'documentation'! |
135 |
||
136 |
version |
|
895
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
137 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCSnapshot.st,v 1.10 2013-08-12 00:59:30 vrany Exp $' |
203 | 138 |
! |
139 |
||
140 |
version_CVS |
|
895
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
141 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCSnapshot.st,v 1.10 2013-08-12 00:59:30 vrany Exp $' |
203 | 142 |
! |
143 |
||
144 |
version_SVN |
|
895
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
145 |
^ '$Id: MCSnapshot.st,v 1.10 2013-08-12 00:59:30 vrany Exp $' |
104 | 146 |
! ! |
740 | 147 |