Change.st
changeset 1510 ce7253f6f687
parent 1385 495fc9f2c9da
child 1868 301a5aeb8176
--- a/Change.st	Tue Jul 25 11:24:48 2006 +0200
+++ b/Change.st	Tue Jul 25 11:26:16 2006 +0200
@@ -44,6 +44,28 @@
 "
 ! !
 
+!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 := source1Arg.
+    source2 := source2Arg.
+
+    source1 = source2 ifTrue:[^ true].
+
+    source1 := source1 withoutTrailingSeparators asCollectionOfLines.
+    source2 := source2 withoutTrailingSeparators asCollectionOfLines.
+    source1 size ~~ source2 size ifTrue:[^ false].
+    source1 := source1 collect:[:line | line withTabsExpanded withoutTrailingSeparators].
+    source2 := source2 collect:[:line | line withTabsExpanded withoutTrailingSeparators].
+    ^ source1 = source2
+
+    "Created: / 25-07-2006 / 11:22:21 / cg"
+! !
+
 !Change methodsFor:'accessing'!
 
 changeClass
@@ -164,16 +186,9 @@
 sameSourceAs:changeB
     "return true, if the given change has the same source as the receiver."
 
-    |sourceA sourceB|
-
-    (sourceA := self source) = (sourceB := changeB source) ifTrue:[^ true].
+    ^ self class isSource:(self source) sameSourceAs:(changeB source)
 
-    sourceA := sourceA withoutTrailingSeparators asCollectionOfLines.
-    sourceB := sourceB withoutTrailingSeparators asCollectionOfLines.
-    sourceA size ~~ sourceB size ifTrue:[^ false].
-    sourceA := sourceA collect:[:line | line withTabsExpanded withoutTrailingSeparators].
-    sourceB := sourceB collect:[:line | line withTabsExpanded withoutTrailingSeparators].
-    ^ sourceA = sourceB 
+    "Modified: / 25-07-2006 / 11:22:46 / cg"
 ! !
 
 !Change methodsFor:'printing & storing'!
@@ -288,5 +303,5 @@
 !Change class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/Change.st,v 1.41 2004-03-17 16:17:37 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/Change.st,v 1.42 2006-07-25 09:26:16 cg Exp $'
 ! !