author | Claus Gittinger <cg@exept.de> |
Mon, 14 May 2018 02:21:18 +0200 | |
changeset 1048 | 582b3a028cbc |
parent 1039 | 88f5b1106042 |
child 1096 | 4e37cbca898d |
permissions | -rw-r--r-- |
1039 | 1 |
"{ Encoding: utf8 }" |
2 |
||
104 | 3 |
"{ Package: 'stx:goodies/monticello' }" |
4 |
||
1039 | 5 |
"{ NameSpace: Smalltalk }" |
6 |
||
104 | 7 |
Object subclass:#MCSnapshot |
895
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
8 |
instanceVariableNames:'definitions' |
104 | 9 |
classVariableNames:'' |
10 |
poolDictionaries:'' |
|
681 | 11 |
category:'SCM-Monticello-Base' |
104 | 12 |
! |
13 |
||
14 |
||
15 |
!MCSnapshot class methodsFor:'as yet unclassified'! |
|
16 |
||
17 |
empty |
|
18 |
^ self fromDefinitions: #() |
|
19 |
! |
|
20 |
||
21 |
fromDefinitions: aCollection |
|
22 |
^ self new initializeWithDefinitions: aCollection |
|
23 |
! ! |
|
24 |
||
25 |
!MCSnapshot methodsFor:'accessing'! |
|
26 |
||
27 |
= other |
|
28 |
^ definitions asArray = other definitions asArray |
|
29 |
! |
|
30 |
||
31 |
definitions |
|
32 |
^ definitions |
|
33 |
! |
|
34 |
||
35 |
hash |
|
36 |
^ definitions asArray hash |
|
740 | 37 |
! |
38 |
||
39 |
includeExtrasForSTX |
|
745 | 40 |
"/ do not default to true here, as the version is snapshotted twice in order to |
41 |
"/ 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
|
42 |
| includeExtrasForSTX | |
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
43 |
includeExtrasForSTX := self objectAttributeAt: #includeExtrasForSTX. |
745 | 44 |
^ includeExtrasForSTX ? false |
895
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
45 |
|
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
46 |
"Modified: / 12-08-2013 / 01:57:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
740 | 47 |
! |
48 |
||
49 |
includeExtrasForSTX:something |
|
895
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
50 |
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
|
51 |
|
b85534b16bd4
Make includeExtrasForSTX an object attribute instead of instvar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
874
diff
changeset
|
52 |
"Modified: / 12-08-2013 / 01:57:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
104 | 53 |
! ! |
54 |
||
203 | 55 |
!MCSnapshot methodsFor:'converting'! |
56 |
||
57 |
asChangeSet |
|
1039 | 58 |
|changes| |
203 | 59 |
|
1039 | 60 |
changes := ChangeSet new. |
61 |
self definitions do:[:def|def addChangesTo:changes]. |
|
62 |
^ changes |
|
203 | 63 |
|
64 |
"Created: / 13-10-2010 / 17:18:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
65 |
"Modified: / 26-10-2010 / 23:05:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
66 |
! ! |
|
67 |
||
849
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
68 |
!MCSnapshot methodsFor:'copying'! |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
69 |
|
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
70 |
postCopy |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
71 |
"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
|
72 |
definitions := definitions copy. |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
73 |
1 to: definitions size do:[:i| |
874 | 74 |
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
|
75 |
] |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
76 |
|
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
77 |
"Created: / 29-05-2013 / 01:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
874 | 78 |
"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
|
79 |
! ! |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
80 |
|
104 | 81 |
!MCSnapshot methodsFor:'initializing'! |
82 |
||
83 |
initializeWithDefinitions: aCollection |
|
203 | 84 |
definitions := aCollection. |
104 | 85 |
! ! |
86 |
||
87 |
!MCSnapshot methodsFor:'loading'! |
|
88 |
||
89 |
install |
|
90 |
MCPackageLoader installSnapshot: self |
|
91 |
! |
|
92 |
||
93 |
updatePackage: aPackage |
|
94 |
MCPackageLoader updatePackage: aPackage withSnapshot: self |
|
95 |
! ! |
|
96 |
||
97 |
!MCSnapshot methodsFor:'patching'! |
|
98 |
||
99 |
patchRelativeToBase: aSnapshot |
|
100 |
^ MCPatch fromBase: aSnapshot target: self |
|
101 |
! ! |
|
102 |
||
862
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
103 |
!MCSnapshot methodsFor:'queries'! |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
104 |
|
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
105 |
includesClassNamed: className |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
106 |
definitions reverseDo:[:definition| |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
107 |
(definition isClassDefinition and:[definition className = className]) |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
108 |
ifTrue:[ ^ true ]. |
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 |
^false |
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 |
"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
|
113 |
! ! |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
114 |
|
104 | 115 |
!MCSnapshot class methodsFor:'documentation'! |
116 |
||
117 |
version |
|
1039 | 118 |
^ '$Header$' |
203 | 119 |
! |
120 |
||
121 |
version_CVS |
|
1039 | 122 |
^ '$Header$' |
203 | 123 |
! |
124 |
||
125 |
version_SVN |
|
1039 | 126 |
^ '$Id$' |
104 | 127 |
! ! |
740 | 128 |