A new version of Monticello.impl was added to project Monticello Public: http://www.squeaksource.com/mc/Monticello.impl-mtf.647.mcz
==================== Summary ====================
Name: Monticello.impl-mtf.647 Author: mtf Time: 10 August 2009, 8:52:13 am UUID: 5bf7cbb6-f075-46c4-9a72-ae9da5aac6cf Ancestors: Monticello.impl-damiencassou.646
Gave Monticello the ability to automatically fix underscore assignments if they are an issue, and made syntax error handling in general a bit smarter.
Experimental; not yet tested. Only works in MC1.5 (MCPackageLoader1b)
=============== Diff against Monticello.impl-damiencassou.646 ===============
Item was changed: Object subclass: #MCPackageLoader1b + instanceVariableNames: 'requirements unloadableDefinitions obsoletions additions removals errorDefinitions modifiedDefinitions provisions isUnloading isMultiplePackage' - instanceVariableNames: 'requirements unloadableDefinitions obsoletions additions removals errorDefinitions provisions isUnloading isMultiplePackage' classVariableNames: '' poolDictionaries: '' category: 'Monticello-Base-Loading'!
!MCPackageLoader1b commentStamp: 'kph 5/25/2007 04:43' prior: 0! MCPackageLoader1b - Attempt to improve loading with a number of tricks
In #basicLoad the loading process starts with a collection of definitions in #additions, and another in #removals. #analyse should have sorted these so that dependencies shouldnt cause errors.
The load sequence sent to each addidion is: #preLoadOver: [ #install #postinstall ] #postloadOver: The load sequence sent to each removal is [ #unload ]
The brackets above mark the fact that the 'load' itself which is perfromed by #install/#postinstall and #unload are performed in a tight loop and this is our attempt at atomicity.
For methods, #preloadOver:, and #postloadOver: obsoletions are supplied, being the original item being overwritten.
InstVar #defn is the currently loading definition. This allows error handlers to know what was being processed when the error occured.
----- Note that to support loading this Monicello over a version which does not support atomic loading, soe things have to remain in place that are otherwise obsolete.
MCDefinition-#loadOver: MCPackageLoader instVar's errorDefinitions, addtions, removals cant be renamed. !
Item was added: + ----- Method: MCPackageLoader1b>>warnAboutModifications: (in category 'private') ----- + warnAboutModifications: modifications + modifications isEmpty ifFalse: [ self notify: (self modifiedDefinitionWarning: modifications) ] + !
Item was added: + ----- Method: MCPackageLoader1b>>shouldWarnAboutModifications (in category 'private') ----- + shouldWarnAboutModifications + ^ true "should make this a preference"!
Item was changed: ----- Method: MCMethodDefinition>>ensuredCreateCompiledMethod (in category 'compiling') ----- ensuredCreateCompiledMethod "Create the compiled method from my source, or from user-provided source in the event of a syntax error"
+ | newSource | [ self createCompiledMethod ] on: SyntaxErrorNotification do: [ :ex | + "first, see if it's an underscore issue" + newSource := FixUnderscores2 new fixUnderscores: source. + (newSource notNil and: [newSource ~= source]) ifTrue: [ + source := newSource. + self sourceChangedBecause: 'Convert _ to :='. + ex retry]. + + "If not, poppup a syntax error dialog" + ex outer. - "Let the user install the fixed code into the system" - ex defaultAction. "Now fetch and use that code instead" source := theClass sourceCodeAt: self selector ifAbsent: [^ nil]. + self sourceChangedBecause: 'Syntax Error'. + ex retry]! - self createCompiledMethod]!
Item was changed: ----- Method: MCPackageLoader1b>>basicLoad (in category 'private') ----- basicLoad
additions do: [:ea | ea preloadOver: (self obsoletionFor: ea). ] displayingProgress: 'Loading...'. self shouldWarnAboutErrors ifTrue: [ self warnAboutErrors: errorDefinitions ].
(1 to: 2) do: [:ea | ] displayingProgress: (self isUnloading ifFalse: [ 'Installing...' ] ifTrue: [ 'Unloading...' ]). "begin the psuedo atomic bit" removals do: [:ea | ea unload ]. additions do: [:ea | ea install ]. additions do: [:ea | ea postinstall ].
"end the psuedo atomic bit"
additions reverse do: [:ea | ea postloadOver: (self obsoletionFor: ea). self successfullyLoaded: ea.
] displayingProgress: 'Integration...'. + + self shouldWarnAboutModifications ifTrue: [self warnAboutModifications: modifiedDefinitions]. !
Item was added: + ----- Method: MCMethodDefinition>>sourceChangedBecause: (in category 'compiling') ----- + sourceChangedBecause: aString + self because: aString. + ^ (SourceChangedDuringLoad method: self reason: aString) signal!
Item was added: + ----- Method: MCPackageLoader1b>>modifiedDefinitionWarning: (in category 'private') ----- + modifiedDefinitionWarning: modifiedDefns + ^ String streamContents: [:s | + s nextPutAll: 'The following definitions were modified during the load. You should review the changes and save the package. Press Proceed to finish loading'; cr. + modifiedDefns do: [:ea | + s space; space; + nextPutAll: ea summary; + space; + nextPutAll: (ea because ifNil: [ '' ]); cr]] !
Item was changed: ----- Method: MCVersionLoader>>loadWithNameLike: (in category 'loading') ----- loadWithNameLike: aString | loader | self checkForModifications. loader := MCPackageLoader newCurrent. versions size > 1 ifTrue: [ loader beMultiplePackage ]. versions do: [:ea | ea canOptimizeLoading ifTrue: [ea patch applyTo: loader] ifFalse: [loader updatePackage: ea package withSnapshot: ea snapshot ] ]. loader installOrphanage; loadWithNameLike: aString. + versions do: [:ea | ea workingCopy loaded: ea]. + + loader modifiedDefinitions ifNotEmpty: [ + versions do: [:ea | ea workingCopy modified: true]. + "Since the versions were modified directly, they are stale" + MCFileBasedRepository flushAllCaches].! - versions do: [:ea | ea workingCopy loaded: ea]!
Item was added: + ----- Method: MCPackageLoader1b>>modifiedDefinitions (in category 'public') ----- + modifiedDefinitions + "Answer a list of method definitions whose source was modified as part of the load, due to syntax error or other reasons. Only intended to be called after load" + + ^ modifiedDefinitions!
Item was changed: ----- Method: MCPackageLoader1b>>protectedLoad (in category 'private') ----- protectedLoad + errorDefinitions := OrderedCollection new. + modifiedDefinitions := OrderedCollection new. + [[[[self basicLoad] + on: InMidstOfFileinNotification do: [:n | n resume: true]] + ensure: [self flushChangesFile]] + on: MCOrphanedNotification do: [:ex | + additions remove: ex orphan ifAbsent: []. + errorDefinitions add: ex orphan. + ex resume]] + on: SourceChangedDuringLoad do: [:ex | + modifiedDefinitions add: ex method. + ex pass]! - errorDefinitions := OrderedCollection new. - [ - [ - [ self basicLoad ] on: InMidstOfFileinNotification do: [:n | n resume: true] - - ] ensure: [self flushChangesFile]. - - ] on: MCOrphanedNotification do: [ :ex | additions remove: ex orphan ifAbsent: []. - errorDefinitions add: ex orphan. - ex resume. ] - !
packages@lists.squeakfoundation.org