67
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCPatcher
|
|
4 |
instanceVariableNames:'definitions'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
667
|
7 |
category:'SCM-Monticello-Patching'
|
67
|
8 |
!
|
|
9 |
|
789
|
10 |
!MCPatcher class methodsFor:'documentation'!
|
|
11 |
|
|
12 |
documentation
|
|
13 |
"
|
|
14 |
I can add or remove or modify definitions. My main purpose is to generate
|
|
15 |
monticello snapshot out of multiple snapshots or definitions by using my
|
|
16 |
most used method #apply:to:.
|
|
17 |
"
|
|
18 |
! !
|
67
|
19 |
|
|
20 |
!MCPatcher class methodsFor:'as yet unclassified'!
|
|
21 |
|
|
22 |
apply: aPatch to: aSnapshot
|
|
23 |
| loader |
|
255
|
24 |
loader := self snapshot: aSnapshot.
|
67
|
25 |
aPatch applyTo: loader.
|
|
26 |
^ loader patchedSnapshot
|
|
27 |
!
|
|
28 |
|
|
29 |
snapshot: aSnapshot
|
|
30 |
^ self new initializeWithSnapshot: aSnapshot
|
|
31 |
! !
|
|
32 |
|
|
33 |
!MCPatcher methodsFor:'as yet unclassified'!
|
|
34 |
|
|
35 |
addDefinition: aDefinition
|
|
36 |
definitions add: aDefinition
|
|
37 |
!
|
|
38 |
|
|
39 |
initializeWithSnapshot: aSnapshot
|
255
|
40 |
definitions := MCDefinitionIndex definitions: aSnapshot definitions
|
67
|
41 |
!
|
|
42 |
|
|
43 |
modifyDefinition: baseDefinition to: targetDefinition
|
|
44 |
self addDefinition: targetDefinition
|
|
45 |
!
|
|
46 |
|
|
47 |
patchedSnapshot
|
|
48 |
^ MCSnapshot fromDefinitions: definitions definitions
|
|
49 |
!
|
|
50 |
|
|
51 |
removeDefinition: aDefinition
|
|
52 |
definitions remove: aDefinition
|
|
53 |
! !
|
|
54 |
|
|
55 |
!MCPatcher class methodsFor:'documentation'!
|
|
56 |
|
|
57 |
version
|
789
|
58 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCPatcher.st,v 1.5 2013-05-15 11:56:18 cg Exp $'
|
255
|
59 |
!
|
|
60 |
|
|
61 |
version_CVS
|
789
|
62 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCPatcher.st,v 1.5 2013-05-15 11:56:18 cg Exp $'
|
255
|
63 |
!
|
|
64 |
|
|
65 |
version_SVN
|
789
|
66 |
^ '$Id: MCPatcher.st,v 1.5 2013-05-15 11:56:18 cg Exp $'
|
67
|
67 |
! !
|
789
|
68 |
|