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