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