Diff3.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 16 Mar 2012 22:44:50 +0000
branchjv
changeset 12190 2a77dea2eceb
parent 12181 c6d6a0a83faa
child 12202 eaa1f6cb6ce8
permissions -rw-r--r--
Improvements in Diff3CodeiView2 - now it highlights differences
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12181
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
 Copyright (c) 2007-2012 Tony Garnock-Jones
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
 This code is based on Squeak's DiffMerge package
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
 written by Tony Garnock-Jones. Original project's web site:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
 http://www.squeaksource.com/DiffMerge
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
 Permission is hereby granted, free of charge, to any person
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
 obtaining a copy of this software and associated documentation
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
 files (the 'Software'), to deal in the Software without
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
 restriction, including without limitation the rights to use,
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
 copy, modify, merge, publish, distribute, sublicense, and/or sell
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
 copies of the Software, and to permit persons to whom the
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
 Software is furnished to do so, subject to the following
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
 conditions:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
 The above copyright notice and this permission notice shall be
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
 included in all copies or substantial portions of the Software.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
 OTHER DEALINGS IN THE SOFTWARE.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
"{ Package: 'stx:libtool' }"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
Object subclass:#Diff3
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
	instanceVariableNames:'file1 file0 file2 diffClass'
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
	classVariableNames:''
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
	poolDictionaries:''
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
	category:'Collections-Sequenceable-Diff3'
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
Object subclass:#Chunk
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
	instanceVariableNames:'offset length side'
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
	classVariableNames:''
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
	poolDictionaries:''
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
	privateIn:Diff3
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
Object subclass:#Conflict
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
	instanceVariableNames:'left original right'
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
	classVariableNames:''
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
	poolDictionaries:''
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
	privateIn:Diff3
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
Diff3 comment:'Diff3 provides a three-way-merge algorithm suitable for performing textual merges, such as are often required as part of source-code version control systems.

Instance Variables
	diffClass:	<Class> Should be a subclass of GenericDiff. Used to resolve changes.
	file0:		<SequenceableCollection> The ancestral file.
	file1:		<SequenceableCollection> The left branch.
	file2:		<SequenceableCollection> The right branch.

-- 
Copyright (c) 2008 Tony Garnock-Jones <tonyg@lshift.net>
Copyright (c) 2008 LShift Ltd. <query@lshift.net>

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.
'
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
!Diff3 class methodsFor:'documentation'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
copyright
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
 Copyright (c) 2007-2012 Tony Garnock-Jones
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
 This code is based on Squeak's DiffMerge package
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
 written by Tony Garnock-Jones. Original project's web site:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
 http://www.squeaksource.com/DiffMerge
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
 Permission is hereby granted, free of charge, to any person
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
 obtaining a copy of this software and associated documentation
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
 files (the 'Software'), to deal in the Software without
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
 restriction, including without limitation the rights to use,
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
 copy, modify, merge, publish, distribute, sublicense, and/or sell
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
 copies of the Software, and to permit persons to whom the
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
 Software is furnished to do so, subject to the following
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
 conditions:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
 The above copyright notice and this permission notice shall be
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
 included in all copies or substantial portions of the Software.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
 OTHER DEALINGS IN THE SOFTWARE.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
documentation
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
Diff3 provides a three-way-merge algorithm suitable for performing textual merges, such as are often required as part of source-code version control systems.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
Instance Variables
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
        diffClass:      <Class> Should be a subclass of GenericDiff. Used to resolve changes.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
        file0:          <SequenceableCollection> The ancestral file.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
        file1:          <SequenceableCollection> The left branch.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
        file2:          <SequenceableCollection> The right branch.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   101
    [author:]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   102
        Tony Garnock-Jones <tonyg@lshift.com>
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   104
    [instance variables:]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   106
    [class variables:]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
    [see also:]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   110
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
! !
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   113
!Diff3 methodsFor:'accessing'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   114
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   115
diffClass
12190
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   116
    ^ diffClass ? Diff2::HuntMcilroy
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   117
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   118
    "Modified (format): / 16-03-2012 / 20:27:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12181
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   119
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   120
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
diffClass: anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   122
	diffClass := anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   123
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   124
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
file0
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126
	^ file0
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   127
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   128
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   129
file0: anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   130
	file0 := anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   131
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   133
file1
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   134
	^ file1
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   135
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   136
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
file1: anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   138
	file1 := anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   139
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   141
file2
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   142
	^ file2
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   143
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   144
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   145
file2: anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   146
	file2 := anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   147
! !
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   148
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   149
!Diff3 methodsFor:'merging'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   150
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   151
merge
12190
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   152
    "Returns an Array of (#ok -> {...}) or (#conflict -> Diff3Conflict 
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   153
     of collections) instances representing the results of a three-way 
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   154
     merge between file1/file0/file2. Does not optimistically treat 
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   155
     'false conflicts' as clean merges (see the class comment for 
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   156
     Diff3InclusiveVisitor)."
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   157
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   158
    ^ self merge: false
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   159
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   160
    "Modified (comment): / 16-03-2012 / 20:26:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12181
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   161
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   162
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   163
mergeClean
12190
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   164
    "Returns an Array of (#ok -> {...}) or (#conflict -> Diff3Conflict of 
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   165
     collections) instances representing the results of a three-way merge 
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   166
     between file1/file0/file2. Optimistically treats 'false conflicts' 
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   167
     as clean merges (see the class comment for Diff3ExclusiveVisitor)."
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   168
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   169
    ^ self merge: true
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   170
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   171
    "Modified (format): / 16-03-2012 / 20:26:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12181
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   172
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   173
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   174
mergeIndices
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   175
        "Returns an Array of Diff3Chunks (representing clean merges) or Diff3Conflicts (containing DiffChunks, representing conflicts), together representing the results of a three-way merge between file1/file0/file2. Does not detect 'false conflicts', and can return two Diff3Chunks next to each other in the result."
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   176
        | result commonOffset hunks lastOverlapHunkIndex hunk firstHunkIndex |
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   177
        hunks := self computeHunks.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   178
        result := OrderedCollection new.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   179
        commonOffset := 1.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   180
        firstHunkIndex := 1.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   181
        [firstHunkIndex <= hunks size] whileTrue: [
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   182
                hunk := hunks at: firstHunkIndex.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   183
                self addCommonChunkTo: result between: commonOffset and: hunk oldChunk offset.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   184
                lastOverlapHunkIndex := self findOverlapStartingAt: firstHunkIndex in: hunks.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   185
                (firstHunkIndex = lastOverlapHunkIndex)
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   186
                        ifTrue: [
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   187
                                (hunk newChunk length > 0)
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   188
                                        ifTrue: [result add: (Diff3::Chunk side: hunk side chunk: hunk newChunk)].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   189
                                commonOffset := (hunks at: lastOverlapHunkIndex) oldChunk lastIndex + 1.]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   190
                        ifFalse: [ | conflict |
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   191
                                conflict := self computeConflictFrom: firstHunkIndex
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   192
                                                                to: lastOverlapHunkIndex
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   193
                                                                hunks: hunks.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   194
                                result add: conflict.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   195
                                commonOffset := conflict original lastIndex + 1.].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   196
                firstHunkIndex := lastOverlapHunkIndex + 1].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   197
        self addCommonChunkTo: result between: commonOffset and: file0 size + 1.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   198
        ^ result asArray
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   199
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   200
    "Modified: / 16-03-2012 / 19:24:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   201
! !
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   202
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   203
!Diff3 methodsFor:'private'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   204
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   205
addCommonChunkTo: result between: commonOffset and: targetOffset
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   206
        targetOffset > commonOffset ifTrue: [
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   207
                result add: (Diff3::Chunk new
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   208
                                                side: #original;
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   209
                                                offset: commonOffset;
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   210
                                                length: targetOffset - commonOffset)].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   211
        ^ targetOffset
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   212
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   213
    "Modified: / 16-03-2012 / 19:20:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   214
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   215
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   216
computeConflictFrom: i1 to: i2 hunks: hunks
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   217
        | hunk conflict l o r lo ro chunk chunkOrig |
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   218
        conflict := Diff3::Conflict new.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   219
        conflict left: (l := Diff2::Chunk negativeSize: file1 size).
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   220
        conflict original: (o := Diff2::Chunk negativeSize: file0 size).
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   221
        conflict right: (r := Diff2::Chunk negativeSize: file2 size).
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   222
        lo := o copy.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   223
        ro := o copy.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   224
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   225
        i1 to: i2 do: [:index |
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   226
                hunk := hunks at: index.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   227
                (hunk side = #left)
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   228
                        ifTrue: [chunk := l. chunkOrig := lo.]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   229
                        ifFalse: [chunk := r. chunkOrig := ro.].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   230
                o destructiveMergeWith: hunk oldChunk.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   231
                chunk destructiveMergeWith: hunk newChunk.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   232
                chunkOrig destructiveMergeWith: hunk oldChunk].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   233
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   234
        l correctForSkewFrom: lo to: o.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   235
        r correctForSkewFrom: ro to: o.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   236
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   237
        ^ conflict
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   238
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   239
    "Modified: / 16-03-2012 / 19:20:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   240
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   241
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   242
computeHunks
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   243
        | diff2 diff1 hunks |
12190
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   244
        diff1 := self diffClass new file1: file0; file2: file1; diffIndices.
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   245
        diff2 := self diffClass new file1: file0; file2: file2; diffIndices.
12181
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   246
        hunks := OrderedCollection new.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   247
        diff1 do: [ :entry | hunks add: (Diff3Hunk side: #left entry: entry) ].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   248
        diff2 do: [ :entry | hunks add: (Diff3Hunk side: #right entry: entry) ].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   249
        ^ hunks asSortedCollection:[:a :b|a <= b].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   250
12190
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   251
    "Modified: / 16-03-2012 / 20:29:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12181
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   252
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   253
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   254
fileMap
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   255
	| files |
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   256
	files := Dictionary new.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   257
	files at: #left put: file1.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   258
	files at: #original put: file0.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   259
	files at: #right put: file2.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   260
	^ files
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   261
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   262
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   263
findOverlapStartingAt: startIndex in: hunks
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   264
	| nextRegionLhs hunk |
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   265
	nextRegionLhs := (hunks at: startIndex) oldChunk lastIndex + 1.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   266
	startIndex + 1 to: hunks size do: [:index |
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   267
		hunk := hunks at: index.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   268
		hunk oldChunk offset > nextRegionLhs ifTrue: [^ index - 1].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   269
		nextRegionLhs := nextRegionLhs max: hunk oldChunk lastIndex + 1].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   270
	^ hunks size.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   271
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   272
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   273
merge: excludeFalseConflicts
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   274
	| visitor |
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   275
	visitor := excludeFalseConflicts
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   276
		ifTrue: [Diff3ExclusiveVisitor new]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   277
		ifFalse: [Diff3InclusiveVisitor new].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   278
	visitor files: self fileMap.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   279
	self mergeIndices do: [:each | each accept: visitor].
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   280
	^ visitor result
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   281
! !
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   282
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   283
!Diff3::Chunk class methodsFor:'as yet unclassified'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   284
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   285
negativeSize: s
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   286
	"Returns a pseudo-chunk with *negative* length, useful as a kind of zero for destructiveMergeWith: operations intended to build up coverage over some set of chunks."
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   287
	^ self new offset: s + 1; length: s negated
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   288
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   289
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   290
offset: o length: l
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   291
	^ self new offset: o; length: l
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   292
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   293
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   294
side: aSelector chunk: aChunk
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   295
	^ self new side: aSelector; offset: aChunk offset; length: aChunk length
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   296
! !
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   297
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   298
!Diff3::Chunk class methodsFor:'documentation'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   299
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   300
copyright
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   301
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   302
 Copyright (c) 2007-2012 Tony Garnock-Jones
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   303
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   304
 This code is based on Squeak's DiffMerge package
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   305
 written by Tony Garnock-Jones. Original project's web site:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   306
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   307
 http://www.squeaksource.com/DiffMerge
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   308
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   309
 Permission is hereby granted, free of charge, to any person
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   310
 obtaining a copy of this software and associated documentation
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   311
 files (the 'Software'), to deal in the Software without
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   312
 restriction, including without limitation the rights to use,
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   313
 copy, modify, merge, publish, distribute, sublicense, and/or sell
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   314
 copies of the Software, and to permit persons to whom the
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   315
 Software is furnished to do so, subject to the following
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   316
 conditions:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   317
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   318
 The above copyright notice and this permission notice shall be
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   319
 included in all copies or substantial portions of the Software.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   320
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   321
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   322
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   323
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   324
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   325
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   326
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   327
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   328
 OTHER DEALINGS IN THE SOFTWARE.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   329
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   330
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   331
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   332
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   333
documentation
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   334
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   335
A Diff3Chunk is a subclass of DiffChunk that also knows which side of a three-way merge it represents.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   336
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   337
Instance Variables
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   338
        side:           <Symbol> One of #left, #original or #right
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   339
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   340
    [author:]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   341
        Tony Garnock-Jones <tonyg@lshift.com>
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   342
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   343
    [instance variables:]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   344
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   345
    [class variables:]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   346
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   347
    [see also:]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   348
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   349
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   350
! !
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   351
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   352
!Diff3::Chunk methodsFor:'accessing'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   353
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   354
correctForSkewFrom: smallerChunk to: biggerChunk
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   355
	"Given a biggerChunk that definitely contains smallerChunk but might have an extra head or tail, updates the receiver to include such an extra head or tail."
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   356
	| headSize tailSize |
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   357
	headSize := smallerChunk offset - biggerChunk offset.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   358
	tailSize := biggerChunk lastIndex - smallerChunk lastIndex.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   359
	offset := offset - headSize.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   360
	length := length + headSize + tailSize.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   361
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   362
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   363
destructiveMergeWith: aChunk
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   364
	| newLastIndex |
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   365
	newLastIndex := self lastIndex max: aChunk lastIndex.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   366
	offset := offset min: aChunk offset.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   367
	length := newLastIndex - offset + 1.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   368
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   369
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   370
lastIndex
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   371
	"Returns the rightmost index contained in my range. (Offset is the leftmost index.) If my length is zero, will return an index lower than my offset."
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   372
	^ offset + length - 1
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   373
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   374
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   375
length
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   376
	^ length
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   377
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   378
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   379
length: anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   380
	length := anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   381
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   382
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   383
offset
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   384
	^ offset
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   385
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   386
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   387
offset: anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   388
	offset := anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   389
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   390
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   391
side
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   392
	^ side
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   393
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   394
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   395
side: anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   396
	side := anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   397
! !
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   398
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   399
!Diff3::Chunk methodsFor:'as yet unclassified'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   400
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   401
= otherChunk
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   402
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   403
        ^ (otherChunk isKindOf: self class) and:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   404
        [(self offset = otherChunk offset) and:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   405
        [(self length = otherChunk length)]]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   406
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   407
    "Modified: / 16-03-2012 / 19:25:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   408
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   409
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   410
accept: aVisitor
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   411
	^ aVisitor side: side chunk: self
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   412
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   413
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   414
extractFrom: aCollection
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   415
	"Extracts a subcollection from aCollection corresponding to my offset and length."
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   416
	^ aCollection copyFrom: offset to: offset + length - 1.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   417
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   418
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   419
printOn: aStream
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   420
	aStream nextPut: $(.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   421
	super printOn: aStream.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   422
	aStream
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   423
		nextPutAll: ' side: ';
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   424
		nextPutAll: side printString;
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   425
		nextPut: $).
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   426
! !
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   427
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   428
!Diff3::Chunk methodsFor:'comparing'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   429
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   430
< aDiffChunk
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   431
	"Used to sort changed chunks during three-way merge; see Diff3"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   432
	^ self offset < aDiffChunk offset
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   433
! !
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   434
12190
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   435
!Diff3::Chunk methodsFor:'testing'!
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   436
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   437
isChunk
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   438
    ^true
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   439
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   440
    "Created: / 16-03-2012 / 22:02:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   441
!
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   442
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   443
isConflict
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   444
    ^false
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   445
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   446
    "Created: / 16-03-2012 / 22:02:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   447
! !
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   448
12181
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   449
!Diff3::Conflict class methodsFor:'documentation'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   450
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   451
copyright
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   452
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   453
 Copyright (c) 2007-2012 Tony Garnock-Jones
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   454
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   455
 This code is based on Squeak's DiffMerge package
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   456
 written by Tony Garnock-Jones. Original project's web site:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   457
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   458
 http://www.squeaksource.com/DiffMerge
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   459
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   460
 Permission is hereby granted, free of charge, to any person
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   461
 obtaining a copy of this software and associated documentation
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   462
 files (the 'Software'), to deal in the Software without
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   463
 restriction, including without limitation the rights to use,
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   464
 copy, modify, merge, publish, distribute, sublicense, and/or sell
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   465
 copies of the Software, and to permit persons to whom the
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   466
 Software is furnished to do so, subject to the following
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   467
 conditions:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   468
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   469
 The above copyright notice and this permission notice shall be
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   470
 included in all copies or substantial portions of the Software.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   471
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   472
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   473
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   474
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   475
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   476
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   477
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   478
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   479
 OTHER DEALINGS IN THE SOFTWARE.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   480
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   481
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   482
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   483
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   484
documentation
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   485
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   486
A Diff3Conflict represents a merge conflict.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   487
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   488
Instance Variables
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   489
        left:           Either a SequenceableCollection or a Diff3Chunk representing the left variant.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   490
        original:       Either a SequenceableCollection or a Diff3Chunk representing the original variant.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   491
        right:          Either a SequenceableCollection or a Diff3Chunk representing the right variant.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   492
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   493
    [author:]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   494
        Tony Garnock-Jones <tonyg@lshift.com>
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   495
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   496
    [instance variables:]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   497
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   498
    [class variables:]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   499
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   500
    [see also:]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   501
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   502
"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   503
! !
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   504
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   505
!Diff3::Conflict methodsFor:'accessing'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   506
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   507
left
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   508
	^ left
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   509
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   510
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   511
left: anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   512
	left := anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   513
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   514
12190
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   515
length
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   516
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   517
    ^left length max: (original length max: right length)
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   518
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   519
    "Created: / 16-03-2012 / 22:02:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   520
!
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   521
12181
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   522
original
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   523
	^ original
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   524
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   525
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   526
original: anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   527
	original := anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   528
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   529
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   530
right
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   531
	^ right
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   532
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   533
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   534
right: anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   535
	right := anObject
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   536
! !
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   537
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   538
!Diff3::Conflict methodsFor:'as yet unclassified'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   539
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   540
= otherConflict
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   541
        ^ (otherConflict isKindOf: Diff3::Conflict) and:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   542
                [(left = otherConflict left) and:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   543
                [(original = otherConflict original) and:
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   544
                [(right = otherConflict right)]]]
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   545
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   546
    "Modified: / 16-03-2012 / 19:20:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   547
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   548
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   549
accept: aVisitor
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   550
	^ aVisitor left: left original: original right: right.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   551
!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   552
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   553
printOn: aStream
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   554
	aStream
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   555
		nextPut: $(;
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   556
		nextPutAll: self class name;
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   557
		nextPutAll: ' new left: '.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   558
	left printOn: aStream.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   559
	aStream nextPutAll: '; original: '.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   560
	original printOn: aStream.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   561
	aStream nextPutAll: '; right: '.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   562
	right printOn: aStream.
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   563
	aStream nextPut: $).
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   564
! !
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   565
12190
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   566
!Diff3::Conflict methodsFor:'testing'!
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   567
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   568
isChunk
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   569
    ^false
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   570
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   571
    "Created: / 16-03-2012 / 22:03:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   572
!
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   573
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   574
isConflict
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   575
    ^true
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   576
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   577
    "Created: / 16-03-2012 / 22:03:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   578
! !
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   579
12181
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   580
!Diff3 class methodsFor:'documentation'!
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   581
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   582
version_SVN
12190
2a77dea2eceb Improvements in Diff3CodeiView2 - now it highlights differences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12181
diff changeset
   583
    ^ '$Id: Diff3.st 7936 2012-03-16 22:44:50Z vranyj1 $'
12181
c6d6a0a83faa Integrated Diff2 and Diff3 written by Tony Garnock-Jones
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   584
! !