initial checkin
authorvrany
Wed, 06 Jul 2011 13:48:22 +0200
changeset 2409 8b67a184e661
parent 2408 c5c99ce9ab0d
child 2410 b09cc8e12790
initial checkin
ChangeSetDiffEntry.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ChangeSetDiffEntry.st	Wed Jul 06 13:48:22 2011 +0200
@@ -0,0 +1,323 @@
+"
+ Copyright (c) 2007-2010 Jan Vrany, SWING Research Group,
+                           Czech Technical University in Prague
+ Copyright (c) 2009-2010 eXept Software AG
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the 'Software'), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+"
+"{ Package: 'stx:libbasic3' }"
+
+ChangeSetDiffComponent subclass:#ChangeSetDiffEntry
+	instanceVariableNames:'versionBase versionA versionB versionMerged'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'System-Changes-Diff'
+!
+
+!ChangeSetDiffEntry class methodsFor:'documentation'!
+
+copyright
+"
+ Copyright (c) 2007-2010 Jan Vrany, SWING Research Group,
+                           Czech Technical University in Prague
+ Copyright (c) 2009-2010 eXept Software AG
+
+ 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.
+
+"
+! !
+
+!ChangeSetDiffEntry class methodsFor:'instance creation'!
+
+versionA:versionA 
+
+    ^self new
+        versionA: versionA;
+        versionB: versionA asAntiChange
+
+    "Modified: / 24-11-2009 / 12:30:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+versionA:versionA versionB:versionB 
+
+    ^self new
+        versionA: versionA;
+        versionB: versionB.
+!
+
+versionB:versionB 
+
+    ^self new
+        versionA: versionB asAntiChange;
+        versionB: versionB.
+
+    "Modified: / 24-11-2009 / 12:30:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetDiffEntry class methodsFor:'image specs'!
+
+iconMinus
+    "This resource specification was automatically generated
+     by the ImageEditor of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the ImageEditor may not be able to read the specification."
+
+    "
+     self iconMinus inspect
+     ImageEditor openOnClass:self andSelector:#iconMinus
+     Icon flushCachedIcons
+    "
+
+    <resource: #image>
+
+    ^Icon
+        constantNamed:'Tools::ChangeList class iconMinus'
+        ifAbsentPut:[(Depth8Image new) width: 12; height: 12; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8*;H2M+ 5[7K,\3L7-/F1[?''.Z*6/+3%.MK@2\&99L;\.-?P7[6=/^GV
++KGL2-ST@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[255 248 248 63 144 224 64 152 232 79 160 232 64 152 224 64 144 224 63 136 224 48 128 216 48 120 216 47 112 216 47 112 208 32 104 208 32 96 208 31 88 200 16 88 200 16 80 200 15 72 192 15 64 192 0 64 192 0 56 184 0 56 176 0 48 160 143 200 248 128 200 248 127 192 248 112 184 248 111 176 248 96 168 248 95 160 248 80 152 248 79 144 248 64 128 248 63 120 248 48 112 248 32 104 248 31 96 248 16 88 248 15 80 248 0 72 248 0 64 240 0 48 168 112 176 248 111 168 248 96 160 248 95 152 248 80 144 248 79 136 248 63 128 248 48 120 248 47 112 248 15 72 248 0 48 176 95 168 232 191 224 248 191 216 248 176 208 248 175 208 248 175 200 248 160 200 248 160 192 248 159 192 248 159 184 248 144 184 248 144 176 248 143 168 248 128 168 248 128 160 248 127 160 248 127 152 240 31 72 176 111 168 232 240 240 248 240 232 240 63 88 176 239 232 240 240 240 240 48 88 176 96 168 224 224 224 232 96 160 224 223 216 232 48 80 176 224 224 240 223 216 224 96 152 224 96 152 216 95 152 216 239 232 232 208 208 224 48 120 208 80 144 208 80 136 208 79 128 200 79 120 200 79 120 192 64 112 192 64 104 184 63 104 184 63 96 184 15 56 160 0 0 0 207 216 240 240 144 24 255 248 48 255 248 96 255 248 24 240 208 24 255 248 152 255 248 88 255 248 136 255 248 176 255 248 200 227 227 236 225 225 234 244 244 249 242 242 247 218 217 230 212 211 224 234 234 242 253 253 254 251 251 252 227 226 235 226 226 237 243 243 247 220 220 231 240 239 244 237 237 244 233 233 240 52 89 178 231 231 238 50 87 176 229 229 239 248 248 251 246 246 249 223 223 233 222 221 232 238 238 244 56 94 181 55 92 180 53 90 178 233 232 239 51 88 176 232 232 241 251 251 253 249 249 251 228 228 237 225 224 234 241 241 246 238 237 243 56 93 180 254 254 255 229 229 237 227 227 238 246 246 250 244 244 248 219 219 230 236 236 243 255 255 255 51 88 177 231 230 238 249 249 252 247 247 250 241 241 247 239 239 245 236 235 242 54 91 179 231 231 240 176 175 128 176 240 159 143 159 128 127 208 96 175 239 144 15 79 0 160 176 95 0 160 0 64 176 48 112 159 95 0 96 0 144 159 143 96 207 80 127 159 111 63 175 48 96 207 79 80 176 64 31 159 31 143 224 112 64 176 63 95 207 79 63 160 47 0 127 0 80 191 64 176 240 144 143 239 112 15 160 15 16 95 16 0 80 0 143 224 111 191 240 159 175 240 144 15 127 15 0 175 0 144 239 127 0 79 0 0 112 0 0 95 0 15 112 15 111 207 80 16 79 16 15 79 15 16 80 16 128 223 111 159 159 63 15 64 15 31 144 16 16 80 15 128 224 111 176 239 159 95 112 80 15 175 15 144 224 127 95 192 79 31 95 15 32 160 31 48 159 47 32 159 31 15 128 15 95 160 47 0 111 0 127 223 96 15 80 0 64 112 63 159 239 127]; mask:((ImageMask new) width: 12; height: 12; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@,@@@@E@@G?<O?0??C?<@@F@@D@@@@@') ; yourself); yourself]
+!
+
+iconPlus
+    "This resource specification was automatically generated
+     by the ImageEditor of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the ImageEditor may not be able to read the specification."
+
+    "
+     self iconPlus inspect
+     ImageEditor openOnClass:self andSelector:#addOverlayIcon3
+     Icon flushCachedIcons
+    "
+
+    <resource: #image>
+
+    ^Icon
+        constantNamed:'XPToolbarIconLibrary class addOverlayIcon3'
+        ifAbsentPut:[(Depth8Image new) width: 12; height: 12; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
+@@@@@K_ 5^ @@@@@@@@@@LGI*,\@@@@@@@@@@M*+5<\@@@@@@@@@@N&(.[4@@@@@8*;H2M+X1K7K,\3L7-/F1[?''.Z*6/+3%.MK@2\&99L;\.-?P7[6=/^F*
+,;GL2-ST@@@@@L6;/,H@@@@@@@@@@NN>+=D@@@@@@@@@@LN57<<@@@@@@@@@@N[V+M$@@@@@') ; colorMapFromArray:#[255 248 248 63 144 224 64 152 232 79 160 232 64 152 224 64 144 224 63 136 224 48 128 216 48 120 216 47 112 216 47 112 208 32 104 208 32 96 208 31 88 200 16 88 200 16 80 200 15 72 192 15 64 192 0 64 192 0 56 184 0 56 176 0 48 160 143 200 248 128 200 248 127 192 248 112 184 248 111 176 248 96 168 248 95 160 248 80 152 248 79 144 248 64 128 248 63 120 248 48 112 248 32 104 248 31 96 248 16 88 248 15 80 248 0 72 248 0 64 240 0 48 168 112 176 248 111 168 248 96 160 248 95 152 248 80 144 248 79 136 248 63 128 248 48 120 248 47 112 248 15 72 248 0 48 176 95 168 232 191 224 248 191 216 248 176 208 248 175 208 248 175 200 248 160 200 248 160 192 248 159 192 248 159 184 248 144 184 248 144 176 248 143 168 248 128 168 248 128 160 248 127 160 248 127 152 240 31 72 176 111 168 232 240 240 248 240 232 240 63 88 176 239 232 240 240 240 240 48 88 176 96 168 224 224 224 232 96 160 224 223 216 232 48 80 176 224 224 240 223 216 224 96 152 224 96 152 216 95 152 216 239 232 232 208 208 224 48 120 208 80 144 208 80 136 208 79 128 200 79 120 200 79 120 192 64 112 192 64 104 184 63 104 184 63 96 184 15 56 160 0 0 0 207 216 240 240 144 24 255 248 48 255 248 96 255 248 24 240 208 24 255 248 152 255 248 88 255 248 136 255 248 176 255 248 200 227 227 236 225 225 234 244 244 249 242 242 247 218 217 230 212 211 224 234 234 242 253 253 254 251 251 252 227 226 235 226 226 237 243 243 247 220 220 231 240 239 244 237 237 244 233 233 240 52 89 178 231 231 238 50 87 176 229 229 239 248 248 251 246 246 249 223 223 233 222 221 232 238 238 244 56 94 181 55 92 180 53 90 178 233 232 239 51 88 176 232 232 241 251 251 253 249 249 251 228 228 237 225 224 234 241 241 246 238 237 243 56 93 180 254 254 255 229 229 237 227 227 238 246 246 250 244 244 248 219 219 230 236 236 243 255 255 255 51 88 177 231 230 238 249 249 252 247 247 250 241 241 247 239 239 245 236 235 242 54 91 179 231 231 240 176 175 128 176 240 159 143 159 128 127 208 96 175 239 144 15 79 0 160 176 95 0 160 0 64 176 48 112 159 95 0 96 0 144 159 143 96 207 80 127 159 111 63 175 48 96 207 79 80 176 64 31 159 31 143 224 112 64 176 63 95 207 79 63 160 47 0 127 0 80 191 64 176 240 144 143 239 112 15 160 15 16 95 16 0 80 0 143 224 111 191 240 159 175 240 144 15 127 15 0 175 0 144 239 127 0 79 0 0 112 0 0 95 0 15 112 15 111 207 80 16 79 16 15 79 15 16 80 16 128 223 111 159 159 63 15 64 15 31 144 16 16 80 15 128 224 111 176 239 159 95 112 80 15 175 15 144 224 127 95 192 79 31 95 15 32 160 31 48 159 47 32 159 31 15 128 15 95 160 47 0 111 0 127 223 96 15 80 0 64 112 63 159 239 127 95 159 79 16 175 16]; mask:((ImageMask new) width: 12; height: 12; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C0,O@@<EC0G?<O?0??C?<@<FC0DO@@<@') ; yourself); yourself]
+! !
+
+!ChangeSetDiffEntry methodsFor:'accessing'!
+
+className
+
+    ^(versionA ? versionB) className
+
+    "Created: / 01-11-2009 / 16:48:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+merged
+    ^ versionMerged notNil
+
+    "Modified: / 24-11-2009 / 12:55:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+mergedUsingVersionA
+
+    versionMerged ifNil:[^false].
+    versionA ifNil:[^false].
+
+    ^versionA sameAs: versionMerged
+
+    "Created: / 24-11-2009 / 08:16:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+mergedUsingVersionB
+
+    versionMerged ifNil:[^false].
+    versionB ifNil:[^false].
+
+    ^versionB sameAs: versionMerged
+
+    "Created: / 24-11-2009 / 08:16:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+mergedUsingVersionBase
+
+    versionMerged ifNil:[^false].
+    versionBase ifNil:[^false].
+
+    ^versionBase sameAs: versionMerged
+
+    "Created: / 24-11-2009 / 08:16:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+name
+
+    ^self versionAorB displayString
+
+    "Created: / 24-11-2009 / 09:56:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+nonMetaClassName
+
+    ^(versionA ? versionB) nonMetaClassName
+
+    "Created: / 21-11-2009 / 07:42:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+versionA
+    ^ versionA
+!
+
+versionA:something
+    versionA := something.
+!
+
+versionALabel
+    ^ parent versionALabel
+
+    "Created: / 09-11-2009 / 12:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+versionAText
+    ^ versionA source
+
+    "Created: / 06-07-2011 / 12:29:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+versionAorB
+
+    ^versionA isClassRemoveChangeOrMethodRemoveChange
+        ifFalse:[versionA]
+        ifTrue:[versionB]
+
+    "Created: / 02-11-2009 / 18:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+versionB
+    ^ versionB
+!
+
+versionB:something
+    versionB := something.
+!
+
+versionBLabel
+    ^ parent versionBLabel
+
+    "Created: / 09-11-2009 / 12:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+versionBText
+    ^ versionB source
+
+    "Created: / 06-07-2011 / 12:29:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+versionBase
+    ^ versionBase
+!
+
+versionBase:something
+    versionBase := something.
+!
+
+versionBaseLabel
+    ^ parent versionBaseLabel
+
+    "Created: / 23-11-2009 / 22:55:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+versionMerged
+    ^ versionMerged
+!
+
+versionMerged:aChange
+    versionMerged := aChange.
+    self changed:#resolution with: aChange
+
+    "Modified: / 24-11-2009 / 12:58:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+versionMergedLabel
+
+    (versionMerged isNil)
+        ifTrue:[^'<unresolved>' asText colorizeAllWith: Color red].
+    (versionMerged sameAs: versionA)
+        ifTrue:[^self versionALabel].
+    (versionMerged sameAs: versionB)
+        ifTrue:[^self versionBLabel].
+    (versionMerged sameAs: versionBase)
+        ifTrue:[^self versionBaseLabel].
+    ^'manual merge'
+! !
+
+!ChangeSetDiffEntry methodsFor:'enumerating'!
+
+do: aBlock
+
+    aBlock value: self
+
+    "Created: / 25-11-2009 / 10:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetDiffEntry methodsFor:'merging'!
+
+automerge
+
+    "Try to automatically merge differences. The merge is based
+     on versionBase. If any of versions is same as versionBase, 
+     the other is used as merge result"
+
+    versionBase ifNil:[^self].
+
+    (versionA sameAs: versionBase) ifTrue:[versionMerged := versionB copy].
+    (versionB sameAs: versionBase) ifTrue:[versionMerged := versionA copy].
+
+    "Created: / 02-11-2009 / 18:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 25-11-2009 / 08:21:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetDiffEntry methodsFor:'testing'!
+
+isDiffItem
+    ^ true
+! !
+
+!ChangeSetDiffEntry class methodsFor:'documentation'!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSetDiffEntry.st,v 1.1 2011-07-06 11:48:22 vrany Exp $'
+! !