initial checkin
authorClaus Gittinger <cg@exept.de>
Wed, 05 Feb 2014 20:08:23 +0100
changeset 13865 f9662607a6e4
parent 13864 ec523973e8b9
child 13866 7b45431bb24e
initial checkin
Diff3Hunk.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Diff3Hunk.st	Wed Feb 05 20:08:23 2014 +0100
@@ -0,0 +1,167 @@
+"
+ Copyright (c) 2007-2012 Tony Garnock-Jones
+
+ This code is based on Squeak's DiffMerge package
+ written by Tony Garnock-Jones. Original project's web site:
+
+ http://www.squeaksource.com/DiffMerge
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the 'Software'), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+"
+"{ Package: 'stx:libtool' }"
+
+Object subclass:#Diff3Hunk
+	instanceVariableNames:'side oldChunk newChunk'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Collections-Sequenceable-Diff3'
+!
+
+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.
+Instance Variables
+	newChunk:	<DiffChunk> The new content chunk
+	oldChunk:	<DiffChunk> The old (ancestral) content chunk
+	side:		<Symbol> Either #left or #right
+'
+!
+
+!Diff3Hunk class methodsFor:'documentation'!
+
+copyright
+"
+ Copyright (c) 2007-2012 Tony Garnock-Jones
+
+ This code is based on Squeak's DiffMerge package
+ written by Tony Garnock-Jones. Original project's web site:
+
+ http://www.squeaksource.com/DiffMerge
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the 'Software'), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+"
+!
+
+documentation
+"
+A Diff3Hunk represents a change from the ancestor to either the left or the right branch as part of a three-way merge.
+
+Instance Variables
+        newChunk:       <DiffChunk> The new content chunk
+        oldChunk:       <DiffChunk> The old (ancestral) content chunk
+        side:           <Symbol> Either #left or #right
+
+    [author:]
+        Tony Garnock-Jones <tonyg@lshift.com>
+
+    [instance variables:]
+
+    [class variables:]
+
+    [see also:]
+
+"
+! !
+
+!Diff3Hunk class methodsFor:'as yet unclassified'!
+
+side: aSelector entry: anAssociation
+	^ self new side: aSelector; oldChunk: anAssociation key; newChunk: anAssociation value
+! !
+
+!Diff3Hunk methodsFor:'accessing'!
+
+newChunk
+	^ newChunk
+!
+
+newChunk: anObject
+	newChunk := anObject
+!
+
+oldChunk
+	^ oldChunk
+!
+
+oldChunk: anObject
+	oldChunk := anObject
+!
+
+side
+	^ side
+!
+
+side: anObject
+	side := anObject
+! !
+
+!Diff3Hunk methodsFor:'comparing'!
+
+<= otherHunk
+	^ (oldChunk < otherHunk oldChunk) or:
+		[(otherHunk oldChunk = oldChunk) and: [side = #left]]
+! !
+
+!Diff3Hunk methodsFor:'printing & storing'!
+
+printOn:aStream
+    "append a printed representation if the receiver to the argument, aStream"
+
+    super printOn:aStream.
+    aStream nextPutAll:' side: '.
+    side printOn:aStream.
+    aStream nextPutAll:' old: '.
+    oldChunk printOn:aStream.
+    aStream nextPutAll:' new: '.
+    newChunk printOn:aStream.
+
+    "Modified: / 20-03-2012 / 17:56:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Diff3Hunk class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/libtool/Diff3Hunk.st,v 1.1 2014-02-05 19:08:23 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libtool/Diff3Hunk.st,v 1.1 2014-02-05 19:08:23 cg Exp $'
+! !
+