Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
includes fix for Issue Metacello#210
  • Loading branch information
dalehenrich committed Oct 6, 2013
2 parents 1c8c138 + 1d689e0 commit 9d7e7f8
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 26 deletions.
@@ -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"
Expand Up @@ -4,7 +4,7 @@
"baselineProjectSpecs" : "dkh 7/19/2012 11:18",
"configurationClasses" : "dkh 6/13/2012 13:37",
"configurationProjectSpecs" : "dkh 7/19/2012 11:47",
"copyRegistryRestoreOnErrorWhile:" : "dkh 7/20/2012 11:37",
"copyRegistryRestoreOnErrorWhile:" : "dkh 10/06/2013 09:35",
"copyRegistryWhile:" : "dkh 7/20/2012 11:37",
"fromMCBaselineProjectSpec:" : "dkh 6/5/2012 19:01:24",
"fromMCConfigurationProjectSpec:" : "dkh 6/5/2012 19:01:24",
Expand Down
2 changes: 1 addition & 1 deletion repository/Metacello-Core.package/monticello.meta/version

Large diffs are not rendered by default.

Expand Up @@ -5,11 +5,20 @@ testWarningDuringLoad
Transcript
cr;
show: 'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [0]: '.
Transcript
cr;
show:
'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [1] registrations:'.
Metacello registrations
do: [ :registration |
Transcript
cr;
tab;
show: registration printString ].
Metacello new
configuration: 'Issue181';
version: '0.9.1';
repository: 'dictionary://Metacello_Configuration_Test_Repository';
silently;
load.
producedWarning := false.
Smalltalk
Expand All @@ -18,36 +27,59 @@ testWarningDuringLoad
Transcript
cr;
show:
'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [1]: '
'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [2]: '
, cl uniqueInstance silenceLevel printString ].
externalCoreClass := Smalltalk
at: #'ExternalCore'
ifAbsent: [
Transcript
cr;
show: 'Missing class: ExternalCore'.
Transcript
cr;
show:
'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [10] registrations:'.
Metacello registrations
do: [ :registration |
Transcript
cr;
tab;
show: registration printString ].
MCWorkingCopy allManagers
do: [ :wc |
(wc packageName beginsWith: 'External')
ifTrue: [
Transcript
cr;
show:
'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [6]: '
, wc description ] ].
'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [3]: '
, wc description ].
(MetacelloPlatform current packageInfoFor: wc) classes
do: [ :cls |
Transcript
cr;
tab;
show: cls name asString ] ].
self assert: false ].
Transcript
cr;
show: 'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [2]: '.
show:
'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [4] registrations:'.
Metacello registrations
do: [ :registration |
Transcript
cr;
tab;
show: registration printString ].
self deny: (externalCoreClass selectors includes: #'forceWarning').
externalCoreClass compile: 'forceWarning ^self'. "dirty the package"
Transcript
cr;
show: 'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [3]: '.
show: 'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [5]: '.
self assert: (externalCoreClass selectors includes: #'forceWarning').
Transcript
cr;
show: 'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [4]: '.
show: 'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [6]: '.
Metacello new
configuration: 'Issue181';
version: '0.9.3';
Expand All @@ -57,19 +89,19 @@ testWarningDuringLoad
Transcript
cr;
show:
'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [5]: '
'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [7]: '
, ex description.
producedWarning := true.
ex resume ];
load.
Transcript
cr;
show: 'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [6]: '.
show: 'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [8]: '.
self assert: producedWarning ]
on: Error
do: [ :ex |
Transcript
cr;
show:
'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [7]: '
'MetacelloScriptingWarningTestCase>>testWarningDuringLoad [9]: '
, ex description ]
Expand Up @@ -5,4 +5,4 @@
"doSilently" : "dkh 07/24/2013 16:08",
"setUpRepositories" : "dkh 07/24/2013 18:28",
"tearDownPackageList" : "dkh 07/29/2013 20:28",
"testWarningDuringLoad" : "dkh 09/23/2013 20:59" } }
"testWarningDuringLoad" : "dkh 09/24/2013 10:05" } }

Large diffs are not rendered by default.

0 comments on commit 9d7e7f8

Please sign in to comment.