'From Squeak3.3alpha of 18 January 2002 [latest update: #4827] on 18 April 2002 at 11:33:23 pm'! "Change Set: misc-sw Date: 17 April 2002 Author: Scott Wallace 1. Provides a method that allows you to browse all methods stamped with any given initials, based on a CSOD by Gšran Hultgen. 2. Sharpens the wording of the confirmer put up regarding the putative loss of a preamble and/or postscript when a change set is expunged. The message now explicitly tells you which are present (preamble, postscript, or both.) 3. Provides a mechanism for the ChangeSetsInRelease change-set-category to compute its baseline contents on the brink of release time"! CodeHolder subclass: #ChangeSorter instanceVariableNames: 'parent myChangeSet currentClassName currentSelector priorChangeSetList changeSetCategory ' classVariableNames: 'AllChangeSets ChangeSetCategories ChangeSetNamesInRelease PreviousSet RecentUpdateMarker ' module: #(Squeak Development Changes)! !ChangeSorter methodsFor: 'changeSet menu' stamp: 'sw 4/16/2002 00:18'! removePrompting: doPrompt "Completely destroy my change set. Check if it's OK first, and if doPrompt is true, get the user to confirm his intentions first." | message aName changeSetNumber msg | aName _ myChangeSet name. myChangeSet okayToRemove ifFalse: [^ self]. "forms current changes for some project" (myChangeSet isEmpty or: [doPrompt not]) ifFalse: [message _ 'Are you certain that you want to remove (destroy) the change set named "', aName, '" ?'. (self confirm: message) ifFalse: [^ self]]. doPrompt ifTrue: [msg _ myChangeSet hasPreamble ifTrue: [myChangeSet hasPostscript ifTrue: ['a preamble and a postscript'] ifFalse: ['a preamble']] ifFalse: [myChangeSet hasPostscript ifTrue: ['a postscript'] ifFalse: ['']]. msg isEmpty ifFalse: [(self confirm: 'Caution!! This change set has ', msg, ' which will be lost if you destroy the change set. Do you really want to go ahead with this?') ifFalse: [^ self]]]. "Go ahead and remove the change set" changeSetNumber _ myChangeSet name initialIntegerOrNil. changeSetNumber ifNotNil: [SystemVersion current unregisterUpdate: changeSetNumber]. ChangeSorter removeChangeSet: myChangeSet. self showChangeSet: Smalltalk changes.! ! !ChangeSorter class methodsFor: 'class initialization' stamp: 'sw 4/16/2002 00:47'! changeSetNamesInReleaseImage "Answer a list of names of project change sets that come pre-shipped in the latest sytem release. On the brink of shipping a new release, call 'ChangeSorter noteChangeSetsInRelease' " ^ ChangeSetNamesInRelease ifNil: [ChangeSetNamesInRelease _ self changeSetNamesInThreeOh]! ! !ChangeSorter class methodsFor: 'class initialization' stamp: 'sw 4/16/2002 00:45'! changeSetNamesInThreeOh "Hard-coded: answer a list of names of project change sets that came pre-shipped in Squeak 3.0" ^ #('The Worlds of Squeak' 'Fun with Morphic' 'Games' 'Fun With Music' 'Building with Squeak' 'Squeak and the Internet' 'Squeak in 3D' 'More About Sound' ) ! ! !ChangeSorter class methodsFor: 'class initialization' stamp: 'sw 4/16/2002 00:47'! noteChangeSetsInRelease "Freshly compute what the change sets in the release are; to be called manually just before a release" ChangeSetNamesInRelease _ (Project allProjects collect: [:p | p name]) asSet asOrderedCollection. "ChangeSorter noteChangeSetsInRelease"! ! !Utilities class methodsFor: 'identification' stamp: 'sw 4/15/2002 16:23'! methodsWithInitials: targetInitials "Based on a do-it contributed to the Squeak mailing list by Gšran Hultgen: ¥ Browse methods whose initials (in the time-stamp, as logged to disk) match the given initials. ¥ Print out the complete time-stamp table to the Transcript. ¥ Answer a list of (initials -> count) associations. CAUTION: It may take several minutes for this to complete." "Time millisecondsToRun: [Utilities methodsWithInitials: 'bf']" | initials timeStamp allSubmitters | initials _ ''. timeStamp _ ''. allSubmitters _ Bag new. Smalltalk browseAllSelect: [:cm | timeStamp _ Utilities timeStampForMethod: cm. initials _ timeStamp isEmpty ifTrue: [''] ifFalse: [timeStamp substrings first]. initials _ initials isEmpty ifTrue: [''] ifFalse: [initials first isDigit ifTrue: [''] ifFalse: [initials]]. allSubmitters add: initials. (initials = targetInitials)] name: ('Methods with initials ', targetInitials) autoSelect: nil. allSubmitters sortedCounts do: [:elem | Transcript cr; show: elem asString]. ^ allSubmitters ! !