The Trunk: Monticello-ar.364.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Monticello-ar.364.mcz

commits-2
Andreas Raab uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-ar.364.mcz

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

Name: Monticello-ar.364
Author: ar
Time: 13 February 2010, 3:33:06.896 pm
UUID: 874084f3-a9ec-034c-b6d7-e31cb3f74234
Ancestors: Monticello-nice.363

Some fixes for Monticello:
- Deal with nil subclasses properly
- Handle DuplicateVariableError to allow moving variables between subclasses and superclasses when reshaping classes
- Load errorDefinitions right away since any delayed class definitions should be present before methods can be loaded.

=============== Diff against Monticello-nice.363 ===============

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.
 
  [["Pass 1: Load everything but the methods,  which are collected in methodAdditions."
  additions do: [:ea |
+ ea isMethodDefinition
- [ea isMethodDefinition
  ifTrue:[methodAdditions add: ea asMethodAddition]
+ ifFalse:[[ea load]on: Error do: [errorDefinitions add: ea]].
- 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 displayProgressAt: Sensor cursorPoint from: 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].
  ].
 
- "Try again any delayed definitions"
- self shouldWarnAboutErrors ifTrue: [self warnAboutErrors].
- errorDefinitions do: [:ea | ea load]
- displayingProgress: 'Reloading ', pkgName.
-
  "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 changed:
  ----- Method: MCClassDefinition>>requirements (in category 'comparing') -----
  requirements
+ ^superclassName == #nil
+ ifTrue: [self poolDictionaries]
+ ifFalse: [(Array with: superclassName), self poolDictionaries]!
- ^ (Array with: superclassName), self poolDictionaries!

Item was changed:
  ----- Method: MCClassDefinition>>createClass (in category 'installing') -----
  createClass
  | superClass class composition |
+ superClass := superclassName == #nil ifFalse:
+ [Smalltalk at: superclassName].
- superClass := Smalltalk at: superclassName.
  [class := (ClassBuilder new)
  name: name
  inEnvironment: superClass environment
  subclassOf: superClass
  type: type
  instanceVariableNames: self instanceVariablesString
  classVariableNames: self classVariablesString
  poolDictionaries: self sharedPoolsString
+ category: category.
+ ] on: Warning, DuplicateVariableError do:[:ex| ex resume].
- category: category] on: Warning do:[:ex| ex resume].
 
  "The following is written to support traits unloading"
  composition := Compiler evaluate: (self traitComposition ifNil:['{}']).
  (composition isEmpty and:[class traitComposition isEmpty]) ifFalse:[
  class setTraitComposition: composition asTraitComposition.
  ].
 
  composition := Compiler evaluate: (self classTraitComposition ifNil:['{}']).
  (composition isEmpty and:[class class traitComposition isEmpty]) ifFalse:[
  class class setTraitComposition: composition asTraitComposition.
  ].
 
  ^class!