forked from Metacello/metacello
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
59 additions
and
26 deletions.
There are no files selected for viewing
25 changes: 13 additions & 12 deletions
25
...Core.package/MetacelloProjectRegistration.class/class/copyRegistryRestoreOnErrorWhile..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
mutability | ||
copyRegistryRestoreOnErrorWhile: aBlock | ||
"install copy of registry for duration of <aBlock> execution." | ||
"install copy of registry for duration of <aBlock> execution." | ||
|
||
"registrations will be copied on write during <aBlock> execution." | ||
"registrations will be copied on write during <aBlock> execution." | ||
|
||
"if <aBlock> does not return control to this context, revert to the original | ||
"if <aBlock> does not return control to this context, revert to the original | ||
version of the registry. Otherwise leave the new copy installed." | ||
|
||
| oldRegistry newRegistry | | ||
oldRegistry := self registry. | ||
newRegistry := self registry copy. | ||
self registry: newRegistry. | ||
aBlock | ||
ensure: [ | ||
"install old version of registry" | ||
self registry: oldRegistry ]. | ||
self registry: newRegistry "if control returned, install newRegistry" | ||
| oldRegistry newRegistry | | ||
oldRegistry := self registry. | ||
newRegistry := self registry copy. | ||
self registry: newRegistry. | ||
aBlock | ||
ensure: [ | ||
"install old version of registry" | ||
newRegistry := self registry. "see https://github.com/dalehenrich/metacello-work/issues/210" | ||
self registry: oldRegistry ]. | ||
self registry: newRegistry "if control returned, install newRegistry" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.