VersionDiffBrowser.st
changeset 16615 392076bec163
parent 16551 646772e445b9
child 16617 69e7de1ef22f
child 16710 3db036345074
--- a/VersionDiffBrowser.st	Mon May 16 23:57:30 2016 +0200
+++ b/VersionDiffBrowser.st	Tue May 17 00:06:33 2016 +0200
@@ -2665,44 +2665,45 @@
     theClassChangeSet labelA:aLabelA.
     theClassChangeSet labelB:aLabelB.
 
-    aStream := '' writeStream.
-    Method flushSourceStreamCache.
-    classA fileOutOn:aStream withTimeStamp:false.
-    sourceA := aStream contents asString.
-
-    aStream := '' writeStream.
-    Method flushSourceStreamCache.
-    classB fileOutOn:aStream withTimeStamp:false.
-    sourceB := aStream contents asString.
-
-    theChangeSetA:=self changeSetForClass:classA andSource:sourceA.
-    theChangeSetB:=self changeSetForClass:classB andSource:sourceB.
-    theChangeSetA isNil
-        ifTrue: [theChangeSetA := ChangeSet new].
-    theChangeSetB isNil
-        ifTrue: [theChangeSetB := ChangeSet new].
+    theChangeSetA := ChangeSet forExistingClass:classA withExtensions:true withLooseMethods:true.
+    theChangeSetB := ChangeSet forExistingClass:classB withExtensions:true withLooseMethods:true.
+    
+"/    aStream := '' writeStream.
+"/    Method flushSourceStreamCache.
+"/    classA fileOutOn:aStream withTimeStamp:false.
+"/    sourceA := aStream contents asString.
+
+"/    aStream := '' writeStream.
+"/    Method flushSourceStreamCache.
+"/    classB fileOutOn:aStream withTimeStamp:false.
+"/    sourceB := aStream contents asString.
+
+"/    theChangeSetA:=self changeSetForClass:classA andSource:sourceA.
+"/    theChangeSetB:=self changeSetForClass:classB andSource:sourceB.
+"/    theChangeSetA isNil ifTrue: [theChangeSetA := ChangeSet new].
+"/    theChangeSetB isNil ifTrue: [theChangeSetB := ChangeSet new].
 
     "/ just in case (if comparing a class against another),
     "/ unify the classes of the changes (to avoid that all changes are detected as different)
 
-    theChangeSetB do:[:eachChange |
-        eachChange isMethodChange ifTrue:[
-            eachChange changeClass isMeta ifTrue:[
-                eachChange changeClass ~~ classA theMetaclass ifTrue:[
-                    eachChange changeClass:classA theMetaclass.
-                ]
-            ] ifFalse:[
-                eachChange changeClass ~~ classA theNonMetaclass ifTrue:[
-                    eachChange changeClass:classA theNonMetaclass.
-                ]
-            ].
-        ].
-    ].
+"/    theChangeSetB do:[:eachChange |
+"/        eachChange isMethodChange ifTrue:[
+"/            eachChange changeClass isMeta ifTrue:[
+"/                eachChange changeClass ~~ classA theMetaclass ifTrue:[
+"/                    eachChange changeClass:classA theMetaclass.
+"/                ]
+"/            ] ifFalse:[
+"/                eachChange changeClass ~~ classA theNonMetaclass ifTrue:[
+"/                    eachChange changeClass:classA theNonMetaclass.
+"/                ]
+"/            ].
+"/        ].
+"/    ].
     "/ remove all #initialize doIts
-    theChangeSetA := theChangeSetA select:[:eachChange | eachChange isDoIt not or:[eachChange isInitialize not]].
-    theChangeSetB := theChangeSetB select:[:eachChange | eachChange isDoIt not or:[eachChange isInitialize not]].
-
-    theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB).
+    theChangeSetA := theChangeSetA reject:[:eachChange | eachChange isDoIt and:[eachChange isInitialize]].
+    theChangeSetB := theChangeSetB reject:[:eachChange | eachChange isDoIt and:[eachChange isInitialize]].
+
+    theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB comparingDifferentClasses:true).
     ^ theClassChangeSet
 !