Diff3Hunk.st
branchjv
changeset 12181 c6d6a0a83faa
child 12202 eaa1f6cb6ce8
equal deleted inserted replaced
12180:8ff612c17953 12181:c6d6a0a83faa
       
     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 
       
    41 Instance Variables
       
    42 	newChunk:	<DiffChunk> The new content chunk
       
    43 	oldChunk:	<DiffChunk> The old (ancestral) content chunk
       
    44 	side:		<Symbol> Either #left or #right
       
    45 '
       
    46 !
       
    47 
       
    48 !Diff3Hunk class methodsFor:'documentation'!
       
    49 
       
    50 copyright
       
    51 "
       
    52  Copyright (c) 2007-2012 Tony Garnock-Jones
       
    53 
       
    54  This code is based on Squeak's DiffMerge package
       
    55  written by Tony Garnock-Jones. Original project's web site:
       
    56 
       
    57  http://www.squeaksource.com/DiffMerge
       
    58 
       
    59  Permission is hereby granted, free of charge, to any person
       
    60  obtaining a copy of this software and associated documentation
       
    61  files (the 'Software'), to deal in the Software without
       
    62  restriction, including without limitation the rights to use,
       
    63  copy, modify, merge, publish, distribute, sublicense, and/or sell
       
    64  copies of the Software, and to permit persons to whom the
       
    65  Software is furnished to do so, subject to the following
       
    66  conditions:
       
    67 
       
    68  The above copyright notice and this permission notice shall be
       
    69  included in all copies or substantial portions of the Software.
       
    70 
       
    71  THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
       
    72  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
       
    73  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
       
    74  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
       
    75  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
       
    76  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
       
    77  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
       
    78  OTHER DEALINGS IN THE SOFTWARE.
       
    79 
       
    80 "
       
    81 !
       
    82 
       
    83 documentation
       
    84 "
       
    85 A Diff3Hunk represents a change from the ancestor to either the left or the right branch as part of a three-way merge.
       
    86 
       
    87 Instance Variables
       
    88         newChunk:       <DiffChunk> The new content chunk
       
    89         oldChunk:       <DiffChunk> The old (ancestral) content chunk
       
    90         side:           <Symbol> Either #left or #right
       
    91 
       
    92     [author:]
       
    93         Tony Garnock-Jones <tonyg@lshift.com>
       
    94 
       
    95     [instance variables:]
       
    96 
       
    97     [class variables:]
       
    98 
       
    99     [see also:]
       
   100 
       
   101 "
       
   102 ! !
       
   103 
       
   104 !Diff3Hunk class methodsFor:'as yet unclassified'!
       
   105 
       
   106 side: aSelector entry: anAssociation
       
   107 	^ self new side: aSelector; oldChunk: anAssociation key; newChunk: anAssociation value
       
   108 ! !
       
   109 
       
   110 !Diff3Hunk methodsFor:'accessing'!
       
   111 
       
   112 newChunk
       
   113 	^ newChunk
       
   114 !
       
   115 
       
   116 newChunk: anObject
       
   117 	newChunk := anObject
       
   118 !
       
   119 
       
   120 oldChunk
       
   121 	^ oldChunk
       
   122 !
       
   123 
       
   124 oldChunk: anObject
       
   125 	oldChunk := anObject
       
   126 !
       
   127 
       
   128 side
       
   129 	^ side
       
   130 !
       
   131 
       
   132 side: anObject
       
   133 	side := anObject
       
   134 ! !
       
   135 
       
   136 !Diff3Hunk methodsFor:'comparing'!
       
   137 
       
   138 <= otherHunk
       
   139 	^ (oldChunk < otherHunk oldChunk) or:
       
   140 		[(otherHunk oldChunk = oldChunk) and: [side = #left]]
       
   141 ! !
       
   142 
       
   143 !Diff3Hunk class methodsFor:'documentation'!
       
   144 
       
   145 version_SVN
       
   146     ^ '$Id: Diff3Hunk.st 7927 2012-03-16 19:30:50Z vranyj1 $'
       
   147 ! !