--- a/Change.st Fri Mar 22 11:11:55 2013 +0000
+++ b/Change.st Thu Mar 28 12:22:48 2013 +0000
@@ -46,18 +46,20 @@
"
! !
+
!Change class methodsFor:'others'!
version_CVS
- ^ '§Header: /cvs/stx/stx/libbasic3/Change.st,v 1.62 2012/10/30 14:25:24 cg Exp §'
+ ^ '$Header: /cvs/stx/stx/libbasic3/Change.st,v 1.63 2013-03-26 12:13:16 cg Exp $'
! !
+
!Change class methodsFor:'support'!
isSource:source1Arg sameSourceAs:source2Arg
"return true, if the given sources are the same, ignoring tabs and whitespace differences."
- |source1 source2|
+ |source1 source2 tSource1 tSource2|
source1 := source1Arg.
source2 := source2Arg.
@@ -68,14 +70,27 @@
source1 := source1 withoutTrailingSeparators asCollectionOfLines.
source2 := source2 withoutTrailingSeparators asCollectionOfLines.
+ [source1 last isEmptyOrNil] whileTrue:[ source1 removeLast ].
+ [source2 last isEmptyOrNil] whileTrue:[ source2 removeLast ].
+
source1 size ~~ source2 size ifTrue:[^ false].
- source1 := source1 collect:[:line | line withTabsExpanded withoutTrailingSeparators].
- source2 := source2 collect:[:line | line withTabsExpanded withoutTrailingSeparators].
- ^ source1 = source2
+ source1 = source2 ifTrue:[^ true].
+
+ tSource1 := source1 collect:[:line | (line withTabsExpanded:8) withoutTrailingSeparators].
+ tSource2 := source2 collect:[:line | (line withTabsExpanded:8) withoutTrailingSeparators].
+ tSource1 = tSource2 ifTrue:[^ true].
+
+"/ how about that one?
+"/ tSource1 := source1 collect:[:line | line withoutLeadingSeparators withoutTrailingSeparators].
+"/ tSource2 := source2 collect:[:line | line withoutLeadingSeparators withoutTrailingSeparators].
+"/ tSource1 = tSource2 ifTrue:[^ true].
+
+ ^ false.
"Created: / 25-07-2006 / 11:22:21 / cg"
! !
+
!Change methodsFor:'accessing'!
changeClass
@@ -232,6 +247,7 @@
timeOfChangeIfKnown := aTimestamp
! !
+
!Change methodsFor:'applying'!
apply
@@ -242,12 +258,14 @@
"Modified: / 13-10-2006 / 00:41:05 / cg"
! !
+
!Change methodsFor:'change notification'!
sendChangeNotificationThroughSmalltalk
"intentionally left blank"
! !
+
!Change methodsFor:'comparing'!
isForSameAs:changeB
@@ -273,6 +291,7 @@
"Modified: / 25-07-2006 / 11:22:46 / cg"
! !
+
!Change methodsFor:'converting'!
asAntiChange
@@ -284,6 +303,9 @@
JV: personal note: we should switch to deltastreams
(http://wiki.squeak.org/squeak/6001)
+
+ CG: is the above really true - what about a classDefChange for
+ an existing class????
"
"/self error: 'Could not create antichange'
@@ -293,6 +315,7 @@
"Modified: / 26-11-2009 / 16:10:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+
!Change methodsFor:'enumerating'!
do: aBlock
@@ -302,6 +325,7 @@
"Created: / 29-10-2010 / 14:02:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+
!Change methodsFor:'fileout'!
basicFileOutOn: aStream
@@ -318,6 +342,7 @@
self removed ifFalse:[self basicFileOutOn: aStream]
! !
+
!Change methodsFor:'printing & storing'!
printStringWithoutClassName
@@ -350,6 +375,7 @@
"Modified: / 17-08-2009 / 18:55:20 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !
+
!Change methodsFor:'testing'!
isClassCategoryChange
@@ -519,6 +545,7 @@
"Created: / 12-10-2006 / 22:59:04 / cg"
! !
+
!Change methodsFor:'visiting'!
acceptChangeVisitor:aVisitor
@@ -527,10 +554,11 @@
"Created: / 25-11-2011 / 17:12:05 / cg"
! !
+
!Change class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic3/Change.st,v 1.62 2012/10/30 14:25:24 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic3/Change.st,v 1.63 2013-03-26 12:13:16 cg Exp $'
!
version_HG
@@ -539,6 +567,6 @@
!
version_SVN
- ^ '§Id: Change.st 1981 2012-11-30 17:20:01Z vranyj1 §'
+ ^ '§Id: Change.st 1942 2012-07-27 14:53:23Z vranyj1 §'
! !