--- a/ChangesBrowser.st Sat Feb 07 19:13:50 1998 +0100
+++ b/ChangesBrowser.st Sat Feb 07 19:22:18 1998 +0100
@@ -566,49 +566,49 @@
outStream := FileStream oldFileNamed:fileName.
outStream isNil ifTrue:[
- outStream isNil ifTrue:[
- outStream := FileStream newFileNamed:fileName.
- outStream isNil ifTrue:[
- self warn:'cannot update file ''%1''' with:fileName.
- ^ false
- ]
- ]
+ outStream isNil ifTrue:[
+ outStream := FileStream newFileNamed:fileName.
+ outStream isNil ifTrue:[
+ self warn:'cannot update file ''%1''' with:fileName.
+ ^ false
+ ]
+ ]
].
outStream setToEnd.
aStream := self streamForChange:changeNr.
aStream isNil ifTrue:[
- self warn:'oops cannot read change'.
- ^ false
+ self warn:'oops cannot read change'.
+ ^ false
].
separator := aStream class chunkSeparator.
- (changeIsFollowupMethodChange at:changeNr) ifTrue:[
- sawExcla := true.
- chunk := changeChunks at:changeNr
+ (self changeIsFollowupMethodChange:changeNr) ifTrue:[
+ sawExcla := true.
+ chunk := changeChunks at:changeNr
] ifFalse:[
- sawExcla := aStream peekFor:separator.
- chunk := aStream nextChunk.
+ sawExcla := aStream peekFor:separator.
+ chunk := aStream nextChunk.
].
sawExcla ifTrue:[
- outStream nextPut:separator
+ outStream nextPut:separator
].
outStream nextChunkPut:chunk; cr.
sawExcla ifTrue:[
- chunk := aStream nextChunk.
- outStream nextChunkPut:chunk; space
+ chunk := aStream nextChunk.
+ outStream nextChunkPut:chunk; space
].
sawExcla ifTrue:[
- outStream nextPut:separator
+ outStream nextPut:separator
].
outStream cr.
aStream close.
outStream close.
^ true
- "Modified: 5.9.1996 / 17:28:22 / cg"
+ "Modified: / 6.2.1998 / 13:03:54 / cg"
!
applyChange:changeNr
@@ -645,7 +645,7 @@
|reader doItChunk methodsForChunk|
"/ a followup methodsFor: chunk ...
- (changeIsFollowupMethodChange at:changeNr) ifTrue:[
+ (self changeIsFollowupMethodChange:changeNr) ifTrue:[
methodsForChunk := (changeChunks at:changeNr).
] ifFalse:[
doItChunk := aStream nextChunk. "/ an empty chunk sometimes ...
@@ -677,7 +677,7 @@
].
aStream close
- "Modified: 10.9.1996 / 20:18:46 / cg"
+ "Modified: / 6.2.1998 / 13:04:04 / cg"
!
autoSelect:changeNr
@@ -806,153 +806,153 @@
showDiff := false.
- (changeIsFollowupMethodChange at:changeNr) ifFalse:[
- sawExcla := aStream peekFor:(aStream class chunkSeparator).
- chunk := aStream nextChunk.
+ (self changeIsFollowupMethodChange:changeNr) ifFalse:[
+ sawExcla := aStream peekFor:(aStream class chunkSeparator).
+ chunk := aStream nextChunk.
] ifTrue:[
- chunk := (changeChunks at:changeNr).
- sawExcla := true.
+ chunk := (changeChunks at:changeNr).
+ sawExcla := true.
].
beep := false.
sawExcla ifFalse:[
- outcome := 'cannot compare this change\\(i.e. this is not a method change).'.
-
- parseTree := Parser parseExpression:chunk.
- (parseTree notNil and:[parseTree isMessage]) ifTrue:[
- ((selector := parseTree selector) == #removeSelector:) ifTrue:[
- thisClass := (parseTree receiver evaluate).
- thisClass isBehavior ifTrue:[
- (self checkClassIsLoaded:thisClass) ifTrue:[
- selector := (parseTree arg1 evaluate).
- (thisClass includesSelector:selector) ifTrue:[
- outcome := 'change removes the #' , selector , ' method from ' , thisClass name.
- ] ifFalse:[
- outcome := 'change has no effect\\(there is no method for #' , selector , ' in ' , thisClass name , ')'
- ]
- ] ifFalse:[
- beep := true.
- outcome := 'cannot compare this change (compare requires class to be loaded).'.
- ]
- ]
- ].
- selector == #category: ifTrue:[
- parseTree receiver isMessage ifTrue:[
- parseTree receiver selector == #compiledMethodAt: ifTrue:[
- (method := parseTree receiver evaluate) isMethod ifTrue:[
- method category = parseTree arg1 evaluate ifTrue:[
- outcome := 'change has no effect\\(same category)'.
- ] ifFalse:[
- outcome := 'category is different (''' , method category , ''' vs. ''' , parseTree arg1 evaluate , ''')'
- ]
- ] ifFalse:[
- beep := true.
- outcome := 'there is no such method'
- ]
- ]
- ]
- ]
- ]
+ outcome := 'cannot compare this change\\(i.e. this is not a method change).'.
+
+ parseTree := Parser parseExpression:chunk.
+ (parseTree notNil and:[parseTree isMessage]) ifTrue:[
+ ((selector := parseTree selector) == #removeSelector:) ifTrue:[
+ thisClass := (parseTree receiver evaluate).
+ thisClass isBehavior ifTrue:[
+ (self checkClassIsLoaded:thisClass) ifTrue:[
+ selector := (parseTree arg1 evaluate).
+ (thisClass includesSelector:selector) ifTrue:[
+ outcome := 'change removes the #' , selector , ' method from ' , thisClass name.
+ ] ifFalse:[
+ outcome := 'change has no effect\\(there is no method for #' , selector , ' in ' , thisClass name , ')'
+ ]
+ ] ifFalse:[
+ beep := true.
+ outcome := 'cannot compare this change (compare requires class to be loaded).'.
+ ]
+ ]
+ ].
+ selector == #category: ifTrue:[
+ parseTree receiver isMessage ifTrue:[
+ parseTree receiver selector == #compiledMethodAt: ifTrue:[
+ (method := parseTree receiver evaluate) isMethod ifTrue:[
+ method category = parseTree arg1 evaluate ifTrue:[
+ outcome := 'change has no effect\\(same category)'.
+ ] ifFalse:[
+ outcome := 'category is different (''' , method category , ''' vs. ''' , parseTree arg1 evaluate , ''')'
+ ]
+ ] ifFalse:[
+ beep := true.
+ outcome := 'there is no such method'
+ ]
+ ]
+ ]
+ ]
+ ]
] ifTrue:[
- parseTree := Parser parseExpression:chunk.
- (parseTree notNil
- and:[parseTree ~~ #Error
- and:[parseTree isMessage]]) ifTrue:[
- (parseTree selector == #methodsFor:) ifTrue:[
- thisClass := (parseTree receiver evaluate).
- thisClass isBehavior ifTrue:[
- (isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[
- outcome := 'cannot compare this change\\(compare requires class to be loaded).'.
- ].
-
- cat := parseTree arg1 evaluate.
- newSource := aStream nextChunk.
-
- 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) ifTrue:[
- outcome := 'same source'
- ] ifFalse:[
- oldSource isNil ifTrue:[
- beep := true.
- outcome := 'no source for compare.'
- ] ifFalse:[
- "/
- "/ compare for tabulator <-> space changes
- "/ before showing diff ...
- "/
- t1 := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded].
- t2 := newSource asCollectionOfLines collect:[:s | s withTabsExpanded].
- t1 = t2 ifTrue:[
- outcome := 'same source'
- ] ifFalse:[
- outcome := 'source changed.'.
- showDiff := true.
-
- "/
- "/ check if only historyLine diffs
- "/
- (HistoryManager notNil
- and:[HistoryManager isActive]) ifTrue:[
- (HistoryManager withoutHistoryLines:newSource)
- =
- (HistoryManager withoutHistoryLines:oldSource)
- ifTrue:[
- outcome := 'same source (history only)'.
- showDiff := false.
- ]
- ].
- ]
- ]
- ]
- ] ifFalse:[
- isLoaded ifTrue:[
- beep := true.
- outcome := 'method does not exist.'
- ]
- ]
- ] ifFalse:[
- outcome := 'change unparsable.'
- ].
- (showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[
- d := DiffTextView
- openOn:oldSource label:'current version'
- and:newSource label:'changeFile version'.
- d label:'method differences'.
- ]
- ] ifFalse:[
- beep := true.
- outcome := 'class does not exist.'
- ]
- ] ifFalse:[
- beep := true.
- outcome := 'not comparable.'
- ]
- ] ifFalse:[
- beep := true.
- outcome := 'not comparable.'
- ]
+ parseTree := Parser parseExpression:chunk.
+ (parseTree notNil
+ and:[parseTree ~~ #Error
+ and:[parseTree isMessage]]) ifTrue:[
+ (parseTree selector == #methodsFor:) ifTrue:[
+ thisClass := (parseTree receiver evaluate).
+ thisClass isBehavior ifTrue:[
+ (isLoaded := self checkClassIsLoaded:thisClass) ifFalse:[
+ outcome := 'cannot compare this change\\(compare requires class to be loaded).'.
+ ].
+
+ cat := parseTree arg1 evaluate.
+ newSource := aStream nextChunk.
+
+ 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) ifTrue:[
+ outcome := 'same source'
+ ] ifFalse:[
+ oldSource isNil ifTrue:[
+ beep := true.
+ outcome := 'no source for compare.'
+ ] ifFalse:[
+ "/
+ "/ compare for tabulator <-> space changes
+ "/ before showing diff ...
+ "/
+ t1 := oldSource asCollectionOfLines collect:[:s | s withTabsExpanded].
+ t2 := newSource asCollectionOfLines collect:[:s | s withTabsExpanded].
+ t1 = t2 ifTrue:[
+ outcome := 'same source'
+ ] ifFalse:[
+ outcome := 'source changed.'.
+ showDiff := true.
+
+ "/
+ "/ check if only historyLine diffs
+ "/
+ (HistoryManager notNil
+ and:[HistoryManager isActive]) ifTrue:[
+ (HistoryManager withoutHistoryLines:newSource)
+ =
+ (HistoryManager withoutHistoryLines:oldSource)
+ ifTrue:[
+ outcome := 'same source (history only)'.
+ showDiff := false.
+ ]
+ ].
+ ]
+ ]
+ ]
+ ] ifFalse:[
+ isLoaded ifTrue:[
+ beep := true.
+ outcome := 'method does not exist.'
+ ]
+ ]
+ ] ifFalse:[
+ outcome := 'change unparsable.'
+ ].
+ (showDiff and:[oldSource notNil and:[newSource notNil]]) ifTrue:[
+ d := DiffTextView
+ openOn:oldSource label:'current version'
+ and:newSource label:'changeFile version'.
+ d label:'method differences'.
+ ]
+ ] ifFalse:[
+ beep := true.
+ outcome := 'class does not exist.'
+ ]
+ ] ifFalse:[
+ beep := true.
+ outcome := 'not comparable.'
+ ]
+ ] ifFalse:[
+ beep := true.
+ outcome := 'not comparable.'
+ ]
].
aStream close.
showDiff ifFalse:[
- beep ifTrue:[
- self warn:outcome withCRs.
- ] ifFalse:[
- self information:outcome withCRs.
- ]
+ beep ifTrue:[
+ self warn:outcome withCRs.
+ ] ifFalse:[
+ self information:outcome withCRs.
+ ]
"/ Transcript showCR:outcome.
].
- "Created: 24.11.1995 / 14:30:46 / cg"
- "Modified: 14.10.1996 / 20:08:16 / cg"
+ "Created: / 24.11.1995 / 14:30:46 / cg"
+ "Modified: / 6.2.1998 / 13:04:13 / cg"
!
compressForClass:aClassNameOrNil
@@ -1869,27 +1869,27 @@
aStream := self streamForChange:changeNr.
aStream isNil ifTrue:[^ nil].
- (changeIsFollowupMethodChange at:changeNr) ifFalse:[
- sawExcla := aStream peekFor:(aStream class chunkSeparator).
- chunk := aStream nextChunk.
+ (self changeIsFollowupMethodChange:changeNr) ifFalse:[
+ sawExcla := aStream peekFor:(aStream class chunkSeparator).
+ chunk := aStream nextChunk.
] ifTrue:[
- chunk := (changeChunks at:changeNr).
- sawExcla := true.
+ chunk := (changeChunks at:changeNr).
+ sawExcla := true.
].
sawExcla ifTrue:[
- parseTree := Parser parseExpression:chunk.
- (parseTree notNil and:[parseTree isMessage]) ifTrue:[
- (parseTree selector == #methodsFor:) ifTrue:[
- sourceChunk := aStream nextChunk.
- ]
- ].
+ parseTree := Parser parseExpression:chunk.
+ (parseTree notNil and:[parseTree isMessage]) ifTrue:[
+ (parseTree selector == #methodsFor:) ifTrue:[
+ sourceChunk := aStream nextChunk.
+ ]
+ ].
].
aStream close.
^ sourceChunk
- "Modified: 5.9.1996 / 17:08:33 / cg"
- "Created: 5.9.1996 / 17:11:32 / cg"
+ "Created: / 5.9.1996 / 17:11:32 / cg"
+ "Modified: / 6.2.1998 / 13:04:26 / cg"
!
streamForChange:changeNr
@@ -2683,5 +2683,5 @@
!ChangesBrowser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.127 1998-02-07 18:13:50 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.128 1998-02-07 18:22:18 cg Exp $'
! !