--- a/CBrowser.st Fri Nov 24 14:32:50 1995 +0100
+++ b/CBrowser.st Fri Nov 24 19:27:30 1995 +0100
@@ -12,10 +12,10 @@
StandardSystemView subclass:#ChangesBrowser
instanceVariableNames:'changeListView codeView changeFileName changeChunks
- changePositions changeClassNames changeHeaderLines anyChanges
- changeNrShown changeNrProcessed skipSignal compareChanges
- compareCheckBox changeFileSize changeFileTimestamp checkBlock
- changeTimeStamps tabSpec'
+ changePositions changeClassNames changeHeaderLines anyChanges
+ changeNrShown changeNrProcessed skipSignal compareChanges
+ compareCheckBox changeFileSize changeFileTimestamp checkBlock
+ changeTimeStamps tabSpec'
classVariableNames:'CompressSnapshotInfo'
poolDictionaries:''
category:'Interface-Browsers'
@@ -221,7 +221,7 @@
'update'
'compress'
'compare with current version'
- 'browse class'
+ 'browse'
'-'
'make change a patch'
"/ 'update sourcefile from change'
@@ -672,71 +672,71 @@
sawExcla := aStream peekFor:(aStream class chunkSeparator).
chunk := aStream nextChunk.
sawExcla ifFalse:[
- outcome := 'not comparable ...'
+ outcome := 'not comparable ...'
] ifTrue:[
- parseTree := Parser parseExpression:chunk.
- (parseTree notNil and:[parseTree isMessage]) ifTrue:[
- (parseTree selector == #methodsFor:) ifTrue:[
- thisClass := (parseTree receiver evaluate).
- thisClass isBehavior ifTrue:[
- showDiff := false.
+ parseTree := Parser parseExpression:chunk.
+ (parseTree notNil and:[parseTree isMessage]) ifTrue:[
+ (parseTree selector == #methodsFor:) ifTrue:[
+ thisClass := (parseTree receiver evaluate).
+ thisClass isBehavior ifTrue:[
+ showDiff := false.
- 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:[
- 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
- ]
- ]
- ]
- ] ifFalse:[
- 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:[
- outcome := 'class does not exist.'
- ]
- ] ifFalse:[
- outcome := 'not comparable.'
- ]
- ] ifFalse:[
- outcome := 'not comparable.'
- ]
+ 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:[
+ 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
+ ]
+ ]
+ ]
+ ] ifFalse:[
+ 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:[
+ outcome := 'class does not exist.'
+ ]
+ ] ifFalse:[
+ outcome := 'not comparable.'
+ ]
+ ] ifFalse:[
+ outcome := 'not comparable.'
+ ]
].
aStream close.
showDiff ifFalse:[
- self information:outcome.
+ self information:outcome.
"/ Transcript showCr:outcome.
].
@@ -828,17 +828,17 @@
and a list of chunk-positions (changePositions).
Starting with 2.10.3, the entries are multi-col entries;
the cols are:
- 1 delta (only if comparing)
- '+' -> new method (w.r.t. current state)
- '-' -> removed method (w.r.t. current state)
- '?' -> class does not exist currently
- '=' -> change is same as current methods source
- 2 class/selector
- 3 type of change
- doit
- method
- category change
- 4 timestamp
+ 1 delta (only if comparing)
+ '+' -> new method (w.r.t. current state)
+ '-' -> removed method (w.r.t. current state)
+ '?' -> class does not exist currently
+ '=' -> change is same as current methods source
+ 2 class/selector
+ 3 type of change
+ doit
+ method
+ category change
+ 4 timestamp
since comparing slows down startup time, it is now disabled by
default and can be enabled via a toggle."
@@ -855,282 +855,282 @@
changeFileTimestamp := f info at:#modified.
self withCursor:(Cursor read) do:[
- |myProcess myPriority|
+ |myProcess myPriority|
- "
- this is a time consuming operation (especially, if reading an
- NFS-mounted directory; therefore lower my priority ...
- "
- inBackground ifTrue:[
- myProcess := Processor activeProcess.
- myPriority := myProcess priority.
- myProcess priority:(Processor userBackgroundPriority).
- ].
+ "
+ this is a time consuming operation (especially, if reading an
+ NFS-mounted directory; therefore lower my priority ...
+ "
+ inBackground ifTrue:[
+ myProcess := Processor activeProcess.
+ myPriority := myProcess priority.
+ myProcess priority:(Processor userBackgroundPriority).
+ ].
- [
- |excla timeStampInfo|
+ [
+ |excla timeStampInfo|
- changeChunks := OrderedCollection new.
- changeHeaderLines := OrderedCollection new.
- changePositions := OrderedCollection new.
- changeTimeStamps := OrderedCollection new.
- excla := aStream class chunkSeparator.
+ changeChunks := OrderedCollection new.
+ changeHeaderLines := OrderedCollection new.
+ changePositions := OrderedCollection new.
+ changeTimeStamps := OrderedCollection new.
+ excla := aStream class chunkSeparator.
- [aStream atEnd] whileFalse:[
- |entry changeDelta changeString changeType
- line s l changeClass sawExcla category
- chunkText chunkPos|
+ [aStream atEnd] whileFalse:[
+ |entry changeDelta changeString changeType
+ line s l changeClass sawExcla category
+ chunkText chunkPos|
- "
- get a chunk (separated by excla)
- "
- aStream skipSeparators.
- chunkPos := aStream position.
+ "
+ get a chunk (separated by excla)
+ "
+ aStream skipSeparators.
+ chunkPos := aStream position.
- sawExcla := aStream peekFor:excla.
- chunkText := aStream nextChunk.
- chunkText notNil ifTrue:[
- |index headerLine|
+ sawExcla := aStream peekFor:excla.
+ chunkText := aStream nextChunk.
+ chunkText notNil ifTrue:[
+ |index headerLine|
- (chunkText startsWith:'''---- timestamp ') ifTrue:[
- timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces.
- ] ifFalse:[
+ (chunkText startsWith:'''---- timestamp ') ifTrue:[
+ timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces.
+ ] ifFalse:[
- "
- only first line is saved in changeChunks ...
- "
- index := chunkText indexOf:(Character cr).
- (index ~~ 0) ifTrue:[
- chunkText := chunkText copyTo:(index - 1).
+ "
+ only first line is saved in changeChunks ...
+ "
+ index := chunkText indexOf:(Character cr).
+ (index ~~ 0) ifTrue:[
+ chunkText := chunkText copyTo:(index - 1).
- "take care for comment changes - must still be a
- valid expression for classNameOfChange: to work"
+ "take care for comment changes - must still be a
+ valid expression for classNameOfChange: to work"
- (chunkText endsWith:'comment:''') ifTrue:[
- chunkText := chunkText , '...'''
- ].
- (chunkText endsWith:'primitiveDefinitions:''%{') ifTrue:[
- chunkText := chunkText , '... %}'''
- ].
- (chunkText endsWith:'primitiveVariables:''%{') ifTrue:[
- chunkText := chunkText , '... %}'''
- ].
- (chunkText endsWith:'primitiveFunctions:''%{') ifTrue:[
- chunkText := chunkText , '... %}'''
- ].
- ].
+ (chunkText endsWith:'comment:''') ifTrue:[
+ chunkText := chunkText , '...'''
+ ].
+ (chunkText endsWith:'primitiveDefinitions:''%{') ifTrue:[
+ chunkText := chunkText , '... %}'''
+ ].
+ (chunkText endsWith:'primitiveVariables:''%{') ifTrue:[
+ chunkText := chunkText , '... %}'''
+ ].
+ (chunkText endsWith:'primitiveFunctions:''%{') ifTrue:[
+ chunkText := chunkText , '... %}'''
+ ].
+ ].
- changeChunks add:chunkText.
- changePositions add:chunkPos.
- changeTimeStamps add:timeStampInfo.
+ changeChunks add:chunkText.
+ changePositions add:chunkPos.
+ changeTimeStamps add:timeStampInfo.
- headerLine := nil.
- changeDelta := ' '.
+ headerLine := nil.
+ changeDelta := ' '.
- sawExcla ifFalse:[
- (chunkText startsWith:'''---- snap') ifTrue:[
- changeType := ''.
- headerLine := chunkText.
- changeString := (chunkText contractTo:maxLen).
- ] ifFalse:[
+ sawExcla ifFalse:[
+ (chunkText startsWith:'''---- snap') ifTrue:[
+ changeType := ''.
+ headerLine := chunkText.
+ changeString := (chunkText contractTo:maxLen).
+ ] ifFalse:[
- |p sel cls|
+ |p sel cls|
- headerLine := chunkText , ' (doIt)'.
+ headerLine := chunkText , ' (doIt)'.
- "
- first, assume doIt - then lets have a more detailed look ...
- "
- (chunkText startsWith:'''---- file') ifTrue:[
- changeType := ''.
- ] ifFalse:[
- changeType := '(doIt)'.
- ].
- changeString := (chunkText contractTo:maxLen).
+ "
+ first, assume doIt - then lets have a more detailed look ...
+ "
+ (chunkText startsWith:'''---- file') ifTrue:[
+ changeType := ''.
+ ] ifFalse:[
+ changeType := '(doIt)'.
+ ].
+ changeString := (chunkText contractTo:maxLen).
- p := Parser parseExpression:chunkText.
- (p notNil
- and:[p ~~ #Error
- and:[p isMessage]]) ifTrue:[
- sel := p selector.
- ].
- (sel == #removeSelector:) ifTrue:[
- p receiver isUnaryMessage ifTrue:[
- cls := p receiver receiver name.
- changeClass := (Smalltalk classNamed:cls) class.
- cls := cls , ' class'.
- ] ifFalse:[
- cls := p receiver name.
- changeClass := (Smalltalk classNamed:cls)
- ].
- sel := (p args at:1) evaluate.
+ p := Parser parseExpression:chunkText.
+ (p notNil
+ and:[p ~~ #Error
+ and:[p isMessage]]) ifTrue:[
+ sel := p selector.
+ ].
+ (sel == #removeSelector:) ifTrue:[
+ p receiver isUnaryMessage ifTrue:[
+ cls := p receiver receiver name.
+ changeClass := (Smalltalk classNamed:cls) class.
+ cls := cls , ' class'.
+ ] ifFalse:[
+ cls := p receiver name.
+ changeClass := (Smalltalk classNamed:cls)
+ ].
+ sel := (p args at:1) evaluate.
- compareChanges ifTrue:[
- (changeClass isNil or:[changeClass isLoaded not]) ifTrue:[
- changeDelta := '?'
- ] ifFalse:[
- (changeClass implements:sel asSymbol) ifTrue:[
- changeDelta := '-'.
- ]
- ]
- ].
- changeType := '(remove)'.
- changeString := self contractClass:cls selector:sel to:maxLen.
- ].
- (p isMessage
- and:[p receiver isMessage
- and:[p receiver selector == #compiledMethodAt:]]) ifTrue:[
- p receiver receiver isUnaryMessage ifTrue:[
- cls := p receiver receiver receiver name.
- changeClass := (Smalltalk classNamed:cls) class.
- cls := cls , ' class'.
- ] ifFalse:[
- cls := p receiver receiver name.
- changeClass := (Smalltalk classNamed:cls)
- ].
- (sel == #category:) ifTrue:[
- sel := (p receiver args at:1) evaluate.
- changeType := '(category change)'.
- changeString := self contractClass:cls selector:sel to:maxLen.
- ].
- (sel == #privacy:) ifTrue:[
- sel := (p receiver args at:1) evaluate.
- changeType := '(privacy change)'.
- changeString := self contractClass:cls selector:sel to:maxLen.
- ].
- ].
- (#(#'subclass:'
- #'variableSubclass:'
- #'variableByteSubclass:'
- #'variableWordSubclass:'
- #'variableLongSubclass:'
- #'variableFloatSubclass:'
- #'variableDoubleSubclass:'
- ) includes:sel) ifTrue:[
- changeType := '(class definition)'.
- ].
- ]
- ] ifTrue:[ "sawExcla"
- |done first p sel cls text|
+ compareChanges ifTrue:[
+ (changeClass isNil or:[changeClass isLoaded not]) ifTrue:[
+ changeDelta := '?'
+ ] ifFalse:[
+ (changeClass implements:sel asSymbol) ifTrue:[
+ changeDelta := '-'.
+ ]
+ ]
+ ].
+ changeType := '(remove)'.
+ changeString := self contractClass:cls selector:sel to:maxLen.
+ ].
+ (p isMessage
+ and:[p receiver isMessage
+ and:[p receiver selector == #compiledMethodAt:]]) ifTrue:[
+ p receiver receiver isUnaryMessage ifTrue:[
+ cls := p receiver receiver receiver name.
+ changeClass := (Smalltalk classNamed:cls) class.
+ cls := cls , ' class'.
+ ] ifFalse:[
+ cls := p receiver receiver name.
+ changeClass := (Smalltalk classNamed:cls)
+ ].
+ (sel == #category:) ifTrue:[
+ sel := (p receiver args at:1) evaluate.
+ changeType := '(category change)'.
+ changeString := self contractClass:cls selector:sel to:maxLen.
+ ].
+ (sel == #privacy:) ifTrue:[
+ sel := (p receiver args at:1) evaluate.
+ changeType := '(privacy change)'.
+ changeString := self contractClass:cls selector:sel to:maxLen.
+ ].
+ ].
+ (#(#'subclass:'
+ #'variableSubclass:'
+ #'variableByteSubclass:'
+ #'variableWordSubclass:'
+ #'variableLongSubclass:'
+ #'variableFloatSubclass:'
+ #'variableDoubleSubclass:'
+ ) includes:sel) ifTrue:[
+ changeType := '(class definition)'.
+ ].
+ ]
+ ] ifTrue:[ "sawExcla"
+ |done first p sel cls text|
- "
- method definitions actually consist of
- two (or more) chunks; skip next chunk(s)
- up to an empty one.
- The system only writes one chunk,
- and we cannot handle more in this ChangesBrowser ....
- "
- cls := nil.
- p := Parser parseExpression:chunkText.
+ "
+ method definitions actually consist of
+ two (or more) chunks; skip next chunk(s)
+ up to an empty one.
+ The system only writes one chunk,
+ and we cannot handle more in this ChangesBrowser ....
+ "
+ cls := nil.
+ p := Parser parseExpression:chunkText.
- (p notNil and:[p ~~ #Error]) ifTrue:[
- sel := p selector.
- (sel == #methodsFor:) ifTrue:[
- p receiver isUnaryMessage ifTrue:[
- cls := p receiver receiver name.
- changeClass := (Smalltalk classNamed:cls) class.
- cls := cls , ' class'.
- ] ifFalse:[
- cls := p receiver name.
- changeClass := Smalltalk classNamed:cls
- ].
- category := (p args at:1) evaluate.
- ].
- ].
- done := false.
- first := true.
- [done] whileFalse:[
- text := aStream nextChunk.
- text isNil ifTrue:[
- done := true
- ] ifFalse:[
- done := text isEmpty
- ].
- done ifFalse:[
- first ifFalse:[
- Transcript showCr:'only one method per ''methodsFor:'' handled'.
- ] ifTrue:[
- first := false.
- "
- try to find the selector
- "
- sel := nil.
- cls notNil ifTrue:[
- p := Parser
- parseMethodSpecification:text
- in:nil
- ignoreErrors:true
- ignoreWarnings:true.
- (p notNil and:[p ~~ #Error]) ifTrue:[
- sel := p selector.
- ]
- ].
+ (p notNil and:[p ~~ #Error]) ifTrue:[
+ sel := p selector.
+ (sel == #methodsFor:) ifTrue:[
+ p receiver isUnaryMessage ifTrue:[
+ cls := p receiver receiver name.
+ changeClass := (Smalltalk classNamed:cls) class.
+ cls := cls , ' class'.
+ ] ifFalse:[
+ cls := p receiver name.
+ changeClass := Smalltalk classNamed:cls
+ ].
+ category := (p args at:1) evaluate.
+ ].
+ ].
+ done := false.
+ first := true.
+ [done] whileFalse:[
+ text := aStream nextChunk.
+ text isNil ifTrue:[
+ done := true
+ ] ifFalse:[
+ done := text isEmpty
+ ].
+ done ifFalse:[
+ first ifFalse:[
+ Transcript showCr:'only one method per ''methodsFor:'' handled'.
+ ] ifTrue:[
+ first := false.
+ "
+ try to find the selector
+ "
+ sel := nil.
+ cls notNil ifTrue:[
+ p := Parser
+ parseMethodSpecification:text
+ in:nil
+ ignoreErrors:true
+ ignoreWarnings:true.
+ (p notNil and:[p ~~ #Error]) ifTrue:[
+ sel := p selector.
+ ]
+ ].
- sel isNil ifTrue:[
- changeString := (chunkText contractTo:maxLen).
- changeType := '(change)'.
- ] ifFalse:[
- changeString := self contractClass:cls selector:sel to:maxLen.
- changeType := '(method in: ''' , category , ''')'.
- ].
- sel isNil ifTrue:[
- headerLine := chunkText , ' (change)'.
- ] ifFalse:[
- headerLine := cls , ' ' , sel , ' ' , '(change category: ''' , category , ''')'.
- ].
+ sel isNil ifTrue:[
+ changeString := (chunkText contractTo:maxLen).
+ changeType := '(change)'.
+ ] ifFalse:[
+ changeString := self contractClass:cls selector:sel to:maxLen.
+ changeType := '(method in: ''' , category , ''')'.
+ ].
+ sel isNil ifTrue:[
+ headerLine := chunkText , ' (change)'.
+ ] ifFalse:[
+ headerLine := cls , ' ' , sel , ' ' , '(change category: ''' , category , ''')'.
+ ].
- compareChanges ifTrue:[
- (changeClass isNil or:[changeClass isLoaded not]) ifTrue:[
- changeDelta := '?'
- ] ifFalse:[
- (changeClass implements:sel asSymbol) ifFalse:[
- changeDelta := '+'.
- ] ifTrue:[
- |m currentText t1 t2|
+ compareChanges ifTrue:[
+ (changeClass isNil or:[changeClass isLoaded not]) ifTrue:[
+ changeDelta := '?'
+ ] ifFalse:[
+ (changeClass implements:sel asSymbol) ifFalse:[
+ changeDelta := '+'.
+ ] ifTrue:[
+ |m currentText t1 t2|
- m := changeClass compiledMethodAt:sel asSymbol.
- currentText := m source.
- currentText notNil ifTrue:[
- text asString = currentText asString ifTrue:[
- changeDelta := '='
- ] ifFalse:[
- t1 := currentText asCollectionOfLines collect:[:s | s withTabsExpanded].
- t2 := text asCollectionOfLines collect:[:s | s withTabsExpanded].
- t1 = t2 ifTrue:[
- changeDelta := '='
- ]
- ]
- ]
- ]
- ]
- ]
- ]
- ]
- ]
- ].
- changeString notNil ifTrue:[
- entry := MultiColListEntry new.
- entry tabulatorSpecification:tabSpec.
- entry colAt:1 put:changeDelta.
- entry colAt:2 put:changeString.
- entry colAt:3 put:changeType.
- entry colAt:4 put:timeStampInfo.
- changeHeaderLines add:entry
- ] ifFalse:[
- headerLine notNil ifTrue:[
- changeHeaderLines add:headerLine
- ]
- ]
- ]
- ]
- ].
- changeClassNames := OrderedCollection new grow:(changeChunks size).
- aStream close.
- anyChanges := false
- ] valueNowOrOnUnwindDo:[
- inBackground ifTrue:[myProcess priority:myPriority].
- ].
+ m := changeClass compiledMethodAt:sel asSymbol.
+ currentText := m source.
+ currentText notNil ifTrue:[
+ text asString = currentText asString ifTrue:[
+ changeDelta := '='
+ ] ifFalse:[
+ t1 := currentText asCollectionOfLines collect:[:s | s withTabsExpanded].
+ t2 := text asCollectionOfLines collect:[:s | s withTabsExpanded].
+ t1 = t2 ifTrue:[
+ changeDelta := '='
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ].
+ changeString notNil ifTrue:[
+ entry := MultiColListEntry new.
+ entry tabulatorSpecification:tabSpec.
+ entry colAt:1 put:changeDelta.
+ entry colAt:2 put:changeString.
+ entry colAt:3 put:changeType.
+ entry colAt:4 put:timeStampInfo.
+ changeHeaderLines add:entry
+ ] ifFalse:[
+ headerLine notNil ifTrue:[
+ changeHeaderLines add:headerLine
+ ]
+ ]
+ ]
+ ]
+ ].
+ changeClassNames := OrderedCollection new grow:(changeChunks size).
+ aStream close.
+ anyChanges := false
+ ] valueNowOrOnUnwindDo:[
+ inBackground ifTrue:[myProcess priority:myPriority].
+ ].
].
self checkIfFileHasChanged
@@ -1415,7 +1415,7 @@
className := self classNameOfChange:changeNr.
className notNil ifTrue:[
(cls := Smalltalk classNamed:className) notNil ifTrue:[
- SystemBrowser browseClass:cls
+ SystemBrowser openInClass:cls selector:nil
]
]
]
@@ -1850,4 +1850,4 @@
!ChangesBrowser class methodsFor:'documentation'!
version
-^ '$Header: /cvs/stx/stx/libtool/Attic/CBrowser.st,v 1.51 1995-11-24 13:32:50 cg Exp $'! !
+^ '$Header: /cvs/stx/stx/libtool/Attic/CBrowser.st,v 1.52 1995-11-24 18:27:30 cg Exp $'! !
--- a/ChangesBrowser.st Fri Nov 24 14:32:50 1995 +0100
+++ b/ChangesBrowser.st Fri Nov 24 19:27:30 1995 +0100
@@ -12,10 +12,10 @@
StandardSystemView subclass:#ChangesBrowser
instanceVariableNames:'changeListView codeView changeFileName changeChunks
- changePositions changeClassNames changeHeaderLines anyChanges
- changeNrShown changeNrProcessed skipSignal compareChanges
- compareCheckBox changeFileSize changeFileTimestamp checkBlock
- changeTimeStamps tabSpec'
+ changePositions changeClassNames changeHeaderLines anyChanges
+ changeNrShown changeNrProcessed skipSignal compareChanges
+ compareCheckBox changeFileSize changeFileTimestamp checkBlock
+ changeTimeStamps tabSpec'
classVariableNames:'CompressSnapshotInfo'
poolDictionaries:''
category:'Interface-Browsers'
@@ -221,7 +221,7 @@
'update'
'compress'
'compare with current version'
- 'browse class'
+ 'browse'
'-'
'make change a patch'
"/ 'update sourcefile from change'
@@ -672,71 +672,71 @@
sawExcla := aStream peekFor:(aStream class chunkSeparator).
chunk := aStream nextChunk.
sawExcla ifFalse:[
- outcome := 'not comparable ...'
+ outcome := 'not comparable ...'
] ifTrue:[
- parseTree := Parser parseExpression:chunk.
- (parseTree notNil and:[parseTree isMessage]) ifTrue:[
- (parseTree selector == #methodsFor:) ifTrue:[
- thisClass := (parseTree receiver evaluate).
- thisClass isBehavior ifTrue:[
- showDiff := false.
+ parseTree := Parser parseExpression:chunk.
+ (parseTree notNil and:[parseTree isMessage]) ifTrue:[
+ (parseTree selector == #methodsFor:) ifTrue:[
+ thisClass := (parseTree receiver evaluate).
+ thisClass isBehavior ifTrue:[
+ showDiff := false.
- 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:[
- 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
- ]
- ]
- ]
- ] ifFalse:[
- 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:[
- outcome := 'class does not exist.'
- ]
- ] ifFalse:[
- outcome := 'not comparable.'
- ]
- ] ifFalse:[
- outcome := 'not comparable.'
- ]
+ 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:[
+ 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
+ ]
+ ]
+ ]
+ ] ifFalse:[
+ 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:[
+ outcome := 'class does not exist.'
+ ]
+ ] ifFalse:[
+ outcome := 'not comparable.'
+ ]
+ ] ifFalse:[
+ outcome := 'not comparable.'
+ ]
].
aStream close.
showDiff ifFalse:[
- self information:outcome.
+ self information:outcome.
"/ Transcript showCr:outcome.
].
@@ -828,17 +828,17 @@
and a list of chunk-positions (changePositions).
Starting with 2.10.3, the entries are multi-col entries;
the cols are:
- 1 delta (only if comparing)
- '+' -> new method (w.r.t. current state)
- '-' -> removed method (w.r.t. current state)
- '?' -> class does not exist currently
- '=' -> change is same as current methods source
- 2 class/selector
- 3 type of change
- doit
- method
- category change
- 4 timestamp
+ 1 delta (only if comparing)
+ '+' -> new method (w.r.t. current state)
+ '-' -> removed method (w.r.t. current state)
+ '?' -> class does not exist currently
+ '=' -> change is same as current methods source
+ 2 class/selector
+ 3 type of change
+ doit
+ method
+ category change
+ 4 timestamp
since comparing slows down startup time, it is now disabled by
default and can be enabled via a toggle."
@@ -855,282 +855,282 @@
changeFileTimestamp := f info at:#modified.
self withCursor:(Cursor read) do:[
- |myProcess myPriority|
+ |myProcess myPriority|
- "
- this is a time consuming operation (especially, if reading an
- NFS-mounted directory; therefore lower my priority ...
- "
- inBackground ifTrue:[
- myProcess := Processor activeProcess.
- myPriority := myProcess priority.
- myProcess priority:(Processor userBackgroundPriority).
- ].
+ "
+ this is a time consuming operation (especially, if reading an
+ NFS-mounted directory; therefore lower my priority ...
+ "
+ inBackground ifTrue:[
+ myProcess := Processor activeProcess.
+ myPriority := myProcess priority.
+ myProcess priority:(Processor userBackgroundPriority).
+ ].
- [
- |excla timeStampInfo|
+ [
+ |excla timeStampInfo|
- changeChunks := OrderedCollection new.
- changeHeaderLines := OrderedCollection new.
- changePositions := OrderedCollection new.
- changeTimeStamps := OrderedCollection new.
- excla := aStream class chunkSeparator.
+ changeChunks := OrderedCollection new.
+ changeHeaderLines := OrderedCollection new.
+ changePositions := OrderedCollection new.
+ changeTimeStamps := OrderedCollection new.
+ excla := aStream class chunkSeparator.
- [aStream atEnd] whileFalse:[
- |entry changeDelta changeString changeType
- line s l changeClass sawExcla category
- chunkText chunkPos|
+ [aStream atEnd] whileFalse:[
+ |entry changeDelta changeString changeType
+ line s l changeClass sawExcla category
+ chunkText chunkPos|
- "
- get a chunk (separated by excla)
- "
- aStream skipSeparators.
- chunkPos := aStream position.
+ "
+ get a chunk (separated by excla)
+ "
+ aStream skipSeparators.
+ chunkPos := aStream position.
- sawExcla := aStream peekFor:excla.
- chunkText := aStream nextChunk.
- chunkText notNil ifTrue:[
- |index headerLine|
+ sawExcla := aStream peekFor:excla.
+ chunkText := aStream nextChunk.
+ chunkText notNil ifTrue:[
+ |index headerLine|
- (chunkText startsWith:'''---- timestamp ') ifTrue:[
- timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces.
- ] ifFalse:[
+ (chunkText startsWith:'''---- timestamp ') ifTrue:[
+ timeStampInfo := (chunkText copyFrom:16 to:(chunkText size - 6)) withoutSpaces.
+ ] ifFalse:[
- "
- only first line is saved in changeChunks ...
- "
- index := chunkText indexOf:(Character cr).
- (index ~~ 0) ifTrue:[
- chunkText := chunkText copyTo:(index - 1).
+ "
+ only first line is saved in changeChunks ...
+ "
+ index := chunkText indexOf:(Character cr).
+ (index ~~ 0) ifTrue:[
+ chunkText := chunkText copyTo:(index - 1).
- "take care for comment changes - must still be a
- valid expression for classNameOfChange: to work"
+ "take care for comment changes - must still be a
+ valid expression for classNameOfChange: to work"
- (chunkText endsWith:'comment:''') ifTrue:[
- chunkText := chunkText , '...'''
- ].
- (chunkText endsWith:'primitiveDefinitions:''%{') ifTrue:[
- chunkText := chunkText , '... %}'''
- ].
- (chunkText endsWith:'primitiveVariables:''%{') ifTrue:[
- chunkText := chunkText , '... %}'''
- ].
- (chunkText endsWith:'primitiveFunctions:''%{') ifTrue:[
- chunkText := chunkText , '... %}'''
- ].
- ].
+ (chunkText endsWith:'comment:''') ifTrue:[
+ chunkText := chunkText , '...'''
+ ].
+ (chunkText endsWith:'primitiveDefinitions:''%{') ifTrue:[
+ chunkText := chunkText , '... %}'''
+ ].
+ (chunkText endsWith:'primitiveVariables:''%{') ifTrue:[
+ chunkText := chunkText , '... %}'''
+ ].
+ (chunkText endsWith:'primitiveFunctions:''%{') ifTrue:[
+ chunkText := chunkText , '... %}'''
+ ].
+ ].
- changeChunks add:chunkText.
- changePositions add:chunkPos.
- changeTimeStamps add:timeStampInfo.
+ changeChunks add:chunkText.
+ changePositions add:chunkPos.
+ changeTimeStamps add:timeStampInfo.
- headerLine := nil.
- changeDelta := ' '.
+ headerLine := nil.
+ changeDelta := ' '.
- sawExcla ifFalse:[
- (chunkText startsWith:'''---- snap') ifTrue:[
- changeType := ''.
- headerLine := chunkText.
- changeString := (chunkText contractTo:maxLen).
- ] ifFalse:[
+ sawExcla ifFalse:[
+ (chunkText startsWith:'''---- snap') ifTrue:[
+ changeType := ''.
+ headerLine := chunkText.
+ changeString := (chunkText contractTo:maxLen).
+ ] ifFalse:[
- |p sel cls|
+ |p sel cls|
- headerLine := chunkText , ' (doIt)'.
+ headerLine := chunkText , ' (doIt)'.
- "
- first, assume doIt - then lets have a more detailed look ...
- "
- (chunkText startsWith:'''---- file') ifTrue:[
- changeType := ''.
- ] ifFalse:[
- changeType := '(doIt)'.
- ].
- changeString := (chunkText contractTo:maxLen).
+ "
+ first, assume doIt - then lets have a more detailed look ...
+ "
+ (chunkText startsWith:'''---- file') ifTrue:[
+ changeType := ''.
+ ] ifFalse:[
+ changeType := '(doIt)'.
+ ].
+ changeString := (chunkText contractTo:maxLen).
- p := Parser parseExpression:chunkText.
- (p notNil
- and:[p ~~ #Error
- and:[p isMessage]]) ifTrue:[
- sel := p selector.
- ].
- (sel == #removeSelector:) ifTrue:[
- p receiver isUnaryMessage ifTrue:[
- cls := p receiver receiver name.
- changeClass := (Smalltalk classNamed:cls) class.
- cls := cls , ' class'.
- ] ifFalse:[
- cls := p receiver name.
- changeClass := (Smalltalk classNamed:cls)
- ].
- sel := (p args at:1) evaluate.
+ p := Parser parseExpression:chunkText.
+ (p notNil
+ and:[p ~~ #Error
+ and:[p isMessage]]) ifTrue:[
+ sel := p selector.
+ ].
+ (sel == #removeSelector:) ifTrue:[
+ p receiver isUnaryMessage ifTrue:[
+ cls := p receiver receiver name.
+ changeClass := (Smalltalk classNamed:cls) class.
+ cls := cls , ' class'.
+ ] ifFalse:[
+ cls := p receiver name.
+ changeClass := (Smalltalk classNamed:cls)
+ ].
+ sel := (p args at:1) evaluate.
- compareChanges ifTrue:[
- (changeClass isNil or:[changeClass isLoaded not]) ifTrue:[
- changeDelta := '?'
- ] ifFalse:[
- (changeClass implements:sel asSymbol) ifTrue:[
- changeDelta := '-'.
- ]
- ]
- ].
- changeType := '(remove)'.
- changeString := self contractClass:cls selector:sel to:maxLen.
- ].
- (p isMessage
- and:[p receiver isMessage
- and:[p receiver selector == #compiledMethodAt:]]) ifTrue:[
- p receiver receiver isUnaryMessage ifTrue:[
- cls := p receiver receiver receiver name.
- changeClass := (Smalltalk classNamed:cls) class.
- cls := cls , ' class'.
- ] ifFalse:[
- cls := p receiver receiver name.
- changeClass := (Smalltalk classNamed:cls)
- ].
- (sel == #category:) ifTrue:[
- sel := (p receiver args at:1) evaluate.
- changeType := '(category change)'.
- changeString := self contractClass:cls selector:sel to:maxLen.
- ].
- (sel == #privacy:) ifTrue:[
- sel := (p receiver args at:1) evaluate.
- changeType := '(privacy change)'.
- changeString := self contractClass:cls selector:sel to:maxLen.
- ].
- ].
- (#(#'subclass:'
- #'variableSubclass:'
- #'variableByteSubclass:'
- #'variableWordSubclass:'
- #'variableLongSubclass:'
- #'variableFloatSubclass:'
- #'variableDoubleSubclass:'
- ) includes:sel) ifTrue:[
- changeType := '(class definition)'.
- ].
- ]
- ] ifTrue:[ "sawExcla"
- |done first p sel cls text|
+ compareChanges ifTrue:[
+ (changeClass isNil or:[changeClass isLoaded not]) ifTrue:[
+ changeDelta := '?'
+ ] ifFalse:[
+ (changeClass implements:sel asSymbol) ifTrue:[
+ changeDelta := '-'.
+ ]
+ ]
+ ].
+ changeType := '(remove)'.
+ changeString := self contractClass:cls selector:sel to:maxLen.
+ ].
+ (p isMessage
+ and:[p receiver isMessage
+ and:[p receiver selector == #compiledMethodAt:]]) ifTrue:[
+ p receiver receiver isUnaryMessage ifTrue:[
+ cls := p receiver receiver receiver name.
+ changeClass := (Smalltalk classNamed:cls) class.
+ cls := cls , ' class'.
+ ] ifFalse:[
+ cls := p receiver receiver name.
+ changeClass := (Smalltalk classNamed:cls)
+ ].
+ (sel == #category:) ifTrue:[
+ sel := (p receiver args at:1) evaluate.
+ changeType := '(category change)'.
+ changeString := self contractClass:cls selector:sel to:maxLen.
+ ].
+ (sel == #privacy:) ifTrue:[
+ sel := (p receiver args at:1) evaluate.
+ changeType := '(privacy change)'.
+ changeString := self contractClass:cls selector:sel to:maxLen.
+ ].
+ ].
+ (#(#'subclass:'
+ #'variableSubclass:'
+ #'variableByteSubclass:'
+ #'variableWordSubclass:'
+ #'variableLongSubclass:'
+ #'variableFloatSubclass:'
+ #'variableDoubleSubclass:'
+ ) includes:sel) ifTrue:[
+ changeType := '(class definition)'.
+ ].
+ ]
+ ] ifTrue:[ "sawExcla"
+ |done first p sel cls text|
- "
- method definitions actually consist of
- two (or more) chunks; skip next chunk(s)
- up to an empty one.
- The system only writes one chunk,
- and we cannot handle more in this ChangesBrowser ....
- "
- cls := nil.
- p := Parser parseExpression:chunkText.
+ "
+ method definitions actually consist of
+ two (or more) chunks; skip next chunk(s)
+ up to an empty one.
+ The system only writes one chunk,
+ and we cannot handle more in this ChangesBrowser ....
+ "
+ cls := nil.
+ p := Parser parseExpression:chunkText.
- (p notNil and:[p ~~ #Error]) ifTrue:[
- sel := p selector.
- (sel == #methodsFor:) ifTrue:[
- p receiver isUnaryMessage ifTrue:[
- cls := p receiver receiver name.
- changeClass := (Smalltalk classNamed:cls) class.
- cls := cls , ' class'.
- ] ifFalse:[
- cls := p receiver name.
- changeClass := Smalltalk classNamed:cls
- ].
- category := (p args at:1) evaluate.
- ].
- ].
- done := false.
- first := true.
- [done] whileFalse:[
- text := aStream nextChunk.
- text isNil ifTrue:[
- done := true
- ] ifFalse:[
- done := text isEmpty
- ].
- done ifFalse:[
- first ifFalse:[
- Transcript showCr:'only one method per ''methodsFor:'' handled'.
- ] ifTrue:[
- first := false.
- "
- try to find the selector
- "
- sel := nil.
- cls notNil ifTrue:[
- p := Parser
- parseMethodSpecification:text
- in:nil
- ignoreErrors:true
- ignoreWarnings:true.
- (p notNil and:[p ~~ #Error]) ifTrue:[
- sel := p selector.
- ]
- ].
+ (p notNil and:[p ~~ #Error]) ifTrue:[
+ sel := p selector.
+ (sel == #methodsFor:) ifTrue:[
+ p receiver isUnaryMessage ifTrue:[
+ cls := p receiver receiver name.
+ changeClass := (Smalltalk classNamed:cls) class.
+ cls := cls , ' class'.
+ ] ifFalse:[
+ cls := p receiver name.
+ changeClass := Smalltalk classNamed:cls
+ ].
+ category := (p args at:1) evaluate.
+ ].
+ ].
+ done := false.
+ first := true.
+ [done] whileFalse:[
+ text := aStream nextChunk.
+ text isNil ifTrue:[
+ done := true
+ ] ifFalse:[
+ done := text isEmpty
+ ].
+ done ifFalse:[
+ first ifFalse:[
+ Transcript showCr:'only one method per ''methodsFor:'' handled'.
+ ] ifTrue:[
+ first := false.
+ "
+ try to find the selector
+ "
+ sel := nil.
+ cls notNil ifTrue:[
+ p := Parser
+ parseMethodSpecification:text
+ in:nil
+ ignoreErrors:true
+ ignoreWarnings:true.
+ (p notNil and:[p ~~ #Error]) ifTrue:[
+ sel := p selector.
+ ]
+ ].
- sel isNil ifTrue:[
- changeString := (chunkText contractTo:maxLen).
- changeType := '(change)'.
- ] ifFalse:[
- changeString := self contractClass:cls selector:sel to:maxLen.
- changeType := '(method in: ''' , category , ''')'.
- ].
- sel isNil ifTrue:[
- headerLine := chunkText , ' (change)'.
- ] ifFalse:[
- headerLine := cls , ' ' , sel , ' ' , '(change category: ''' , category , ''')'.
- ].
+ sel isNil ifTrue:[
+ changeString := (chunkText contractTo:maxLen).
+ changeType := '(change)'.
+ ] ifFalse:[
+ changeString := self contractClass:cls selector:sel to:maxLen.
+ changeType := '(method in: ''' , category , ''')'.
+ ].
+ sel isNil ifTrue:[
+ headerLine := chunkText , ' (change)'.
+ ] ifFalse:[
+ headerLine := cls , ' ' , sel , ' ' , '(change category: ''' , category , ''')'.
+ ].
- compareChanges ifTrue:[
- (changeClass isNil or:[changeClass isLoaded not]) ifTrue:[
- changeDelta := '?'
- ] ifFalse:[
- (changeClass implements:sel asSymbol) ifFalse:[
- changeDelta := '+'.
- ] ifTrue:[
- |m currentText t1 t2|
+ compareChanges ifTrue:[
+ (changeClass isNil or:[changeClass isLoaded not]) ifTrue:[
+ changeDelta := '?'
+ ] ifFalse:[
+ (changeClass implements:sel asSymbol) ifFalse:[
+ changeDelta := '+'.
+ ] ifTrue:[
+ |m currentText t1 t2|
- m := changeClass compiledMethodAt:sel asSymbol.
- currentText := m source.
- currentText notNil ifTrue:[
- text asString = currentText asString ifTrue:[
- changeDelta := '='
- ] ifFalse:[
- t1 := currentText asCollectionOfLines collect:[:s | s withTabsExpanded].
- t2 := text asCollectionOfLines collect:[:s | s withTabsExpanded].
- t1 = t2 ifTrue:[
- changeDelta := '='
- ]
- ]
- ]
- ]
- ]
- ]
- ]
- ]
- ]
- ].
- changeString notNil ifTrue:[
- entry := MultiColListEntry new.
- entry tabulatorSpecification:tabSpec.
- entry colAt:1 put:changeDelta.
- entry colAt:2 put:changeString.
- entry colAt:3 put:changeType.
- entry colAt:4 put:timeStampInfo.
- changeHeaderLines add:entry
- ] ifFalse:[
- headerLine notNil ifTrue:[
- changeHeaderLines add:headerLine
- ]
- ]
- ]
- ]
- ].
- changeClassNames := OrderedCollection new grow:(changeChunks size).
- aStream close.
- anyChanges := false
- ] valueNowOrOnUnwindDo:[
- inBackground ifTrue:[myProcess priority:myPriority].
- ].
+ m := changeClass compiledMethodAt:sel asSymbol.
+ currentText := m source.
+ currentText notNil ifTrue:[
+ text asString = currentText asString ifTrue:[
+ changeDelta := '='
+ ] ifFalse:[
+ t1 := currentText asCollectionOfLines collect:[:s | s withTabsExpanded].
+ t2 := text asCollectionOfLines collect:[:s | s withTabsExpanded].
+ t1 = t2 ifTrue:[
+ changeDelta := '='
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ].
+ changeString notNil ifTrue:[
+ entry := MultiColListEntry new.
+ entry tabulatorSpecification:tabSpec.
+ entry colAt:1 put:changeDelta.
+ entry colAt:2 put:changeString.
+ entry colAt:3 put:changeType.
+ entry colAt:4 put:timeStampInfo.
+ changeHeaderLines add:entry
+ ] ifFalse:[
+ headerLine notNil ifTrue:[
+ changeHeaderLines add:headerLine
+ ]
+ ]
+ ]
+ ]
+ ].
+ changeClassNames := OrderedCollection new grow:(changeChunks size).
+ aStream close.
+ anyChanges := false
+ ] valueNowOrOnUnwindDo:[
+ inBackground ifTrue:[myProcess priority:myPriority].
+ ].
].
self checkIfFileHasChanged
@@ -1415,7 +1415,7 @@
className := self classNameOfChange:changeNr.
className notNil ifTrue:[
(cls := Smalltalk classNamed:className) notNil ifTrue:[
- SystemBrowser browseClass:cls
+ SystemBrowser openInClass:cls selector:nil
]
]
]
@@ -1850,4 +1850,4 @@
!ChangesBrowser class methodsFor:'documentation'!
version
-^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.51 1995-11-24 13:32:50 cg Exp $'! !
+^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.52 1995-11-24 18:27:30 cg Exp $'! !