--- a/MCRepositoryGroup.st Sun Dec 04 15:44:23 2011 +0100
+++ b/MCRepositoryGroup.st Sun Dec 04 15:44:55 2011 +0100
@@ -31,10 +31,23 @@
!MCRepositoryGroup methodsFor:'as yet unclassified'!
addRepository: aRepository
- ((repositories includes: aRepository) or: [aRepository == MCCacheRepository default])
- ifFalse: [repositories add: aRepository.
- self class default addRepository: aRepository].
- self changed: #repositories
+ ((repositories includes: aRepository) or: [aRepository == MCCacheRepository default])
+ ifFalse: [
+ repositories add: aRepository.
+ self class default addRepository: aRepository.
+ self changed: #repositories
+ ].
+
+ "Modified: / 04-12-2011 / 09:04:24 / cg"
+!
+
+flushRepositories
+ "/ cg: mhmh - what should we do here ?
+ "/ called by UserPreferences >> mvRepositories:
+
+ self initializeRepositoriesFromUserSettings
+
+ "Created: / 01-12-2011 / 20:35:13 / cg"
!
flushRepositories
@@ -54,7 +67,20 @@
!
initialize
- repositories _ OrderedCollection new
+ "/ repositories _ OrderedCollection new
+ self initializeRepositoriesFromUserSettings
+
+ "Modified: / 04-12-2011 / 09:07:23 / cg"
+!
+
+initializeRepositoriesFromUserSettings
+ |litArray reps|
+
+ litArray := UserPreferences current at: #mcRepositories ifAbsent:#().
+ reps := litArray decodeAsLiteralArray.
+ repositories := OrderedCollection withAll:reps.
+
+ "Created: / 04-12-2011 / 09:06:53 / cg"
!
removeRepository: aRepository
@@ -63,12 +89,19 @@
!
repositories
- ^ ((Array with: MCCacheRepository default), repositories) select: [ :ea | ea isValid ]
+ ^ ((OrderedCollection withAll:repositories)
+ addFirst:(MCCacheRepository default);
+ yourself)
+ select: [ :ea | ea isValid ]
+
+ "Modified: / 04-12-2011 / 09:04:42 / cg"
!
repositoriesDo: aBlock
self repositories do: [:ea | [aBlock value: ea] on: Error do: []]
-!
+! !
+
+!MCRepositoryGroup methodsFor:'searching'!
versionWithInfo: aVersionInfo
^self versionWithInfo: aVersionInfo ifNone: [ self error: 'Could not find version ', aVersionInfo name printString,'. Maybe you need to add a repository?' ]
@@ -82,5 +115,5 @@
!MCRepositoryGroup class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/goodies/monticello/MCRepositoryGroup.st,v 1.2 2011-12-01 19:51:13 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/goodies/monticello/MCRepositoryGroup.st,v 1.3 2011-12-04 14:44:55 cg Exp $'
! !