[BUG] change browser 'select methods for this class' broken

Lex Spoon lex at cc.gatech.edu
Wed May 12 08:09:29 UTC 1999


Tim Rowledge <rowledge at interval.com> wrote:
> Whilst trying to advise Ian on his filein problem, I was about to recommend
> using this to select all the methods relating to the 'dodgy' class - but
> it's broken! In 2.3 and 2.4 the result is the same.
> 
> a)ChangeList does not implement #currentChange
> b) nor does it implement #selectSuchThat:
> which make me think it's more than just a small fix that is needed. What is
> the changes browser supposed to be doing these days? Multiple selecting is
> also still broken, which makes a lot of other menu options almost
> meaningless for now.
> 
> tim
> 
> 
> 


Here's a fix.  It also adds "select such that" to the changeset menu; if you don't like that, revert the version on ChangeList>>changeListMenu:.  I've found "select such that" nice for when browsing extremely large change lists--sometimes the provided selection items just don't quite have what you want.  Then again, I personally haven't needed it except once, so maybe it's overkill.

At any rate, here it is.


Lex


'From Squeak 2.4b of April 23, 1999 on 12 May 1999 at 8:00:50 am'!

!ChangeList methodsFor: 'menu actions' stamp: 'ls 5/12/1999 07:57'!
changeListMenu: aMenu

^ aMenu labels:
'fileIn selections
fileOut selections...
compare to current
select conflicts
select conflicts with
select unchanged methods
select methods for this class
select such that
select all
deselect all
remove doIts
remove older versions
remove selections'
	lines: #(2 10)
	selections: #(fileInSelections fileOutSelections
compareToCurrentVersion selectConflicts selectConflictsWith selectUnchangedMethods selectMethodsForThisClass selectSuchThat selectAll deselectAll
removeDoIts removeOlderMethodVersions removeSelections)
! !

!ChangeList methodsFor: 'menu actions' stamp: 'ls 5/12/1999 07:56'!
selectSuchThat
	"query the user for a selection criterion"
	| code block |
	code _ FillInTheBlank request: 'selection criteria for a change named m?\For instance, c category = ''System-Network''' withCRs.

	code isEmpty ifTrue: [ ^self ].

	block _ Compiler evaluate: '[ :c | ', code, ']'.

	self selectSuchThat: block! !

!ChangeList methodsFor: 'menu actions' stamp: 'ls 5/12/1999 07:56'!
selectSuchThat: aBlock
	"select all changes for which block returns true"
	listSelections _ changeList collect: [ :change | aBlock value: change ].
	self changed: #allSelections! !

!ChangeList methodsFor: 'accessing' stamp: 'ls 5/12/1999 07:55'!
currentChange
	"return the current change being viewed, or nil if none"
	listIndex = 0 ifTrue: [ ^nil ].
	^changeList at: listIndex! !





More information about the Squeak-dev mailing list