[squeak-dev] The Trunk: Monticello-bf.508.mcz

commits at source.squeak.org commits at source.squeak.org
Mon May 14 12:22:16 UTC 2012


Bert Freudenberg uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-bf.508.mcz

==================== Summary ====================

Name: Monticello-bf.508
Author: bf
Time: 11 May 2012, 1:53:30.392 pm
UUID: e815ebef-6403-458f-bf9f-755ff3e71491
Ancestors: Monticello-bf.507

- Create a changeset preamble from the commit messages when loading a version

=============== Diff against Monticello-bf.507 ===============

Item was changed:
  Object subclass: #MCPackageLoader
+ 	instanceVariableNames: 'requirements unloadableDefinitions obsoletions additions removals errorDefinitions provisions methodAdditions preamble'
- 	instanceVariableNames: 'requirements unloadableDefinitions obsoletions additions removals errorDefinitions provisions methodAdditions'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'Monticello-Loading'!
  
  !MCPackageLoader commentStamp: 'rej 2/26/2007 07:35' prior: 0!
  A MCPackageLoader is responsible for loading packages.  It gets used by VersionLoader, so it is eventually responsible for loading everything.
  
  Instance Variables
  	additions:		<Definitions>  Definitions that need to be added
  	errorDefinitions:		<Object>
  	obsoletions:		<Object>
  	provisions:		<Object>
  	removals:		<Object>
  	requirements:		<Object>
  	unloadableDefinitions:		<Object>
  	methodAdditions  <MethodAdditions> MethodDefinitions corresponding to the Definitions in "additions" that have been added so far.
  
  additions
  	- xxxxx
  
  errorDefinitions
  	- xxxxx
  
  obsoletions
  	- xxxxx
  
  provisions
  	- xxxxx
  
  removals
  	- xxxxx
  
  requirements
  	- xxxxx
  
  unloadableDefinitions
  	- xxxxx
  !

Item was added:
+ ----- Method: MCPackageLoader>>appendToPreamble: (in category 'public') -----
+ appendToPreamble: aString
+ 	preamble
+ 		ifNil: [preamble := aString]
+ 		ifNotNil: [preamble := preamble, aString].
+ !

Item was changed:
  ----- Method: MCPackageLoader>>basicLoad (in category 'private') -----
  basicLoad
  	"Load the contents of some package. This is the core loading method
  	in Monticello. Be wary about modifying it unless you understand the details
  	and dependencies of the various entities being modified."
  	| pkgName |
  	errorDefinitions := OrderedCollection new.
  	"Obviously this isn't the package name but we don't have anything else
  	to use here. ChangeSet current name will generally work since a CS is 
  	usually installed prior to installation."
  	pkgName := ChangeSet current name.
+ 	preamble ifNotNil: [ChangeSet current preambleString: (self preambleAsCommentNamed: pkgName)].
  
  	[CurrentReadOnlySourceFiles cacheDuring: [[
  	"Pass 1: Load everything but the methods,  which are collected in methodAdditions."
  	additions do: [:ea | 
  		ea isMethodDefinition 
  			ifTrue:[methodAdditions add: ea asMethodAddition]
  			ifFalse:[[ea load]on: Error do: [errorDefinitions add: ea]].
  	] displayingProgress: 'Reshaping ', pkgName.
  
  	"Try again any delayed definitions"
  	self shouldWarnAboutErrors ifTrue: [self warnAboutErrors].
  	errorDefinitions do: [:ea | ea load] 
  		displayingProgress: 'Reloading ', pkgName.
  
  	"Pass 2: We compile new / changed methods"
  	methodAdditions do:[:ea| ea createCompiledMethod] 
  		displayingProgress: 'Compiling ', pkgName.
  
  	'Installing ', pkgName displayProgressFrom: 0 to: 2 during:[:bar|
  		"There is no progress *during* installation since a progress bar update
  		will redraw the world and potentially call methods that we're just trying to install."
  		bar value: 1.
  
  		"Pass 3: Install the new / changed methods
  		(this is a separate pass to allow compiler changes to be loaded)"
  		methodAdditions do:[:ea| ea installMethod].
  
  		"Pass 4: Remove the obsolete methods"
  		removals do:[:ea| ea unload].
  	].
  
  	"Finally, notify observers for the method additions"
  	methodAdditions do: [:each | each notifyObservers] 
  		"the message is fake but actually telling people how much time we spend
  		in the notifications is embarrassing so lie instead"
  		displayingProgress: 'Installing ', pkgName.
  
  	additions do: [:ea | ea postloadOver: (self obsoletionFor: ea)] 
  		displayingProgress: 'Initializing ', pkgName.
  
  	] on: InMidstOfFileinNotification do: [:n | n resume: true]
  	]] ensure: [self flushChangesFile]!

Item was added:
+ ----- Method: MCPackageLoader>>preambleAsCommentNamed: (in category 'private') -----
+ preambleAsCommentNamed: pkgName
+ 	^
+ '"Changeset:	{1}
+ Date:	{2}
+ Author:	(generated by MC)
+ 
+ {3}
+ "' format: {pkgName. Date today. preamble copyReplaceAll: '"' with: ''''''}!

Item was added:
+ ----- Method: MCVersion>>logLoadingOn: (in category 'printing') -----
+ logLoadingOn: aStream
+ 	aStream
+ 		nextPutAll: '========== ', self info name, ' =========='; cr;
+ 		nextPutAll: self info message asString; cr;
+ 		flush.
+ 
+ 	package hasWorkingCopy ifFalse: [^self].
+ 
+ 	package workingCopy ancestors do: [:each |
+ 		(self info hasAncestor: each)
+ 			ifTrue: [(self info allAncestorsOnPathTo: each)
+ 				do: [:ver | aStream cr; nextPutAll: '>>> ', ver name, ' <<<'; cr;
+ 							nextPutAll: ver message; cr; flush]]]!

Item was changed:
  ----- Method: MCVersionLoader>>load (in category 'loading') -----
  load
  	| loader |
  	self checkForModifications.
  	loader := MCPackageLoader new.
  	versions do: [:ea |
+ 		loader appendToPreamble: (String streamContents: [:s | ea logLoadingOn: s]).
  		ea canOptimizeLoading
  			ifTrue: [ea patch applyTo: loader]
  			ifFalse: [loader updatePackage: ea package withSnapshot: ea snapshot]].
  	loader loadWithNameLike: versions first info name.
  	versions do: [:ea | ea workingCopy loaded: ea]!



More information about the Squeak-dev mailing list