MCVersionLoader.st
changeset 221 13eb94990f12
parent 71 9fa88a5d034d
child 332 bf25646689ac
--- a/MCVersionLoader.st	Sat Aug 20 13:44:29 2011 +0200
+++ b/MCVersionLoader.st	Sat Aug 20 13:44:34 2011 +0200
@@ -8,23 +8,25 @@
 !
 
 
+!MCVersionLoader class methodsFor:'initialization'!
+
+new
+    ^self basicNew initialize
+! !
+
 !MCVersionLoader class methodsFor:'as yet unclassified'!
 
 loadVersion: aVersion
 	self new
 		addVersion: aVersion;
 		load
-!
-
-new
-	^ self basicNew initialize
 ! !
 
 !MCVersionLoader methodsFor:'checking'!
 
 checkForModifications
 	| modifications |
-	modifications _ versions select: [:ea | ea package workingCopy modified].
+	modifications := versions select: [:ea | ea package workingCopy modified].
 	modifications isEmpty ifFalse: [self warnAboutLosingChangesTo: modifications].
 !
 
@@ -53,10 +55,11 @@
 			s cr; space; space; nextPutAll: ea package name]])
 ! !
 
-!MCVersionLoader methodsFor:'initialize-release'!
+!MCVersionLoader methodsFor:'initialization'!
 
 initialize
-	versions _ OrderedCollection new
+	super initialize.
+	versions := OrderedCollection new
 ! !
 
 !MCVersionLoader methodsFor:'loading'!
@@ -74,22 +77,42 @@
 addVersion: aVersion
 	aVersion dependencies do: [ :ea | self addDependency: ea].
 	versions add: aVersion.
+
 !
 
 load
-	| loader |
-	self checkForModifications.
-	loader _ MCPackageLoader new.
-	versions do: [:ea |
-		ea canOptimizeLoading
-			ifTrue: [ea patch applyTo: loader]
-			ifFalse: [loader updatePackage: ea package withSnapshot: ea snapshot]].
-	loader loadWithNameLike: versions first info name.
-	versions do: [:ea | ea workingCopy loaded: ea]
+	self loadWithNameLike: versions first info name.
+
+!
+
+loadWithNameLike: aString
+        | loader |
+        self checkForModifications.
+        loader := versions size > 1
+                ifTrue: [MCMultiPackageLoader new]
+                ifFalse: [MCPackageLoader new].
+        versions do: [:ea |
+                ea canOptimizeLoading
+                        ifTrue: [ea patch applyTo: loader]
+                        ifFalse: [loader updatePackage: ea package withSnapshot: ea snapshot]].
+        "/MCStXPackageQuery answer: versions first package name do: [
+            loader loadWithNameLike: aString.
+        "/].
+        versions do: [:ea | ea workingCopy loaded: ea]
+
+    "Modified: / 09-11-2010 / 17:27:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !MCVersionLoader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCVersionLoader.st,v 1.1 2006-11-22 13:13:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCVersionLoader.st,v 1.2 2011-08-20 11:44:34 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCVersionLoader.st,v 1.2 2011-08-20 11:44:34 cg Exp $'
+!
+
+version_SVN
+    ^ '§Id: MCVersionLoader.st 25 2010-11-09 18:50:31Z vranyj1 §'
 ! !