13865
|
1 |
"
|
|
2 |
Copyright (c) 2007-2012 Tony Garnock-Jones
|
|
3 |
|
|
4 |
This code is based on Squeak's DiffMerge package
|
|
5 |
written by Tony Garnock-Jones. Original project's web site:
|
|
6 |
|
|
7 |
http://www.squeaksource.com/DiffMerge
|
|
8 |
|
|
9 |
Permission is hereby granted, free of charge, to any person
|
|
10 |
obtaining a copy of this software and associated documentation
|
|
11 |
files (the 'Software'), to deal in the Software without
|
|
12 |
restriction, including without limitation the rights to use,
|
|
13 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14 |
copies of the Software, and to permit persons to whom the
|
|
15 |
Software is furnished to do so, subject to the following
|
|
16 |
conditions:
|
|
17 |
|
|
18 |
The above copyright notice and this permission notice shall be
|
|
19 |
included in all copies or substantial portions of the Software.
|
|
20 |
|
|
21 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
22 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
23 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
24 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
26 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
27 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
28 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
29 |
"
|
|
30 |
"{ Package: 'stx:libtool' }"
|
|
31 |
|
16782
|
32 |
"{ NameSpace: Smalltalk }"
|
|
33 |
|
13865
|
34 |
Object subclass:#Diff3Hunk
|
|
35 |
instanceVariableNames:'side oldChunk newChunk'
|
|
36 |
classVariableNames:''
|
|
37 |
poolDictionaries:''
|
14008
|
38 |
category:'Collections-Sequenceable-Diff'
|
13865
|
39 |
!
|
|
40 |
|
|
41 |
Diff3Hunk comment:'A Diff3Hunk represents a change from the ancestor to either the left or the right branch as part of a three-way merge.
|
|
42 |
Instance Variables
|
|
43 |
newChunk: <DiffChunk> The new content chunk
|
|
44 |
oldChunk: <DiffChunk> The old (ancestral) content chunk
|
|
45 |
side: <Symbol> Either #left or #right
|
|
46 |
'
|
|
47 |
!
|
|
48 |
|
|
49 |
!Diff3Hunk class methodsFor:'documentation'!
|
|
50 |
|
|
51 |
copyright
|
|
52 |
"
|
|
53 |
Copyright (c) 2007-2012 Tony Garnock-Jones
|
|
54 |
|
|
55 |
This code is based on Squeak's DiffMerge package
|
|
56 |
written by Tony Garnock-Jones. Original project's web site:
|
|
57 |
|
|
58 |
http://www.squeaksource.com/DiffMerge
|
|
59 |
|
|
60 |
Permission is hereby granted, free of charge, to any person
|
|
61 |
obtaining a copy of this software and associated documentation
|
|
62 |
files (the 'Software'), to deal in the Software without
|
|
63 |
restriction, including without limitation the rights to use,
|
|
64 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
65 |
copies of the Software, and to permit persons to whom the
|
|
66 |
Software is furnished to do so, subject to the following
|
|
67 |
conditions:
|
|
68 |
|
|
69 |
The above copyright notice and this permission notice shall be
|
|
70 |
included in all copies or substantial portions of the Software.
|
|
71 |
|
|
72 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
73 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
74 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
75 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
76 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
77 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
78 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
79 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
80 |
|
|
81 |
"
|
|
82 |
!
|
|
83 |
|
|
84 |
documentation
|
|
85 |
"
|
14008
|
86 |
A Diff3Hunk represents a change from the ancestor to either the left or the right branch as part of a three-way merge.
|
13865
|
87 |
|
14008
|
88 |
Instance Variables
|
13865
|
89 |
newChunk: <DiffChunk> The new content chunk
|
|
90 |
oldChunk: <DiffChunk> The old (ancestral) content chunk
|
|
91 |
side: <Symbol> Either #left or #right
|
|
92 |
|
|
93 |
[author:]
|
|
94 |
Tony Garnock-Jones <tonyg@lshift.com>
|
|
95 |
|
|
96 |
[instance variables:]
|
|
97 |
|
|
98 |
[class variables:]
|
|
99 |
|
|
100 |
[see also:]
|
|
101 |
|
|
102 |
"
|
|
103 |
! !
|
|
104 |
|
|
105 |
!Diff3Hunk class methodsFor:'as yet unclassified'!
|
|
106 |
|
|
107 |
side: aSelector entry: anAssociation
|
|
108 |
^ self new side: aSelector; oldChunk: anAssociation key; newChunk: anAssociation value
|
|
109 |
! !
|
|
110 |
|
|
111 |
!Diff3Hunk methodsFor:'accessing'!
|
|
112 |
|
|
113 |
newChunk
|
|
114 |
^ newChunk
|
|
115 |
!
|
|
116 |
|
|
117 |
newChunk: anObject
|
|
118 |
newChunk := anObject
|
|
119 |
!
|
|
120 |
|
|
121 |
oldChunk
|
|
122 |
^ oldChunk
|
|
123 |
!
|
|
124 |
|
|
125 |
oldChunk: anObject
|
|
126 |
oldChunk := anObject
|
|
127 |
!
|
|
128 |
|
|
129 |
side
|
|
130 |
^ side
|
|
131 |
!
|
|
132 |
|
|
133 |
side: anObject
|
|
134 |
side := anObject
|
|
135 |
! !
|
|
136 |
|
|
137 |
!Diff3Hunk methodsFor:'comparing'!
|
|
138 |
|
|
139 |
<= otherHunk
|
|
140 |
^ (oldChunk < otherHunk oldChunk) or:
|
|
141 |
[(otherHunk oldChunk = oldChunk) and: [side = #left]]
|
|
142 |
! !
|
|
143 |
|
|
144 |
!Diff3Hunk methodsFor:'printing & storing'!
|
|
145 |
|
|
146 |
printOn:aStream
|
16782
|
147 |
"append a printed representation of the receiver to the argument, aStream"
|
13865
|
148 |
|
|
149 |
super printOn:aStream.
|
|
150 |
aStream nextPutAll:' side: '.
|
|
151 |
side printOn:aStream.
|
|
152 |
aStream nextPutAll:' old: '.
|
|
153 |
oldChunk printOn:aStream.
|
|
154 |
aStream nextPutAll:' new: '.
|
|
155 |
newChunk printOn:aStream.
|
|
156 |
|
|
157 |
"Modified: / 20-03-2012 / 17:56:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
158 |
! !
|
|
159 |
|
|
160 |
!Diff3Hunk class methodsFor:'documentation'!
|
|
161 |
|
|
162 |
version
|
16782
|
163 |
^ '$Header$'
|
13865
|
164 |
!
|
|
165 |
|
|
166 |
version_CVS
|
16782
|
167 |
^ '$Header$'
|
13865
|
168 |
! !
|
|
169 |
|