--- a/ChangesBrowser.st Mon Jun 06 09:52:11 2005 +0200
+++ b/ChangesBrowser.st Tue Jun 07 18:28:48 2005 +0200
@@ -4003,127 +4003,127 @@
aStream := self streamForChange:changeNr.
aStream isNil ifTrue:[
- ^ self
+ ^ self
].
showDiff := false.
(self changeIsFollowupMethodChange:changeNr) ifFalse:[
- sawExcla := aStream peekFor:(aStream class chunkSeparator).
- chunk := aStream nextChunk.
+ sawExcla := aStream peekFor:(aStream class chunkSeparator).
+ chunk := aStream nextChunk.
] ifTrue:[
- chunk := (changeChunks at:changeNr).
- sawExcla := true.
+ chunk := (changeChunks at:changeNr).
+ sawExcla := true.
].
Class nameSpaceQuerySignal answer:(self nameSpaceForApply)
do:[
- parseTree := Parser parseExpression:chunk.
- (parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[
- selector := parseTree selector.
- ]
+ parseTree := Parser parseExpression:chunk.
+ (parseTree notNil and:[parseTree ~~ #Error and:[ parseTree isMessage ]]) ifTrue:[
+ selector := parseTree selector.
+ ]
].
selector isNil ifTrue:[
- newSource := chunk.
- oldSource := 'Not comparable.'.
+ newSource := chunk.
+ oldSource := 'Not comparable.'.
] ifFalse:[
- sawExcla ifFalse:[
- "/ not a method-change
- newSource := chunk.
- oldSource := self oldSourceForParseTree:parseTree.
- ] ifTrue:[
- "/ a method-change
-
- (#(
- #methodsFor:
- #privateMethodsFor:
- #publicMethodsFor:
- #ignoredMethodsFor:
- #protectedMethodsFor:
-
- #methodsFor:stamp: "/ Squeak support
- #methodsFor "/ Dolphin support
- #methods "/ STV support
- )
- includes:selector) ifTrue:[
- newSource := aStream nextChunk.
-
- thisClass := (parseTree receiver evaluate).
- thisClass isBehavior ifTrue:[
- (thisClass isLoaded
- or:[ autoloadAsRequired value
- and:[self checkClassIsLoaded:thisClass]]) ifFalse:[
- oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs.
- ] ifTrue:[
- selector == #methodsFor ifTrue:[
- cat := 'Dolphin methods'.
- ] ifFalse:[
- selector == #methods ifTrue:[
- cat := 'STV methods'.
- ] ifFalse:[
- cat := parseTree arg1 evaluate.
- ].
- ].
- Class nameSpaceQuerySignal answer:(self nameSpaceForApply)
- do:[
- Error handle:[:ex |
- ] do:[
- parser := Parser parseMethod:newSource in:thisClass.
- ]
- ].
- (parser notNil and:[parser ~~ #Error]) ifTrue:[
- sel := parser selector.
- oldMethod := thisClass compiledMethodAt:sel.
- oldMethod notNil ifTrue:[
- (oldMethod category = cat) ifFalse:[
- Transcript showCR:'category changed.'.
- ].
- oldSource := oldMethod source.
- (oldSource = newSource) ifFalse:[
- oldSource isNil ifTrue:[
- oldSource := 'No source for compare.'.
- ] ifFalse:[
- "/
- "/ compare for tabulator <-> space changes
- "/ before showing diff ...
- "/
- oldSource := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded].
- newSource := newSource asCollectionOfLines collect:[:s | s withTabsExpanded].
- oldSource = newSource ifFalse:[
- "/
- "/ check if only historyLine diffs
- "/
- (HistoryManager notNil
- and:[HistoryManager isActive]) ifTrue:[
- oldSource := oldSource asStringCollection asString.
- newSource := newSource asStringCollection asString.
- (HistoryManager withoutHistoryLines:oldSource)
- =
- (HistoryManager withoutHistoryLines:newSource)
- ifTrue:[
- oldSource := (HistoryManager withoutHistoryLines:oldSource).
- newSource := (HistoryManager withoutHistoryLines:newSource).
- ]
- ].
- ]
- ]
- ]
- ] ifFalse:[
- oldSource := 'Method does not exist.'.
- ]
- ] ifFalse:[
- oldSource := 'Change is unparsable (parse error).'.
- ].
- ].
- ] ifFalse:[
- oldSource := 'Class does not exist.'.
- ]
- ] ifFalse:[
- newSource := aStream contents.
- oldSource := 'Not comparable.'.
- ]
- ]
+ sawExcla ifFalse:[
+ "/ not a method-change
+ newSource := chunk.
+ oldSource := self oldSourceForParseTree:parseTree.
+ ] ifTrue:[
+ "/ a method-change
+
+ (#(
+ #methodsFor:
+ #privateMethodsFor:
+ #publicMethodsFor:
+ #ignoredMethodsFor:
+ #protectedMethodsFor:
+
+ #methodsFor:stamp: "/ Squeak support
+ #methodsFor "/ Dolphin support
+ #methods "/ STV support
+ )
+ includes:selector) ifTrue:[
+ newSource := aStream nextChunk.
+
+ thisClass := (parseTree receiver evaluate).
+ thisClass isBehavior ifTrue:[
+ (thisClass isLoaded
+ or:[ autoloadAsRequired value
+ and:[self checkClassIsLoaded:thisClass]]) ifFalse:[
+ oldSource := 'Cannot compare this change\\(compare requires class to be loaded).' withCRs.
+ ] ifTrue:[
+ selector == #methodsFor ifTrue:[
+ cat := 'Dolphin methods'.
+ ] ifFalse:[
+ selector == #methods ifTrue:[
+ cat := 'STV methods'.
+ ] ifFalse:[
+ cat := parseTree arg1 evaluate.
+ ].
+ ].
+ Class nameSpaceQuerySignal answer:(self nameSpaceForApply)
+ do:[
+ Error handle:[:ex |
+ ] do:[
+ parser := Parser parseMethod:newSource in:thisClass.
+ ]
+ ].
+ (parser notNil and:[parser ~~ #Error]) ifTrue:[
+ sel := parser selector.
+ oldMethod := thisClass compiledMethodAt:sel.
+ oldMethod notNil ifTrue:[
+ (oldMethod category = cat) ifFalse:[
+ Transcript showCR:'category changed.'.
+ ].
+ oldSource := oldMethod source.
+ (oldSource = newSource) ifFalse:[
+ oldSource isNil ifTrue:[
+ oldSource := 'No source for compare.'.
+ ] ifFalse:[
+ "/
+ "/ compare for tabulator <-> space changes
+ "/ before showing diff ...
+ "/
+ oldSource := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded].
+ newSource := newSource asCollectionOfLines collect:[:s | s withTabsExpanded].
+ oldSource = newSource ifFalse:[
+ "/
+ "/ check if only historyLine diffs
+ "/
+ (HistoryManager notNil
+ and:[HistoryManager isActive]) ifTrue:[
+ oldSource := oldSource asStringCollection asString.
+ newSource := newSource asStringCollection asString.
+ (HistoryManager withoutHistoryLines:oldSource)
+ =
+ (HistoryManager withoutHistoryLines:newSource)
+ ifTrue:[
+ oldSource := (HistoryManager withoutHistoryLines:oldSource).
+ newSource := (HistoryManager withoutHistoryLines:newSource).
+ ]
+ ].
+ ]
+ ]
+ ]
+ ] ifFalse:[
+ oldSource := 'Method does not exist.'.
+ ]
+ ] ifFalse:[
+ oldSource := 'Change is unparsable (parse error).'.
+ ].
+ ].
+ ] ifFalse:[
+ oldSource := 'Class does not exist.'.
+ ]
+ ] ifFalse:[
+ newSource := chunk. "/ aStream contents.
+ oldSource := 'Not comparable.'.
+ ]
+ ]
].
aStream close.
@@ -4131,10 +4131,10 @@
newSource := newSource ? ''.
(oldSource = newSource
or:[ oldSource asStringCollection withTabsExpanded = newSource asStringCollection withTabsExpanded]) ifTrue:[
- self makeDiffViewInvisible
+ self makeDiffViewInvisible
] ifFalse:[
- self makeDiffViewVisible.
- diffView text1:oldSource text2:newSource.
+ self makeDiffViewVisible.
+ diffView text1:oldSource text2:newSource.
].
"Created: / 24.11.1995 / 14:30:46 / cg"
@@ -5119,9 +5119,12 @@
|changeNr|
(changeNr := self theSingleSelection) isNil ifTrue:[
- ^ self information:'Only possible if a single change is selected.'.
+ ^ self information:'Only possible if a single change is selected.'.
].
- self doSaveClassFrom:changeNr
+ self doSaveClassFrom:changeNr.
+
+ changeListView setSelection:changeNr.
+ "/ self changeSelection:changeNr.
!
doSaveRest
@@ -5663,5 +5666,5 @@
!ChangesBrowser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.331 2005-04-28 17:30:04 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.332 2005-06-07 16:28:48 cg Exp $'
! !