*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Mon, 27 Jan 2003 13:07:53 +0100
changeset 4489 0deb97a82d68
parent 4488 17394d51eabc
child 4490 de7216d4a28a
*** empty log message ***
ChangesBrowser.st
DiffTextView.st
--- a/ChangesBrowser.st	Mon Jan 27 11:52:40 2003 +0100
+++ b/ChangesBrowser.st	Mon Jan 27 13:07:53 2003 +0100
@@ -13,19 +13,19 @@
 "{ Package: 'stx:libtool' }"
 
 StandardSystemView subclass:#ChangesBrowser
-        instanceVariableNames:'changeListView codeView diffView changeFileName changeChunks
-                changePositions changeClassNames changeSelectors
-                changeHeaderLines changeIsFollowupMethodChange anyChanges
-                changeNrShown changeNrProcessed skipSignal autoCompare
-                changeFileSize changeFileTimestamp checkBlock changeTimeStamps
-                tabSpec autoUpdate editingClassSource lastSearchType
-                lastSearchString applyInOriginalNameSpace lastSaveFileName
-                readOnly enforcedPackage enforcedNameSpace updateChangeSet
-                showingDiffs diffViewBox'
-        classVariableNames:'CompressSnapshotInfo NoColoring ShowWarningDialogs DefaultIcon
-                DefaultAutoCompare DefaultShowingDiffs'
-        poolDictionaries:''
-        category:'Interface-Browsers'
+	instanceVariableNames:'changeListView codeView diffView changeFileName changeChunks
+		changePositions changeClassNames changeSelectors
+		changeHeaderLines changeIsFollowupMethodChange anyChanges
+		changeNrShown changeNrProcessed skipSignal autoCompare
+		changeFileSize changeFileTimestamp checkBlock changeTimeStamps
+		tabSpec autoUpdate editingClassSource lastSearchType
+		lastSearchString applyInOriginalNameSpace lastSaveFileName
+		readOnly enforcedPackage enforcedNameSpace updateChangeSet
+		showingDiffs diffViewBox'
+	classVariableNames:'CompressSnapshotInfo NoColoring ShowWarningDialogs DefaultIcon
+		DefaultAutoCompare DefaultShowingDiffs'
+	poolDictionaries:''
+	category:'Interface-Browsers'
 !
 
 !ChangesBrowser class methodsFor:'documentation'!
@@ -3783,7 +3783,7 @@
 
 updateDiffViewFor:changeNr
     |aStream chunk sawExcla parseTree thisClass cat oldSource newSource
-     parser sel outcome showDiff selector isLoaded
+     parser sel outcome showDiff selector 
      method superClass thisClassSym varsHere varsInChange
      ownerClass oldMethod|
 
@@ -3801,6 +3801,8 @@
     ].
 
     sawExcla ifFalse:[
+        newSource := chunk.
+
         Class nameSpaceQuerySignal answer:(self nameSpaceForApply)
         do:[
             parseTree := Parser parseExpression:chunk.
@@ -3811,17 +3813,16 @@
             selector == #'removeSelector:' ifTrue:[
                 thisClass := (parseTree receiver evaluate).
                 thisClass isBehavior ifTrue:[
-                    (self checkClassIsLoaded:thisClass) ifTrue:[
+                    thisClass isLoaded ifTrue:[
                         selector := (parseTree arg1 evaluate).
                         (thisClass includesSelector:selector) ifTrue:[
                             oldSource := (thisClass compiledMethodAt:selector) source.
-                            newSource := nil.
                         ]
                     ] ifFalse:[
-                        oldSource := newSource := 'Cannot compare this change (compare requires class to be loaded).'.
+                        oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs.
                     ]
                 ] ifFalse:[
-                    oldSource := newSource := 'Cannot compare this change (class not present)'.
+                    oldSource := 'Cannot compare this change (class not present)'.
                 ].
             ].
 
@@ -3830,11 +3831,10 @@
                     parseTree receiver selector == #compiledMethodAt: ifTrue:[
                         (method := parseTree receiver evaluate) isMethod ifTrue:[
                             method category = parseTree arg1 evaluate ifFalse:[
-                                oldSource := chunk.
-                                newSource := '(' , method class name , ' compiledMethodAt: ' , method selector storeString , ') category: ' , method category storeString.
+                                oldSource := '(' , method class name , ' compiledMethodAt: ' , method selector storeString , ') category: ' , method category storeString.
                             ]
                         ] ifFalse:[
-                            oldSource := newSource := 'There is no such method'.
+                            oldSource := 'There is no such method'.
                         ]
                     ]
                 ]
@@ -3843,18 +3843,17 @@
             selector == #'comment:' ifTrue:[
                 thisClass := (parseTree receiver evaluate).
                 thisClass isBehavior ifTrue:[
-                    (self checkClassIsLoaded:thisClass) ifTrue:[
+                    thisClass isLoaded ifTrue:[
                         (thisClass comment = parseTree arg1 evaluate) ifTrue:[
-                            outcome := 'Change has no effect\\(same comment)'.
+                            outcome := 'Change has no effect\\(same comment)' withCRs.
                         ] ifFalse:[
-                            oldSource := chunk.
-                            newSource := thisClass name , ' comment: ' , thisClass comment storeString.
+                            oldSource := thisClass name , ' comment: ' , thisClass comment storeString.
                         ]
                     ] ifFalse:[
-                        oldSource := newSource := 'Cannot compare this change (compare requires class to be loaded).'.
+                        oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs.
                     ]
                 ] ifFalse:[
-                    oldSource := newSource := 'Cannot compare this change (class not present)'.
+                    oldSource := 'Cannot compare this change (class not present)'.
                 ].
             ].
 
@@ -3863,20 +3862,15 @@
                     parseTree receiver selector == #class ifTrue:[
                         thisClass := (parseTree receiver evaluate).
                         thisClass isBehavior ifTrue:[
-                            (self checkClassIsLoaded:thisClass) ifTrue:[
-                                varsHere := thisClass instanceVariableString asCollectionOfWords.
-                                varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords.
-                                varsHere = varsInChange ifTrue:[
-                                    oldSource := newSource := 'Change has no effect\\(same definition)'.
-                                ] ifFalse:[
-                                    oldSource := chunk.
-                                    newSource := thisClass definitionString.
-                                ].
+                            thisClass isLoaded ifTrue:[
+"/                                varsHere := thisClass instanceVariableString asCollectionOfWords.
+"/                                varsInChange := (parseTree arguments at:1) evaluate asCollectionOfWords.
+                                oldSource := thisClass definition.
                             ] ifFalse:[
-                                oldSource := newSource := 'Cannot compare this change (compare requires class to be loaded).'.
+                                oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs.
                             ].
                         ] ifFalse:[
-                            oldSource := newSource := 'Cannot compare this change (class not present)'.
+                            oldSource := 'Cannot compare this change (class not present)'.
                         ]
                     ].
                 ]
@@ -3887,25 +3881,34 @@
             ifTrue:[
                 superClass := (parseTree receiver evaluate).
                 superClass isBehavior ifFalse:[
-                    oldSource := newSource := 'Cannot compare this change\\(superclass not loaded).'.
+                    oldSource := 'Cannot compare this change\\(no such superclass).' withCRs.
                 ] ifTrue:[
-                    (self checkClassIsLoaded:superClass) ifTrue:[
+                    superClass isLoaded ifFalse:[
+                        oldSource := 'Cannot compare this change\\(superclass not loaded).' withCRs.
+                    ] ifTrue:[
+                        oldSource := ''.
                         thisClassSym := (parseTree arguments at:1) evaluate.
 
                         (selector endsWith:':privateIn:') ifTrue:[
-                            ownerClass := (parseTree arguments at:5) evaluate.
-                            thisClass := ownerClass privateClassesAt:thisClassSym.
+                            ownerClass := (parseTree arguments at:5).
+                            ownerClass isUndeclared ifFalse:[
+                                ownerClass := ownerClass evaluate.
+                            ] ifTrue:[
+                                ownerClass := nil.
+                            ].
+                            ownerClass isNil ifTrue:[
+                                oldSource := 'Cannot compare this change\\(owning class is not loaded).' withCRs.
+                            ] ifFalse:[
+                                thisClass := ownerClass privateClassesAt:thisClassSym.
+                            ]
                         ] ifFalse:[
                             thisClass := (self nameSpaceForApply) at:thisClassSym ifAbsent:nil.
                         ].
-                        thisClass isNil ifTrue:[
-                            oldSource := newSource := 'Change defines the class: ' , thisClassSym allBold.
-                        ] ifFalse:[
-                            (isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[
-                                oldSource := newSource := 'Cannot compare this change\\(compare requires class to be loaded).'.
+                        thisClass notNil ifTrue:[
+                            thisClass isLoaded ifFalse:[
+                                oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs.
                             ] ifTrue:[
-                                oldSource := chunk.
-                                newSource := thisClass definitionString.
+                                oldSource := thisClass definitionString.
                             ]
                         ]
                     ]
@@ -3933,10 +3936,12 @@
                #methods                       "/ STV support
               ) 
             includes:parseTree selector) ifTrue:[
+                newSource := aStream nextChunk.
+
                 thisClass := (parseTree receiver evaluate).
                 thisClass isBehavior ifTrue:[
-                    (isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[
-                        oldSource := newSource := 'Cannot compare this change\\(compare requires class to be loaded).'.
+                    thisClass isLoaded ifFalse:[
+                        oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs.
                     ] ifTrue:[
                         parseTree selector == #methodsFor ifTrue:[
                             cat := 'Dolphin methods'.
@@ -3947,8 +3952,6 @@
                                 cat := parseTree arg1 evaluate.
                             ].
                         ].
-                        newSource := aStream nextChunk.
-
                         Class nameSpaceQuerySignal answer:(self nameSpaceForApply)
                         do:[
                             parser := Parser parseMethod:newSource in:thisClass.
@@ -3963,7 +3966,7 @@
                                 oldSource := oldMethod source.
                                 (oldSource = newSource) ifFalse:[
                                     oldSource isNil ifTrue:[
-                                        oldSource := newSource := 'No source for compare.'.
+                                        oldSource := 'No source for compare.'.
                                     ] ifFalse:[
                                         "/
                                         "/ compare for tabulator <-> space changes
@@ -3977,9 +3980,9 @@
                                             "/
                                             (HistoryManager notNil 
                                             and:[HistoryManager isActive]) ifTrue:[
-                                                (HistoryManager withoutHistoryLines:newSource)
+                                                (HistoryManager withoutHistoryLines:oldSource)
                                                 =
-                                                (HistoryManager withoutHistoryLines:oldSource)
+                                                (HistoryManager withoutHistoryLines:newSource)
                                                 ifTrue:[
                                                     oldSource := (HistoryManager withoutHistoryLines:oldSource).
                                                     newSource := (HistoryManager withoutHistoryLines:newSource).
@@ -3989,22 +3992,20 @@
                                     ]
                                 ]
                             ] ifFalse:[
-                                isLoaded ifTrue:[
-                                    oldSource := newSource := 'Method does not exist.'.
-                                ]
+                                oldSource := 'Method does not exist.'.
                             ]
                         ] ifFalse:[
-                            oldSource := newSource := 'Change is unparsable (parse error).'.
+                            oldSource := 'Change is unparsable (parse error).'.
                         ].
                     ].
                 ] ifFalse:[
-                    oldSource := newSource := 'Class does not exist.'.
+                    oldSource := 'Class does not exist.'.
                 ]
             ] ifFalse:[
-                oldSource := newSource := 'Not comparable.'.
+                oldSource := 'Not comparable.'.
             ]
         ] ifFalse:[
-            oldSource := newSource := 'Not comparable.'.
+            oldSource := 'Not comparable.'.
         ]
     ].
     aStream close.
@@ -5461,5 +5462,5 @@
 !ChangesBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.285 2003-01-27 10:52:40 penk Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.286 2003-01-27 12:07:38 cg Exp $'
 ! !
--- a/DiffTextView.st	Mon Jan 27 11:52:40 2003 +0100
+++ b/DiffTextView.st	Mon Jan 27 13:07:53 2003 +0100
@@ -466,11 +466,11 @@
             ].
 
             state == #added ifTrue:[
-                l1 add:(text1 at:idx1).
+                l1 add:(text1 at:idx1 ifAbsent:'').
                 idx1 := idx1 + 1.
             ].
             state == #deleted ifTrue:[
-                l2 add:(text2 at:idx2).
+                l2 add:(text2 at:idx2 ifAbsent:'').
                 idx2 := idx2 + 1.
             ].
 
@@ -632,5 +632,5 @@
 !DiffTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/DiffTextView.st,v 1.36 2003-01-07 12:03:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DiffTextView.st,v 1.37 2003-01-27 12:07:53 cg Exp $'
 ! !