67
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCPatcher
|
|
4 |
instanceVariableNames:'definitions'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Monticello-Patching'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCPatcher class methodsFor:'as yet unclassified'!
|
|
12 |
|
|
13 |
apply: aPatch to: aSnapshot
|
|
14 |
| loader |
|
255
|
15 |
loader := self snapshot: aSnapshot.
|
67
|
16 |
aPatch applyTo: loader.
|
|
17 |
^ loader patchedSnapshot
|
|
18 |
!
|
|
19 |
|
|
20 |
snapshot: aSnapshot
|
|
21 |
^ self new initializeWithSnapshot: aSnapshot
|
|
22 |
! !
|
|
23 |
|
|
24 |
!MCPatcher methodsFor:'as yet unclassified'!
|
|
25 |
|
|
26 |
addDefinition: aDefinition
|
|
27 |
definitions add: aDefinition
|
|
28 |
!
|
|
29 |
|
|
30 |
initializeWithSnapshot: aSnapshot
|
255
|
31 |
definitions := MCDefinitionIndex definitions: aSnapshot definitions
|
67
|
32 |
!
|
|
33 |
|
|
34 |
modifyDefinition: baseDefinition to: targetDefinition
|
|
35 |
self addDefinition: targetDefinition
|
|
36 |
!
|
|
37 |
|
|
38 |
patchedSnapshot
|
|
39 |
^ MCSnapshot fromDefinitions: definitions definitions
|
|
40 |
!
|
|
41 |
|
|
42 |
removeDefinition: aDefinition
|
|
43 |
definitions remove: aDefinition
|
|
44 |
! !
|
|
45 |
|
|
46 |
!MCPatcher class methodsFor:'documentation'!
|
|
47 |
|
|
48 |
version
|
255
|
49 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCPatcher.st,v 1.2 2011-08-20 11:48:18 cg Exp $'
|
|
50 |
!
|
|
51 |
|
|
52 |
version_CVS
|
|
53 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCPatcher.st,v 1.2 2011-08-20 11:48:18 cg Exp $'
|
|
54 |
!
|
|
55 |
|
|
56 |
version_SVN
|
|
57 |
^ '§Id: MCPatcher.st 5 2010-08-29 07:30:29Z vranyj1 §'
|
67
|
58 |
! !
|