author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 31 May 2013 02:15:12 +0200 | |
changeset 874 | 7a9d528b0eae |
parent 862 | a48551f0494d |
child 895 | b85534b16bd4 |
permissions | -rw-r--r-- |
104 | 1 |
"{ Package: 'stx:goodies/monticello' }" |
2 |
||
3 |
Object subclass:#MCSnapshot |
|
740 | 4 |
instanceVariableNames:'definitions includeExtrasForSTX' |
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!! |
|
38 |
^ includeExtrasForSTX ? false |
|
740 | 39 |
! |
40 |
||
41 |
includeExtrasForSTX:something |
|
42 |
includeExtrasForSTX := something. |
|
104 | 43 |
! ! |
44 |
||
203 | 45 |
!MCSnapshot methodsFor:'converting'! |
46 |
||
47 |
asChangeSet |
|
48 |
||
49 |
^(ChangeSet withAll: |
|
50 |
(self definitions collect:[:def|def asChange])) |
|
51 |
||
52 |
"Created: / 13-10-2010 / 17:18:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
53 |
"Modified: / 26-10-2010 / 23:05:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
54 |
! ! |
|
55 |
||
849
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
56 |
!MCSnapshot methodsFor:'copying'! |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
57 |
|
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
58 |
postCopy |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
59 |
"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
|
60 |
definitions := definitions copy. |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
61 |
1 to: definitions size do:[:i| |
874 | 62 |
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
|
63 |
] |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
64 |
|
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
65 |
"Created: / 29-05-2013 / 01:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
874 | 66 |
"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
|
67 |
! ! |
86415336eb1e
More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
745
diff
changeset
|
68 |
|
104 | 69 |
!MCSnapshot methodsFor:'initializing'! |
70 |
||
71 |
initializeWithDefinitions: aCollection |
|
203 | 72 |
definitions := aCollection. |
104 | 73 |
! ! |
74 |
||
75 |
!MCSnapshot methodsFor:'loading'! |
|
76 |
||
77 |
install |
|
78 |
MCPackageLoader installSnapshot: self |
|
79 |
! |
|
80 |
||
81 |
updatePackage: aPackage |
|
82 |
MCPackageLoader updatePackage: aPackage withSnapshot: self |
|
83 |
! ! |
|
84 |
||
85 |
!MCSnapshot methodsFor:'patching'! |
|
86 |
||
87 |
patchRelativeToBase: aSnapshot |
|
88 |
^ MCPatch fromBase: aSnapshot target: self |
|
89 |
! ! |
|
90 |
||
862
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
91 |
!MCSnapshot methodsFor:'queries'! |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
92 |
|
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
93 |
includesClassNamed: className |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
94 |
definitions reverseDo:[:definition| |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
95 |
(definition isClassDefinition and:[definition className = className]) |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
96 |
ifTrue:[ ^ true ]. |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
97 |
]. |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
98 |
^false |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
99 |
|
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
100 |
"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
|
101 |
! ! |
a48551f0494d
More improvements in pre-write transformations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
849
diff
changeset
|
102 |
|
104 | 103 |
!MCSnapshot class methodsFor:'documentation'! |
104 |
||
105 |
version |
|
874 | 106 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCSnapshot.st,v 1.9 2013-05-31 00:15:12 vrany Exp $' |
203 | 107 |
! |
108 |
||
109 |
version_CVS |
|
874 | 110 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCSnapshot.st,v 1.9 2013-05-31 00:15:12 vrany Exp $' |
203 | 111 |
! |
112 |
||
113 |
version_SVN |
|
874 | 114 |
^ '$Id: MCSnapshot.st,v 1.9 2013-05-31 00:15:12 vrany Exp $' |
104 | 115 |
! ! |
740 | 116 |