[squeak-dev] The Inbox: Monticello-ct.732.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Nov 16 15:00:09 UTC 2020


A new version of Monticello was added to project The Inbox:
http://source.squeak.org/inbox/Monticello-ct.732.mcz

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

Name: Monticello-ct.732
Author: ct
Time: 16 November 2020, 3:59:45.315045 pm
UUID: 49586c09-c5d0-3444-a45c-3ccaf04fcc21
Ancestors: Monticello-mt.730

Fixes a defect in MCPackageLoader when installing a snapshot that contains both an addition and a removal of a code object (e.g. a method). In this case, the addition should be installed but the removal be withdrawn (until today, the definition was first added but then removed again).

While this situation does not occur in everyday Monticello use, it can indeed occur when using a MCVersionLoader to load multiple versions each representing a different packages at once and any method or class definition has a different package affiliation in this set of versions relative to the working copies of the packages.

Concretely, this constellation arises when the effect of loading this set of versions should be expected to move the relevant definition from one package into another one. For the actuating failure, see https://github.com/Metacello/metacello/issues/524#issuecomment-723644601.

Thanks to Tom Beckmann (TB) for the implementation proposal! I have extended it to match class and trait definitions as well. Please review. :-)

=============== Diff against Monticello-mt.730 ===============

Item was added:
+ ----- Method: MCClassDefinition>>isOrganizationMember (in category 'testing') -----
+ isOrganizationMember
+ 
+ 	^ true!

Item was added:
+ ----- Method: MCClassTraitDefinition>>isOrganizationMember (in category 'testing') -----
+ isOrganizationMember
+ 
+ 	^ true!

Item was added:
+ ----- Method: MCDefinition>>isOrganizationMember (in category 'testing') -----
+ isOrganizationMember
+ 
+ 	^ false!

Item was added:
+ ----- Method: MCMethodDefinition>>isOrganizationMember (in category 'testing') -----
+ isOrganizationMember
+ 
+ 	^ true!

Item was changed:
  ----- Method: MCPackageLoader>>forgetSuperfluousMethodRemovals (in category 'private') -----
  forgetSuperfluousMethodRemovals
  	|  removedClasses |
+ 	removedClasses := removals select: #isClassDefinition thenCollect: #actualClass.
- 	removedClasses := (removals select: #isClassDefinition) collect: #actualClass.
  	removedClasses addAll: (removedClasses collect: #class).
+ 	removals := removals reject: [:removal |
+ 		removal isMethodDefinition and: [removedClasses includes: removal actualClass]].
+ 	removals := removals reject: [:removal |
+ 		removal isOrganizationMember and: [
+ 			additions anySatisfy: [:addition |
+ 				addition isOrganizationMember and: [addition description = removal description]]]].!
- 	removals := removals reject: [:e | e isMethodDefinition and: [removedClasses includes: e actualClass]]!



More information about the Squeak-dev mailing list