ChangesBrowser.st
changeset 2816 04c3e709fbd2
parent 2797 97dea7bc3db3
child 2834 0fd76c32e250
--- a/ChangesBrowser.st	Wed Oct 11 15:01:00 2000 +0200
+++ b/ChangesBrowser.st	Fri Oct 13 16:01:29 2000 +0200
@@ -1456,7 +1456,28 @@
                                         cls isNil ifTrue:[
                                             changeDelta := '+'.
                                         ] ifFalse:[
-                                            changeDelta := '?'.
+                                            cls definitionSelector = sel ifTrue:[
+                                                ((cls superclass isNil 
+                                                    and:[p receiver isConstant 
+                                                    and:[p receiver evaluate isNil]])
+                                                or:[
+                                                    cls superclass notNil 
+                                                    and:[p receiver isConstant not
+                                                    and:[cls superclass name = p receiver name]]
+                                                ]) ifTrue:[
+                                                    cls instanceVariableString asCollectionOfWords = (p args at:2) evaluate asCollectionOfWords ifTrue:[
+                                                        cls classVariableString asCollectionOfWords = (p args at:3) evaluate asCollectionOfWords ifTrue:[
+                                                            (p args at:4) evaluate isEmpty ifTrue:[
+                                                                cls category = (p args at:5) evaluate ifTrue:[
+                                                                    changeDelta := '='.
+                                                                ] ifFalse:[
+                                                                   changeType := '(class category change)'.
+                                                                ]
+                                                            ]
+                                                        ]
+                                                    ]
+                                                ]
+                                            ].
                                         ]
                                     ].
                                     sel := nil.
@@ -1468,6 +1489,26 @@
                                      ) includes:sel) ifTrue:[
                                         changeType := '(class definition)'.
                                         clsName := rec evaluate.
+                                    ] ifFalse:[
+                                        ((sel == #instanceVariableNames:) 
+                                        and:[rec isMessage
+                                        and:[rec selector == #class]]) ifTrue:[
+                                            clsName := rec receiver name.
+                                            changeClass := (Smalltalk classNamed:clsName).
+                                            changeType := '(class definition)'.
+                                            changeClassNames at:changeClassNames size put:clsName.
+
+                                            compareChanges ifTrue:[
+                                                changeClass isNil ifTrue:[
+                                                    changeDelta := '?'.
+                                                ] ifFalse:[
+                                                    s := (p args at:1) evaluate.
+                                                    s = changeClass class instanceVariableString ifTrue:[
+                                                        changeDelta := '='.
+                                                    ]
+                                                ]
+                                            ].
+                                        ]
                                     ]
                                 ].
 
@@ -2010,22 +2051,26 @@
                         thisClassSym := (parseTree arguments at:1) evaluate.
                         thisClass := Smalltalk at:thisClassSym ifAbsent:nil.
                         thisClass notNil ifTrue:[
-                            thisClass instanceVariableString = (parseTree arguments at:2) evaluate ifTrue:[
-                                thisClass classVariableString = (parseTree arguments at:3) evaluate ifTrue:[
-                                    ((thisClass sharedPools size == 0) and:[(parseTree arguments at:4) evaluate = '']) ifTrue:[
-                                        thisClass category = (parseTree arguments at:5) evaluate ifTrue:[
-                                            outcome := 'change has no effect\\(same definition)'.
+                            (isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[
+                                outcome := 'cannot compare this change\\(compare requires class to be loaded).'.
+                            ] ifTrue:[
+                                thisClass instanceVariableString asCollectionOfWords = (parseTree arguments at:2) evaluate asCollectionOfWords ifTrue:[
+                                    thisClass classVariableString asCollectionOfWords = (parseTree arguments at:3) evaluate asCollectionOfWords ifTrue:[
+                                        ((thisClass sharedPools size == 0) and:[(parseTree arguments at:4) evaluate = '']) ifTrue:[
+                                            thisClass category = (parseTree arguments at:5) evaluate ifTrue:[
+                                                outcome := 'change has no effect\\(same definition)'.
+                                            ] ifFalse:[
+                                                outcome := 'category is different'
+                                            ]
                                         ] ifFalse:[
-                                            outcome := 'category is different'
-                                        ]
+                                            outcome := 'sharedPool definition is different'
+                                        ].
                                     ] ifFalse:[
-                                        outcome := 'sharedPool definition is different'
-                                    ].
+                                        outcome := 'classVariable definition is different'
+                                    ]
                                 ] ifFalse:[
-                                    outcome := 'classVariable definition is different'
+                                    outcome := 'instanceVariable definition is different'
                                 ]
-                            ] ifFalse:[
-                                outcome := 'instanceVariable definition is different'
                             ]
                         ]
                     ]
@@ -3447,5 +3492,5 @@
 !ChangesBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.201 2000-09-26 12:48:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.202 2000-10-13 14:01:29 cg Exp $'
 ! !