[Pkg] The Trunk: System-ar.273.mcz
commits at source.squeak.org
commits at source.squeak.org
Sun Feb 28 01:32:40 UTC 2010
Andreas Raab uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ar.273.mcz
==================== Summary ====================
Name: System-ar.273
Author: ar
Time: 28 February 2010, 2:30:52.464 am
UUID: c384e912-b8f3-7c4c-bcaf-fb91eaae4637
Ancestors: System-dtl.272
Add cleanUp:except: to provide a list of exclusions from the cleanup actions, e.g.,
"Aggressively clean up but preserve projects and change sets"
Smalltalk cleanUp: true except: {Project. ChangeSet}.
=============== Diff against System-dtl.272 ===============
Item was changed:
----- Method: SystemDictionary>>cleanUp: (in category 'housekeeping') -----
cleanUp: aggressive
"Clean up. When aggressive is true, this will destroy projects, change sets, etc."
"Smalltalk cleanUp: false"
"Smalltalk cleanUp: true"
- | classes |
- aggressive ifTrue:[
- "Give the user a chance to bail"
- (self confirm: 'Aggressive cleanup will destroy projects, change sets and more.
- Are you sure you want to proceed?') ifFalse:[^self].
- ].
+ ^self cleanUp: aggressive except: #()!
- "Find all classes implementing #cleanUp or cleanUp:"
- classes := Smalltalk allClasses select:[:aClass|
- (aClass class includesSelector: #cleanUp)
- or:[aClass class includesSelector: #cleanUp:]
- ].
-
- "Arrange classes in superclass order, superclasses before subclasses.
- This will ensure that specific cleanup (like MethodDictionary compaction)
- will run after generic superclass cleanup (HashedCollection rehashing).
- Otherwise generic superclass cleanup might undo specific one (in this
- case rehashing will undo a good bit of MD compaction)."
- classes := ChangeSet superclassOrder: classes.
-
- "Run the cleanup code"
- classes
- do:[:aClass| aClass cleanUp: aggressive]
- displayingProgress:[:aClass| 'Cleaning up in ', aClass name].!
Item was added:
+ ----- Method: SystemDictionary>>cleanUp:except: (in category 'housekeeping') -----
+ cleanUp: aggressive except: exclusions
+ "Clean up. When aggressive is true, this will destroy projects, change sets, etc.
+ Leave out any classes specifically listed in exclusions."
+
+ "Smalltalk cleanUp: true except: {Project. ChangeSet}"
+
+ | classes |
+ aggressive ifTrue:[
+ "Give the user a chance to bail"
+ (self confirm: 'Aggressive cleanup will destroy projects, change sets and more.
+ Are you sure you want to proceed?') ifFalse:[^self].
+ ].
+
+ "Find all classes implementing #cleanUp or cleanUp:"
+ classes := Smalltalk allClasses select:[:aClass|
+ (aClass class includesSelector: #cleanUp)
+ or:[aClass class includesSelector: #cleanUp:]
+ ].
+
+ "Leave out the classes in the exclusion set"
+ classes := classes reject:[:aClass| exclusions includes: aClass].
+
+ "Arrange classes in superclass order, superclasses before subclasses.
+ This will ensure that specific cleanup (like MethodDictionary compaction)
+ will run after generic superclass cleanup (HashedCollection rehashing).
+ Otherwise generic superclass cleanup might undo specific one (in this
+ case rehashing will undo a good bit of MD compaction)."
+ classes := ChangeSet superclassOrder: classes.
+
+ "Run the cleanup code"
+ classes
+ do:[:aClass| aClass cleanUp: aggressive]
+ displayingProgress:[:aClass| 'Cleaning up in ', aClass name].!
More information about the Packages
mailing list