author | Jan Vrany <jan.vrany@labware.com> |
Tue, 11 Jul 2023 12:59:07 +0100 | |
branch | jv |
changeset 1174 | f0a16c301971 |
parent 1095 | 87f223484bc3 |
permissions | -rw-r--r-- |
1095
87f223484bc3
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
664
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
87f223484bc3
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
664
diff
changeset
|
2 |
|
65 | 3 |
"{ Package: 'stx:goodies/monticello' }" |
4 |
||
5 |
Object subclass:#MCPatch |
|
6 |
instanceVariableNames:'operations' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
664 | 9 |
category:'SCM-Monticello-Patching' |
65 | 10 |
! |
11 |
||
12 |
||
13 |
!MCPatch class methodsFor:'as yet unclassified'! |
|
14 |
||
15 |
fromBase: baseSnapshot target: targetSnapshot |
|
16 |
^ self new initializeWithBase: baseSnapshot target: targetSnapshot |
|
17 |
! |
|
18 |
||
19 |
operations: aCollection |
|
20 |
^ self basicNew initializeWithOperations: aCollection |
|
21 |
! ! |
|
22 |
||
23 |
!MCPatch methodsFor:'accessing'! |
|
24 |
||
25 |
operations |
|
26 |
^ operations |
|
27 |
! ! |
|
28 |
||
29 |
!MCPatch methodsFor:'applying'! |
|
30 |
||
31 |
applyTo: anObject |
|
32 |
operations do: [:ea | ea applyTo: anObject]. |
|
193 | 33 |
|
65 | 34 |
! ! |
35 |
||
36 |
!MCPatch methodsFor:'intializing'! |
|
37 |
||
38 |
initializeWithBase: baseSnapshot target: targetSnapshot |
|
193 | 39 |
| base target | |
40 |
operations := OrderedCollection new. |
|
41 |
base := MCDefinitionIndex definitions: baseSnapshot definitions. |
|
42 |
target := MCDefinitionIndex definitions: targetSnapshot definitions. |
|
43 |
||
44 |
target definitions do: |
|
45 |
[:t | |
|
46 |
base |
|
47 |
definitionLike: t |
|
48 |
ifPresent: [:b | (b isSameRevisionAs: t) ifFalse: [operations add: (MCModification of: b to: t)]] |
|
49 |
ifAbsent: [operations add: (MCAddition of: t)]] |
|
50 |
displayingProgress: 'Diffing...'. |
|
51 |
||
52 |
base definitions do: |
|
53 |
[:b | |
|
54 |
target |
|
55 |
definitionLike: b |
|
56 |
ifPresent: [:t] |
|
57 |
ifAbsent: [operations add: (MCRemoval of: b)]] |
|
65 | 58 |
! |
59 |
||
60 |
initializeWithOperations: aCollection |
|
193 | 61 |
operations := aCollection |
65 | 62 |
! ! |
63 |
||
64 |
!MCPatch methodsFor:'querying'! |
|
65 |
||
66 |
isEmpty |
|
67 |
^ operations isEmpty |
|
68 |
! ! |
|
69 |
||
70 |
!MCPatch class methodsFor:'documentation'! |
|
71 |
||
278 | 72 |
version |
664 | 73 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCPatch.st,v 1.5 2012-09-11 21:25:17 cg Exp $' |
278 | 74 |
! |
75 |
||
193 | 76 |
version_CVS |
664 | 77 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCPatch.st,v 1.5 2012-09-11 21:25:17 cg Exp $' |
155
c7a154a5ff3e
changed: #initializeWithBase:target:
Claus Gittinger <cg@exept.de>
parents:
65
diff
changeset
|
78 |
! |
c7a154a5ff3e
changed: #initializeWithBase:target:
Claus Gittinger <cg@exept.de>
parents:
65
diff
changeset
|
79 |
|
193 | 80 |
version_SVN |
1095
87f223484bc3
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
664
diff
changeset
|
81 |
^ '§Id: MCPatch.st 5 2010-08-29 07:30:29Z vranyj1 §' |
65 | 82 |
! ! |