author | convert-repo |
Tue, 28 May 2019 03:27:24 +0000 | |
changeset 1097 | 180bdb478bc0 |
parent 1096 | 4e37cbca898d |
permissions | -rw-r--r-- |
104 | 1 |
"{ Package: 'stx:goodies/monticello' }" |
2 |
||
1039 | 3 |
"{ NameSpace: Smalltalk }" |
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 |
|
745 | 38 |
"/ do not default to true here, as the version is snapshotted twice in order to |
39 |
"/ update the version-strings, and we don not need this stuff in the first round!! |
|
895
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
40 |
| includeExtrasForSTX | |
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
41 |
includeExtrasForSTX := self objectAttributeAt: #includeExtrasForSTX. |
745 | 42 |
^ includeExtrasForSTX ? false |
895
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
43 |
|
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
44 |
"Modified: / 12-08-2013 / 01:57:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
740 | 45 |
! |
46 |
||
47 |
includeExtrasForSTX:something |
|
895
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
48 |
self objectAttributeAt: #includeExtrasForSTX put: something. |
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
49 |
|
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
50 |
"Modified: / 12-08-2013 / 01:57:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
104 | 51 |
! ! |
52 |
||
203 | 53 |
!MCSnapshot methodsFor:'converting'! |
54 |
||
55 |
asChangeSet |
|
1039 | 56 |
|changes| |
203 | 57 |
|
1039 | 58 |
changes := ChangeSet new. |
59 |
self definitions do:[:def|def addChangesTo:changes]. |
|
60 |
^ changes |
|
203 | 61 |
|
62 |
"Created: / 13-10-2010 / 17:18:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
63 |
"Modified: / 26-10-2010 / 23:05:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
64 |
! ! |
|
65 |
||
1096 | 66 |
!MCSnapshot methodsFor:'copying-private'! |
849
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
67 |
|
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
68 |
postCopy |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
69 |
"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
|
70 |
definitions := definitions copy. |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
71 |
1 to: definitions size do:[:i| |
874 | 72 |
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
|
73 |
] |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
74 |
|
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
75 |
"Created: / 29-05-2013 / 01:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
874 | 76 |
"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
|
77 |
! ! |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
78 |
|
104 | 79 |
!MCSnapshot methodsFor:'initializing'! |
80 |
||
81 |
initializeWithDefinitions: aCollection |
|
203 | 82 |
definitions := aCollection. |
104 | 83 |
! ! |
84 |
||
85 |
!MCSnapshot methodsFor:'loading'! |
|
86 |
||
87 |
install |
|
88 |
MCPackageLoader installSnapshot: self |
|
89 |
! |
|
90 |
||
91 |
updatePackage: aPackage |
|
92 |
MCPackageLoader updatePackage: aPackage withSnapshot: self |
|
93 |
! ! |
|
94 |
||
95 |
!MCSnapshot methodsFor:'patching'! |
|
96 |
||
97 |
patchRelativeToBase: aSnapshot |
|
98 |
^ MCPatch fromBase: aSnapshot target: self |
|
99 |
! ! |
|
100 |
||
862
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
101 |
!MCSnapshot methodsFor:'queries'! |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
102 |
|
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
103 |
includesClassNamed: className |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
104 |
definitions reverseDo:[:definition| |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
105 |
(definition isClassDefinition and:[definition className = className]) |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
106 |
ifTrue:[ ^ true ]. |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
107 |
]. |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
108 |
^false |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
109 |
|
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
110 |
"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
|
111 |
! ! |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
112 |
|
104 | 113 |
!MCSnapshot class methodsFor:'documentation'! |
114 |
||
115 |
version |
|
1039 | 116 |
^ '$Header$' |
203 | 117 |
! |
118 |
||
119 |
version_CVS |
|
1039 | 120 |
^ '$Header$' |
203 | 121 |
! |
122 |
||
123 |
version_SVN |
|
1039 | 124 |
^ '$Id$' |
104 | 125 |
! ! |
740 | 126 |