'From Squeak3.5 of ''11 April 2003'' [latest update: #5180] on 11 May 2003 at 9:46:43 am'! "Change Set: ChangeSet-Revision-Tag-sbw Date: 20 April 2003 Author: Stephan B. Wessels SM Name: ChangeSet Revision Tag Provides an automatic mechanism for creating version history in a change-set preamble and a consequent mechanism allowing for queries on a change set for a latest revision level tag. Also can create a preflight check for a change set to better support prerequisite loading. See ChangeSorter class>>generatePreflightCheckExample. Adds a new field to the change set preamble: SM Name (Squeak Map Name). Date Update ------------- ----------------------------------------------------------------------- 11-may-2003 Added missing method. 7-may-2003 Error in Squeak Map Name for change set. Fixed condition where revision tag was not found in prerequisite change set. Minor protocol changes. Added imporer support as a prerequisite. Fixed a problem with a class definition collision with anotehr change set (CommonCodeRepository-sbw). 20-apr-2003 Initial release. " | prereqSMName continue cs prereqCSName prereqRevDateRqd | prereqCSName _ 'importer-support'. prereqSMName _ 'Skins Importer Support'. prereqRevDateRqd _ '12-apr-2003' asDate. continue _ (ChangeSorter respondsTo: #assurePrerequisiteChangeSetNamed:withSqueakMapName:revisionDate:) ifTrue: [ChangeSorter assurePrerequisiteChangeSetNamed: prereqCSName withSqueakMapName: prereqSMName revisionDate: prereqRevDateRqd] ifFalse: [cs _ ChangeSorter changeSetNamed: prereqCSName. cs isNil ifTrue: [(Object confirm: 'The package "' , prereqSMName , '" is not installed in your image. Do you want me to install it for you?. Please note that "' , prereqSMName , '" is required for the package you are about to install.') and: []. (Smalltalk at: #SMSqueakMap ifAbsent: []) ifNil: [Object error: 'You don''t have installed Squeakmap in your image']. Utilities informUser: 'Installing "' , prereqSMName , '"...' during: [(Smalltalk at: #SMSqueakMap) default installPackageNamed: prereqSMName]. true] ifFalse: [true]]. continue ifFalse: [Object error: 'Unable to load prerequisite package.'].! !ChangeSet methodsFor: 'accessing' stamp: 'sbw 4/25/2003 11:57'! author | author | self assurePreambleExists. author _ self preambleString lineNumber: 3. ^author size > 8 ifTrue: [ author _ author copyFrom: 8 to: author size. "Strip the 'Author:' prefix. Ugly ugly." author withBlanksTrimmed] ifFalse: ['']! ! !ChangeSet methodsFor: 'accessing' stamp: 'sbw 4/19/2003 20:36'! hasChanges ^self changedClasses size > 0! ! !ChangeSet methodsFor: 'accessing' stamp: 'sbw 4/25/2003 12:13'! printOn: aStream "2/7/96 sw: provide the receiver's name in the printout" | tag | super printOn: aStream. aStream nextPutAll: ' named ' , self name; cr; nextPutAll: ' has changes: ' , self hasChanges printString; cr; nextPutAll: ' has preamble: ' , self hasPreamble printString; cr; nextPutAll: ' has postcript: ' , self hasPostscript printString; cr. self hasPreamble ifTrue: [aStream nextPutAll: ' author: ' , self author; cr; nextPutAll: ' created: ' , self creationDateTag; cr. tag _ self latestRevisionTag. tag isNil ifTrue: [tag _ 'undefined']. aStream nextPutAll: ' revision: ' , tag; cr. tag _ self squeakMapNameTag. tag isNil ifTrue: [tag _ 'undefined']. aStream nextPutAll: ' squeak map name: ' , tag; cr]! ! !ChangeSet methodsFor: 'fileIn/Out' stamp: 'sbw 4/20/2003 07:14'! preambleTemplate "Answer a string that will form the default contents for a change set's preamble. Just a first stab at what the content should be." "Smalltalk changes preambleTemplate" ^ String streamContents: [:strm | strm nextPutAll: '"Change Set:'. "NOTE: fileIn recognizes preambles by this string." strm tab; tab; nextPutAll: self name. strm cr; nextPutAll: 'Date:'; tab; tab; tab; nextPutAll: Date today printString. strm cr; nextPutAll: 'Author:'; tab; tab; tab; nextPutAll: Preferences defaultAuthorName. strm cr; cr; nextPutAll: ''. strm cr; cr; nextPutAll: self class revisionsTag. strm cr; nextPutAll: (Date today printFormat: #(1 2 3 $- 2 1 2)). strm tab; nextPutAll: 'Initial change set creation.'. strm cr; nextPut: $". ]! ! !ChangeSet methodsFor: 'preamble revisions management' stamp: 'sbw 4/20/2003 11:20'! creationDate ^Date fromString: self creationDateTag! ! !ChangeSet methodsFor: 'preamble revisions management' stamp: 'sbw 4/20/2003 08:02'! creationDateTag "Answers the creation date tag in change set preamble." | dtString fullStr | self assurePreambleExists. dtString _ 'Date: '. fullStr _ self preambleString lineNumber: 2. ^(fullStr copyFrom: dtString size + 1 to: (fullStr size))! ! !ChangeSet methodsFor: 'preamble revisions management' stamp: 'sbw 4/27/2003 17:13'! hasLatestRevisionTag self hasPreamble ifTrue: [^self latestRevisionTag isNil not]. ^false! ! !ChangeSet methodsFor: 'preamble revisions management' stamp: 'sbw 4/26/2003 01:55'! hasPrerequisites ^self prerequisites isEmpty not! ! !ChangeSet methodsFor: 'preamble revisions management' stamp: 'sbw 4/25/2003 04:42'! hasSqueakMapNameTagEntry ^self squeakMapNameTag notNil! ! !ChangeSet methodsFor: 'preamble revisions management' stamp: 'sbw 5/7/2003 23:26'! latestRevisionDate | string | string _ self latestRevisionTag. ^ string isNil ifTrue: [Date today] ifFalse: [Date fromString: string]! ! !ChangeSet methodsFor: 'preamble revisions management' stamp: 'sbw 4/20/2003 07:29'! latestRevisionTag "Search for revisions tag in change set preamble. If found, answer the first date string entry." | rawLines count searching line dateTagLines found | self assurePreambleExists. dateTagLines _ (ReadStream on: self class revisionsTag) asLines. rawLines _ (ReadStream on: self preambleString) asLines. count _ 1. searching _ true. [count < rawLines size and: [searching]] whileTrue: [line _ rawLines at: count. found _ line beginsWith: dateTagLines second. found ifTrue: [found _ (rawLines at: (count - 1)) beginsWith: dateTagLines first]. searching _ found not. count _ count + 1]. searching ifFalse: [count < rawLines size ifTrue: [ line _ (rawLines at: count) withBlanksTrimmed. ^line substrings first ]]. ^ nil! ! !ChangeSet methodsFor: 'preamble revisions management' stamp: 'sbw 4/27/2003 17:17'! nameWithSqueakMapName | stream | stream _ WriteStream on: ''. stream nextPutAll: name. self hasSqueakMapNameTagEntry ifTrue: [stream nextPutAll: ' [SM: ' , self squeakMapNameTag. self hasLatestRevisionTag ifTrue: [stream nextPutAll: ' V: ' , self latestRevisionTag]. stream nextPut: $]]. ^ stream contents! ! !ChangeSet methodsFor: 'preamble revisions management' stamp: 'sbw 4/26/2003 02:05'! prerequisites "Search for preflightPrerequisiteDefinitionLinePrefix tag in change set preamble. For all lines found collect the arguments and answer the collection. " | result rawLines value | result _ OrderedCollection new. self hasPreamble ifTrue: [rawLines _ (ReadStream on: self preambleString) asLines. rawLines do: [:eachLine | (eachLine beginsWith: ChangeSorter preflightPrerequisiteDefinitionLinePrefix) ifTrue: [ value _ (eachLine withBlanksTrimmed findTokens: $') at: 2. result add: value]]]. ^ result! ! !ChangeSet methodsFor: 'preamble revisions management' stamp: 'sbw 4/25/2003 04:30'! squeakMapNameTag "Answers the Squeak Map name tag in change set preamble if specified." | smNameString posn crPosn nameTag thePreambleString | self assurePreambleExists. smNameString _ self class smNameHeaderTag. thePreambleString _ self preambleString. posn _ thePreambleString indexOfSubCollection: smNameString startingAt: 1 ifAbsent: [^ nil]. crPosn _ thePreambleString findString: (String with: Character cr) startingAt: posn. nameTag _ (thePreambleString copyFrom: posn + smNameString size to: crPosn - 1) withBlanksTrimmed. ^ nameTag! ]style[(16 2 70 3 33 22 4 24 12 3 4 67 4 47 12 17 1 18 3 4 6 38 6 7 9 21 4 3 7 32 4 3 12 10 6 3 1 24 7)f1b,f1,f1c152050000i,f1,f1cblue;i,f1,f1cmagenta;,f1,f1cblue;i,f1,f1cmagenta;,f1,f1cblue;i,f1,f1cblue;i,f1,f1c000126055,f1,f1cmagenta;,f1,f1cblue;i,f1,f1cmagenta;,f1,f1cmagenta;,f1,f1cblue;i,f1,f1cblue;i,f1,f1cblue;i,f1,f1cblue;i,f1,f1cblue;i,f1,f1c000126055,f1,f1cblue;i! ! !ChangeSet methodsFor: 'preamble revisions management' stamp: 'sbw 4/25/2003 04:42'! squeakMapNameTag: aString "Add Squeak Map name tag in change set preamble if specified. Replace if already there." | smNameString exists stream count | self assurePreambleExists. smNameString _ self class smNameHeaderTag. exists _ self hasSqueakMapNameTagEntry. stream _ ReadWriteStream on: ''. count _ 0. self preambleString linesDo: [:line | count _ count + 1. exists ifTrue: [(line beginsWith: smNameString) ifTrue: [stream nextPutAll: smNameString; tab; tab; nextPutAll: aString; cr] ifFalse: [line isEmpty ifFalse: [stream nextPutAll: line]. stream cr]] ifFalse: [count = 4 ifTrue: [stream nextPutAll: smNameString; tab; tab; nextPutAll: aString; cr]. line isEmpty ifFalse: [stream nextPutAll: line]. stream cr]]. self preambleString: stream contents! ! !ChangeSet class methodsFor: 'defaults' stamp: 'sbw 4/20/2003 07:15'! revisionsTag ^ 'Date Update ------------- -----------------------------------------------------------------------'! ! !ChangeSet class methodsFor: 'defaults' stamp: 'sbw 4/25/2003 04:32'! smNameHeaderTag ^ 'SM Name:'! ! !ChangeSorter methodsFor: 'changeSet menu' stamp: 'sbw 4/25/2003 04:49'! addSqueakMapName | newString | self okToChange ifTrue: [ newString _ FillInTheBlank request: 'SqueakMap name for this change set?'. newString isEmpty ifFalse: [myChangeSet squeakMapNameTag: newString. currentClassName _ nil. currentSelector _ nil. self showChangeSet: myChangeSet]]! ! !ChangeSorter methodsFor: 'changeSet menu' stamp: 'sbw 4/27/2003 10:27'! allChangeSetsWithSameAuthor ^self class allChangeSetsWithSameAuthorAsIn: myChangeSet! ! !ChangeSorter methodsFor: 'changeSet menu' stamp: 'sbw 4/25/2003 04:43'! hasSqueakMapNameTagEntry ^myChangeSet hasSqueakMapNameTagEntry! ! !ChangeSorter methodsFor: 'changeSet menu' stamp: 'sbw 4/26/2003 02:31'! inspectAllChangeSetsWithSameAuthor self allChangeSetsWithSameAuthor inspect! ! !ChangeSorter methodsFor: 'changeSet menu' stamp: 'sbw 4/26/2003 02:34'! shiftedChangeSetMenu: aMenu "Set up aMenu to hold items relating to the change-set-list pane when the shift key is down" Smalltalk isMorphic ifTrue: [aMenu title: 'Change set (shifted)'. aMenu addStayUpItemSpecial]. "CONFLICTS SECTION" aMenu add: 'conflicts with other change sets' action: #browseMethodConflicts. aMenu balloonTextForLastItem: 'Browse all methods that occur both in this change set and in at least one other change set.'. parent ifNotNil: [aMenu add: 'conflicts with change set opposite' action: #methodConflictsWithOtherSide. aMenu balloonTextForLastItem: 'Browse all methods that occur both in this change set and in the one on the opposite side of the change sorter.'. aMenu add: 'conflicts with category opposite' action: #methodConflictsWithOppositeCategory. aMenu balloonTextForLastItem: 'Browse all methods that occur both in this change set and in ANY change set in the category list on the opposite side of this change sorter, other of course than this change set itself. (Caution -- this could be VERY slow)']. aMenu addLine. "CHECKS SECTION" aMenu add: 'check for slips' action: #lookForSlips. aMenu balloonTextForLastItem: 'Check this change set for halts and references to Transcript.'. aMenu add: 'check for unsent messages' action: #checkForUnsentMessages. aMenu balloonTextForLastItem: 'Check this change set for messages that are not sent anywhere in the system'. aMenu add: 'check for uncommented methods' action: #checkForUncommentedMethods. aMenu balloonTextForLastItem: 'Check this change set for methods that do not have comments'. aMenu add: 'check for uncommented classes' action: #checkForUncommentedClasses. aMenu balloonTextForLastItem: 'Check for classes with code in this changeset which lack class comments'. Utilities authorInitialsPerSe isEmptyOrNil ifFalse: [aMenu add: 'check for other authors' action: #checkForAlienAuthorship. aMenu balloonTextForLastItem: 'Check this change set for methods whose current authoring stamp does not start with "' , Utilities authorInitials , '"'. aMenu add: 'check for any other authors' action: #checkForAnyAlienAuthorship. aMenu balloonTextForLastItem: 'Check this change set for methods any of whose authoring stamps do not start with "' , Utilities authorInitials , '"']. aMenu add: 'check for uncategorized methods' action: #checkForUnclassifiedMethods. aMenu balloonTextForLastItem: 'Check to see if any methods in the selected change set have not yet been assigned to a category. If any are found, open a browser on them.'. aMenu addLine. aMenu add: 'inspect change set' action: #inspectChangeSet. aMenu balloonTextForLastItem: 'Open an inspector on this change set. (There are some details in a change set which you don''t see in a change sorter.)'. aMenu add: 'inspect all change sets with same author' action: #inspectAllChangeSetsWithSameAuthor. aMenu balloonTextForLastItem: 'Open an inspector on all change sets having the same author entered in the preamble. If no preamble nor author then ignored.'. myChangeSet hasPrerequisites ifTrue: [aMenu add: 'show prerequisite change sets' action: #showPrerequisites. aMenu balloonTextForLastItem: 'Open a report on all prerequisites of the selected change set.']. aMenu add: 'show prerequisite report for all with same author' action: #showPrerequisitesForAllChangeSetsWithSameAuthor. aMenu balloonTextForLastItem: 'Open a report on all prerequisites of all change sets by same author.'. aMenu add: 'update' action: #update. aMenu balloonTextForLastItem: 'Update the display for this change set. (This is done automatically when you activate this window, so is seldom needed.)'. aMenu add: 'go to change set''s project' action: #goToChangeSetsProject. aMenu balloonTextForLastItem: 'If this change set is currently associated with a Project, go to that project right now.'. aMenu add: 'promote to top of list' action: #promoteToTopChangeSet. aMenu balloonTextForLastItem: 'Make this change set appear first in change-set lists in all change sorters.'. aMenu add: 'trim history' action: #trimHistory. aMenu balloonTextForLastItem: ' Drops any methods added and then removed, as well as renaming and reorganization of newly-added classes. NOTE: can cause confusion if later filed in over an earlier version of these changes'. aMenu add: 'clear this change set' action: #clearChangeSet. aMenu balloonTextForLastItem: 'Reset this change set to a pristine state where it holds no information. CAUTION: this is destructive and irreversible!!'. aMenu add: 'expunge uniclasses' action: #expungeUniclasses. aMenu balloonTextForLastItem: 'Remove from the change set all memory of uniclasses, e.g. classes added on behalf of etoys, fabrik, etc., whose classnames end with a digit.'. aMenu add: 'uninstall this change set' action: #uninstallChangeSet. aMenu balloonTextForLastItem: 'Attempt to uninstall this change set. CAUTION: this may not work completely and is irreversible!!'. aMenu addLine. aMenu add: 'file into new...' action: #fileIntoNewChangeSet. aMenu balloonTextForLastItem: 'Load a fileout from disk and place its changes into a new change set (seldom needed -- much better to do this from a file-list browser these days.)'. aMenu add: 'reorder all change sets' action: #reorderChangeSets. aMenu balloonTextForLastItem: 'Applies a standard reordering of all change-sets in the system -- at the bottom will come the sets that come with the release; next will come all the numbered updates; finally, at the top, will come all other change sets'. aMenu addLine. aMenu add: 'more...' action: #offerUnshiftedChangeSetMenu. aMenu balloonTextForLastItem: 'Takes you back to the primary change-set menu.'. ^ aMenu! ! !ChangeSorter methodsFor: 'changeSet menu' stamp: 'sbw 4/27/2003 17:33'! showPrerequisites | coll stream set | coll _ myChangeSet prerequisites. coll isEmpty ifTrue: [self inform: 'There are no prerequisite change sets defined.'] ifFalse: [stream _ WriteStream on: ''. set _ Set new. set add: myChangeSet name. self class showPrerequisitesFor: myChangeSet set: set stream: stream indentLevel: 0. stream contents openInWorkspaceWithTitle: 'Prerequisites for "' , myChangeSet name , '"']! ! !ChangeSorter methodsFor: 'changeSet menu' stamp: 'sbw 4/27/2003 17:33'! showPrerequisitesForAllChangeSetsWithSameAuthor ^self class showPrerequisitesForAllChangeSetsWithSameAuthorAsIn: myChangeSet! ! !ChangeSorter methodsFor: '*commonCodeRepository-changeSet menu' stamp: 'sbw 5/7/2003 23:51'! changeSetMenu: aMenu shifted: isShifted "Set up aMenu to hold commands for the change-set-list pane. This could be for a single or double changeSorter" isShifted ifTrue: [^ self shiftedChangeSetMenu: aMenu]. Smalltalk isMorphic ifTrue: [aMenu title: 'Change Set'. aMenu addStayUpItemSpecial] ifFalse: [aMenu title: 'Change Set: ' , myChangeSet name]. aMenu add: 'make changes go to me (m)' action: #newCurrent. aMenu addLine. aMenu add: 'new change set... (n)' action: #newSet. aMenu add: 'find...(f)' action: #findCngSet. aMenu add: 'show category... (s)' action: #chooseChangeSetCategory. aMenu balloonTextForLastItem: 'Lets you choose which change sets should be listed in this change sorter'. aMenu add: 'select change set...' action: #chooseCngSet. aMenu addLine. aMenu add: 'rename change set (r)' action: #rename. aMenu add: 'file out (o)' action: #fileOut. aMenu add: 'mail to list' action: #mailOut. (Smalltalk includesKey: #ChangeSetDirectory) ifTrue: [ aMenu add: 'change repository from "' , (Smalltalk at: #ChangeSetDirectory) default localName , '"' action: #changeRepositoryLocation]. aMenu add: 'browse methods (b)' action: #browseChangeSet. aMenu add: 'browse change set (B)' action: #openChangeSetBrowser. aMenu addLine. parent ifNotNil: [aMenu add: 'copy all to other side (c)' action: #copyAllToOther. aMenu add: 'submerge into other side' action: #submergeIntoOtherSide. aMenu add: 'subtract other side (-)' action: #subtractOtherSide. aMenu addLine]. myChangeSet hasPreamble ifTrue: [aMenu add: 'edit preamble (p)' action: #addPreamble. aMenu add: 'remove preamble' action: #removePreamble. (ChangeSorter canUnderstand: #hasSqueakMapNameTagEntry) ifTrue: [((self perform: #hasSqueakMapNameTagEntry) not and: [self okToChange]) ifTrue: [aMenu add: 'add SqueakMap name entry to preamble...' action: #addSqueakMapName]]] ifFalse: [aMenu add: 'add preamble (p)' action: #addPreamble]. myChangeSet hasPostscript ifTrue: [aMenu add: 'edit postscript...' action: #editPostscript. aMenu add: 'remove postscript' action: #removePostscript] ifFalse: [aMenu add: 'add postscript...' action: #editPostscript]. aMenu addLine. aMenu add: 'category functions...' action: #offerCategorySubmenu. aMenu balloonTextForLastItem: 'Various commands relating to change-set-categories'. aMenu addLine. aMenu add: 'destroy change set (x)' action: #remove. aMenu addLine. aMenu add: 'more...' action: #offerShiftedChangeSetMenu. ^ aMenu! ! !ChangeSetBrowser methodsFor: 'menu' stamp: 'sbw 4/26/2003 02:34'! shiftedChangeSetMenu: aMenu "Set up aMenu to hold items relating to the change-set-list pane when the shift key is down" Smalltalk isMorphic ifTrue: [aMenu title: 'Change set (shifted)'. aMenu addStayUpItemSpecial]. aMenu add: 'conflicts with other change sets' action: #browseMethodConflicts. aMenu balloonTextForLastItem: 'Browse all methods that occur both in this change set and in at least one other change set.'. aMenu addLine. aMenu add: 'check for slips' action: #lookForSlips. aMenu balloonTextForLastItem: 'Check this change set for halts and references to Transcript.'. aMenu add: 'check for unsent messages' action: #checkForUnsentMessages. aMenu balloonTextForLastItem: 'Check this change set for messages that are not sent anywhere in the system'. aMenu add: 'check for uncommented methods' action: #checkForUncommentedMethods. aMenu balloonTextForLastItem: 'Check this change set for methods that do not have comments'. aMenu add: 'check for uncommented classes' action: #checkForUncommentedClasses. aMenu balloonTextForLastItem: 'Check for classes with code in this changeset which lack class comments'. Utilities authorInitialsPerSe isEmptyOrNil ifFalse: [aMenu add: 'check for other authors' action: #checkForAlienAuthorship. aMenu balloonTextForLastItem: 'Check this change set for methods whose current authoring stamp does not start with "' , Utilities authorInitials , '"'. aMenu add: 'check for any other authors' action: #checkForAnyAlienAuthorship. aMenu balloonTextForLastItem: 'Check this change set for methods any of whose previous authoring stamps do not start with "' , Utilities authorInitials , '"']. aMenu add: 'check for uncategorized methods' action: #checkForUnclassifiedMethods. aMenu balloonTextForLastItem: 'Check to see if any methods in the selected change set have not yet been assigned to a category. If any are found, open a browser on them.'. aMenu addLine. aMenu add: 'inspect change set' action: #inspectChangeSet. aMenu balloonTextForLastItem: 'Open an inspector on this change set. (There are some details in a change set which you don''t see in a change sorter.)'. aMenu add: 'inspect all change sets with same author' action: #inspectAllChangeSetsWithSameAuthor. aMenu balloonTextForLastItem: 'Open an inspector on all change sets having the same author entered in the preamble. If no preamble nor author then ignored.'. myChangeSet hasPrerequisites ifTrue: [aMenu add: 'show prerequisite change sets' action: #showPrerequisites. aMenu balloonTextForLastItem: 'Open a report on all prerequisites of the selected change set.']. aMenu add: 'show prerequisite report for all with same author' action: #showPrerequisitesForAllChangeSetsWithSameAuthor. aMenu balloonTextForLastItem: 'Open a report on all prerequisites of all change sets by same author.'. aMenu add: 'update' action: #update. aMenu balloonTextForLastItem: 'Update the display for this change set. (This is done automatically when you activate this window, so is seldom needed.)'. aMenu add: 'go to change set''s project' action: #goToChangeSetsProject. aMenu balloonTextForLastItem: 'If this change set is currently associated with a Project, go to that project right now.'. aMenu add: 'trim history' action: #trimHistory. aMenu balloonTextForLastItem: ' Drops any methods added and then removed, as well as renaming and reorganization of newly-added classes. NOTE: can cause confusion if later filed in over an earlier version of these changes'. aMenu add: 'clear this change set' action: #clearChangeSet. aMenu balloonTextForLastItem: 'Reset this change set to a pristine state where it holds no information. CAUTION: this is destructive and irreversible!!'. aMenu add: 'expunge uniclasses' action: #expungeUniclasses. aMenu balloonTextForLastItem: 'Remove from the change set all memory of uniclasses, e.g. classes added on behalf of etoys, fabrik, etc., whose classnames end with a digit.'. aMenu add: 'uninstall this change set' action: #uninstallChangeSet. aMenu balloonTextForLastItem: 'Attempt to uninstall this change set. CAUTION: this may not work completely and is irreversible!!'. aMenu addLine. aMenu add: 'more...' action: #offerUnshiftedChangeSetMenu. aMenu balloonTextForLastItem: 'Takes you back to the primary change-set menu.'. ^ aMenu! ! !ChangeSorter class methodsFor: 'enumerating' stamp: 'sbw 4/27/2003 10:27'! allChangeSetsWithSameAuthorAsIn: aChangeSet | selectedAuthor coll | aChangeSet hasPreamble ifTrue: [selectedAuthor _ aChangeSet author. selectedAuthor isEmpty ifFalse: [coll _ ChangeSorter allChangeSets select: [:cs | cs hasPreamble and: [cs author includesSubString: selectedAuthor]]. ^ coll]]. ^ Array new! ! !ChangeSorter class methodsFor: 'enumerating' stamp: 'sbw 4/27/2003 17:32'! showPrerequisitesFor: aChangeSet set: set stream: stream indentLevel: level | cs | level timesRepeat: [stream nextPut: $ ]. stream nextPutAll: aChangeSet nameWithSqueakMapName; cr. (aChangeSet prerequisites asSortedCollection: [:a :b | a asLowercase < b asLowercase]) do: [:prereqName | (set includes: prereqName) ifFalse: [set add: prereqName. cs _ ChangeSorter changeSetNamed: prereqName. self showPrerequisitesFor: cs set: set stream: stream indentLevel: level + 2]]! ! !ChangeSorter class methodsFor: 'enumerating' stamp: 'sbw 4/27/2003 17:32'! showPrerequisitesForAllChangeSetsWithSameAuthorAsIn: aChangeSet | coll stream set | coll _ self allChangeSetsWithSameAuthorAsIn: aChangeSet. coll isEmpty ifTrue: [^ self inform: 'No Change Sets found.']. stream _ WriteStream on: ''. (coll asSortedCollection: [:a :b | a name asLowercase < b name asLowercase]) do: [:cs | set _ Set new. set add: cs name. self showPrerequisitesFor: cs set: set stream: stream indentLevel: 0. stream cr]. stream contents openInWorkspaceWithTitle: 'Prerequisites for all change sets by ' , aChangeSet author! ! !ChangeSorter class methodsFor: 'preflight' stamp: 'sbw 4/20/2003 14:42'! assurePrerequisiteChangeSetNamed: prereqCSName withSqueakMapName: prereqSMName revisionDate: prereqRevDateRqd | cs pass | cs _ ChangeSorter changeSetNamed: prereqCSName. pass _ cs isNil not. pass _ pass and: [cs latestRevisionDate >= prereqRevDateRqd]. pass ifFalse: [^ self confirmAndInstallPrereqisitePackageNamed: prereqSMName]. ^ pass! ! !ChangeSorter class methodsFor: 'preflight' stamp: 'sbw 4/27/2003 18:03'! confirmAndInstallPrereqisitePackageNamed: prereqSMName (Object confirm: 'The package "' , prereqSMName , '" is not installed in your image. Do you want me to install it for you?. Please note that "' , prereqSMName , '" is required for the package you are about to install.') ifFalse: [^ false]. (Smalltalk at: #SMSqueakMap ifAbsent: []) ifNil: [Object error: 'You don''t have SqueakMap installed in your image. Either install SqueakMap or install the missing prerequisite change set "' , prereqSMName , '"']. Utilities informUser: 'Installing "' , prereqSMName , '"...' during: [(Smalltalk at: #SMSqueakMap) default installPackageNamed: prereqSMName]. ^ true! ! !ChangeSorter class methodsFor: 'preflight' stamp: 'sbw 4/27/2003 18:04'! generatePreflightCheckExample "ChangeSorter generatePreflightCheckExample" "Opens up a workspace with a code template you can use for pasting preflight." | stream | stream _ WriteStream on: ''. stream nextPutAll: ' | prereqSMName continue cs prereqCSName prereqRevDateRqd | ' , self preflightPrerequisiteDefinitionLinePrefix , ' ''AppearanceMenuReg-sbw''. prereqSMName _ ''Appearance Menu Registry''. prereqRevDateRqd _ ''10-apr-2003'' asDate. continue _ (ChangeSorter respondsTo: #assurePrerequisiteChangeSetNamed:withSqueakMapName:revisionDate:) ifTrue: [ChangeSorter assurePrerequisiteChangeSetNamed: prereqCSName withSqueakMapName: prereqSMName revisionDate: prereqRevDateRqd] ifFalse: [cs _ ChangeSorter changeSetNamed: prereqCSName. cs isNil ifTrue: [(Object confirm: ''The package "'' , prereqSMName , ''" is not installed in your image. Do you want me to install it for you?. Please note that "'' , prereqSMName , ''" is required for the package you are about to install.'') and: []. (Smalltalk at: #SMSqueakMap ifAbsent: []) ifNil: [Object error: ''You don''''t have SqueakMap installed in your image. Either install SqueakMap or install the missing prerequisite change set.'']. Utilities informUser: ''Installing "'' , prereqSMName , ''"...'' during: [(Smalltalk at: #SMSqueakMap) default installPackageNamed: prereqSMName]. true] ifFalse: [true]]. continue ifFalse: [Object error: ''Unable to load prerequisite package.'']. '. stream contents openInWorkspaceWithTitle: 'Preflight code'! ! !ChangeSorter class methodsFor: 'preflight' stamp: 'sbw 4/26/2003 01:43'! preflightPrerequisiteDefinitionLinePrefix ^' prereqCSName _'! ! ChangeSorter removeSelector: #showPrerequisitesFor:set:stream:indentLevel:! ChangeSorter removeSelector: #showPrerequisitesFull!