Andreas Raab uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-ar.413.mcz==================== Summary ====================
Name: Monticello-ar.413
Author: ar
Time: 15 December 2010, 10:58:49.876 pm
UUID: 7f808633-2e37-2b40-9e58-6c3ec2b52492
Ancestors: Monticello-bp.412
Add an API for #allVersionNames and #versionNamed:ifAbsent: to Monticello repositories. Otherwise clients have a hard time to find a uniform interface to retrieve versions and names from different types of repositories.
=============== Diff against Monticello-bp.412 ===============
Item was added:
+ ----- Method: MCDictionaryRepository>>allVersionNames (in category 'versions') -----
+ allVersionNames
+ "Answers all the version names in this repository"
+
+ ^ dict values collect: [:ea | ea info name]
+ !
Item was added:
+ ----- Method: MCDictionaryRepository>>versionNamed:ifAbsent: (in category 'versions') -----
+ versionNamed: versionName ifAbsent: aBlock
+ "Answer the MCVersion corresponding to the given version name"
+
+ ^dict detect:[:any| any info name = versionName] ifNone: aBlock
+ !
Item was added:
+ ----- Method: MCFileBasedRepository>>versionNamed:ifAbsent: (in category 'versions') -----
+ versionNamed: versionName ifAbsent: aBlock
+ "Answer the MCVersion corresponding to the given version name"
+
+ (self allFileNamesForVersionNamed: versionName) do:[:fileName |
+ | version |
+ version := self versionFromFileNamed: fileName.
+ version info name = versionName ifTrue: [^version].
+ ].
+ ^aBlock value!
Item was added:
+ ----- Method: MCRepository>>allVersionNames (in category 'versions') -----
+ allVersionNames
+ "Answer all the version names in this repository"
+
+ ^self subclassResponsibility!
Item was added:
+ ----- Method: MCRepository>>versionNamed: (in category 'versions') -----
+ versionNamed: versionName
+ "Answer the MCVersion corresponding to the given version name"
+
+ ^self versionNamed: versionName ifAbsent:[nil]!
Item was added:
+ ----- Method: MCRepository>>versionNamed:ifAbsent: (in category 'versions') -----
+ versionNamed: versionName ifAbsent: aBlock
+ "Answer the MCVersion corresponding to the given version name"
+
+ ^aBlock value!