30
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
MCMczReader subclass:#MCMcdReader
|
|
4 |
instanceVariableNames:'baseInfo patch'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Monticello-Storing'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCMcdReader class methodsFor:'as yet unclassified'!
|
|
12 |
|
|
13 |
extension
|
|
14 |
^ 'mcd'
|
|
15 |
! !
|
|
16 |
|
|
17 |
!MCMcdReader methodsFor:'as yet unclassified'!
|
|
18 |
|
|
19 |
baseInfo
|
|
20 |
^ baseInfo ifNil: [self loadBaseInfo]
|
|
21 |
!
|
|
22 |
|
|
23 |
basicVersion
|
|
24 |
^ MCDiffyVersion
|
|
25 |
package: self package
|
|
26 |
info: self info
|
|
27 |
dependencies: self dependencies
|
|
28 |
baseInfo: self baseInfo
|
|
29 |
patch: self patch
|
|
30 |
!
|
|
31 |
|
|
32 |
buildPatchFrom: oldDefinitions to: newDefinitions
|
|
33 |
^ MCPatch
|
|
34 |
fromBase: (MCSnapshot fromDefinitions: oldDefinitions)
|
|
35 |
target: (MCSnapshot fromDefinitions: newDefinitions)
|
|
36 |
!
|
|
37 |
|
|
38 |
loadBaseInfo
|
|
39 |
^ baseInfo _ self extractInfoFrom: (self parseMember: 'base')
|
|
40 |
!
|
|
41 |
|
|
42 |
loadPatch
|
|
43 |
| old new |
|
|
44 |
(self zip memberNamed: 'patch.bin') ifNotNilDo:
|
|
45 |
[:m | [^ patch _ (DataStream on: m contentStream) next ]
|
|
46 |
on: Error do: [:fallThrough ]].
|
|
47 |
definitions _ OrderedCollection new.
|
|
48 |
(self zip membersMatching: 'old/*')
|
|
49 |
do: [:m | self extractDefinitionsFrom: m].
|
|
50 |
old _ definitions asArray.
|
|
51 |
definitions _ OrderedCollection new.
|
|
52 |
(self zip membersMatching: 'new/*')
|
|
53 |
do: [:m | self extractDefinitionsFrom: m].
|
|
54 |
new _ definitions asArray.
|
|
55 |
^ patch _ self buildPatchFrom: old to: new.
|
|
56 |
|
|
57 |
!
|
|
58 |
|
|
59 |
patch
|
|
60 |
^ patch ifNil: [self loadPatch]
|
|
61 |
! !
|
|
62 |
|
|
63 |
!MCMcdReader class methodsFor:'documentation'!
|
|
64 |
|
|
65 |
version
|
|
66 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCMcdReader.st,v 1.1 2006-11-22 13:04:52 cg Exp $'
|
|
67 |
! !
|