Status: FixProposed
Owner:
[hidden email]
Labels: Milestone-1.3
New issue 3838 by
[hidden email]: Cleaning MCPackageLoader
http://code.google.com/p/pharo/issues/detail?id=3838useChangeSetNamed: baseName during: aBlock
"Use the named change set, or create one with the given name."
| changeHolder oldChanges newChanges |
changeHolder := (ChangeSet respondsTo: #newChanges:)
ifTrue: [ChangeSet]
ifFalse: [Smalltalk].
oldChanges := (ChangeSet respondsTo: #current)
ifTrue: [ChangeSet current]
ifFalse: [Smalltalk changes].
newChanges := (ChangeSet named: baseName) ifNil: [ ChangeSet new name:
baseName ].
changeHolder newChanges: newChanges.
[aBlock value] ensure: [changeHolder newChanges: oldChanges].
the respondsTo: are not needed since this is just to make sure that MC code
would work in Squeak 3.6 or before.
useChangeSetNamed: baseName during: aBlock
"Use the named change set, or create one with the given name."
| oldChanges newChanges |
oldChanges :=ChangeSet current.
newChanges := (ChangeSet named: baseName) ifNil: [ ChangeSet new name:
baseName ].
ChangeSet newChanges: newChanges.
[aBlock value] ensure: [ChangeSet newChanges: oldChanges].