[squeak-dev] The Trunk: Monticello-cmm.425.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Mar 15 19:16:40 UTC 2011
Chris Muller uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-cmm.425.mcz
==================== Summary ====================
Name: Monticello-cmm.425
Author: cmm
Time: 3 March 2011, 1:48:23.59 pm
UUID: 9c3adcf4-9922-4eed-9959-54ed1e27cf4b
Ancestors: Monticello-cmm.424
- MCRepository's must implement #allPackageNames and #fileNamesForPackageNamed:.
- Updated possiblyNewerVersionsOfAnyOf: to not require a collection of VersionInfo's, just version names.
- Removed MCFileRepositoryInspector, we no longer need it!
- Successfully removed the last external call to #readableFileNames, so we can proceed with scalable MC repository's.
=============== Diff against Monticello-cmm.424 ===============
Item was added:
+ ----- Method: MCFileBasedRepository>>allPackageNames (in category 'overriding') -----
+ allPackageNames
+ | answer |
+ answer := Set new.
+ self allFileNamesOrCache do:
+ [ : each | answer add: (MCFileName on: each) packageName ].
+ ^ answer!
Item was added:
+ ----- Method: MCFileBasedRepository>>fileNamesForPackageNamed: (in category 'versions') -----
+ fileNamesForPackageNamed: packageName
+ ^ Array streamContents:
+ [ : stream | self allFileNamesOrCache do:
+ [ : each | | mcFileName |
+ mcFileName := MCFileName on: each.
+ mcFileName packageName = packageName ifTrue: [ stream nextPut: mcFileName ] ] ]!
Item was changed:
----- Method: MCFileBasedRepository>>possiblyNewerVersionsOfAnyOf: (in category 'versions') -----
+ possiblyNewerVersionsOfAnyOf: versionNames
- possiblyNewerVersionsOfAnyOf: someVersions
| pkgs |
pkgs := Dictionary new.
+ versionNames do:
+ [ : aVersionInfo | pkgs
+ at: (aVersionInfo copyUpToLast: $-)
+ put: (aVersionInfo copyAfterLast: $.) asNumber ].
+ ^ [ self allVersionNames select:
+ [ : each | (pkgs
+ at: (each copyUpToLast: $-)
+ ifPresent:
+ [ : verNumber | verNumber < (each copyAfterLast: $.) asNumber or:
+ [ verNumber = (each copyAfterLast: $.) asNumber and:
+ [ versionNames noneSatisfy:
+ [ : v | v = each ] ] ] ]) == true ] ]
+ on: Error
+ do:
+ [ : ex | ex return: #() ]!
-
- someVersions do: [:aVersionInfo |
- pkgs at: (aVersionInfo name copyUpToLast: $-)
- put: (aVersionInfo name copyAfterLast: $.) asNumber].
-
- ^[self allVersionNames select: [:each |
- (pkgs at: (each copyUpToLast: $-) ifPresent: [:verNumber |
- verNumber < (each copyAfterLast: $.) asNumber
- or: [verNumber = (each copyAfterLast: $.) asNumber
- and: [someVersions noneSatisfy: [:v | v name = each]]]]) == true]
- ] on: Error do: [:ex | ex return: #()]!
Item was changed:
----- Method: MCFileBasedRepository>>readableFileNames (in category 'private-files') -----
readableFileNames
+ "Answer an Array of Strings representing every file in this repository; first the ones from the cache (whether or not they still exist in the repository) followed by every other file in this repository that Monticello can read."
| all cached new |
all := self allFileNamesOrCache. "from repository"
cached := self cachedFileNames. "in memory"
new := all difference: cached.
^ (cached asArray, new)
select: [:ea | self canReadFileNamed: ea]!
Item was removed:
- ----- Method: MCFileBasedRepository>>versionNamesForPackageNamed: (in category 'versions') -----
- versionNamesForPackageNamed: aString
- "Answer a collection of MCFileNames whose Package is named aString."
- ^ (self allVersionNames collect:
- [ : eachString | MCFileName on: eachString ]) select:
- [ : eachMCFileName | eachMCFileName packageName = aString ]!
Item was removed:
- MCRepositoryInspector subclass: #MCFileRepositoryInspector
- instanceVariableNames: ''
- classVariableNames: ''
- poolDictionaries: ''
- category: 'Monticello-UI'!
Item was changed:
+ ----- Method: MCRepository>>= (in category 'testing') -----
- ----- Method: MCRepository>>= (in category 'as yet unclassified') -----
= other
^ other species = self species and: [other description = self description]!
Item was added:
+ ----- Method: MCRepository>>allPackageNames (in category 'packages') -----
+ allPackageNames
+ self subclassResponsibility!
Item was added:
+ ----- Method: MCRepository>>fileNamesForPackageNamed: (in category 'versions') -----
+ fileNamesForPackageNamed: aString
+ "Answer a collection of MCFileNames whose Package is named aString."
+ self subclassResponsibility!
Item was changed:
+ ----- Method: MCRepository>>hash (in category 'testing') -----
- ----- Method: MCRepository>>hash (in category 'as yet unclassified') -----
hash
^ self description hash!
Item was added:
+ ----- Method: MCRepository>>highestNumberedVersionNameForPackageNamed: (in category 'versions') -----
+ highestNumberedVersionNameForPackageNamed: aString
+ ^ (self fileNamesForPackageNamed: aString)
+ ifNil: [ self error: aString , ' not found in ' , self asString ]
+ ifNotNilDo:
+ [ : pkg | pkg detectMax:
+ [ : each | each versionNumber ] ]!
Item was changed:
+ ----- Method: MCRepository>>initialize (in category 'initialize-release') -----
- ----- Method: MCRepository>>initialize (in category 'as yet unclassified') -----
initialize!
Item was removed:
- ----- Method: MCRepository>>versionNamesForPackageNamed: (in category 'versions') -----
- versionNamesForPackageNamed: aString
- "Answer a collection of MCFileNames whose Package is named aString."
- self subclassResponsibility!
Item was changed:
----- Method: MCRepositoryInspector>>hasNewerVersionsFor: (in category 'private') -----
hasNewerVersionsFor: aMCWorkingCopy
| latest |
+ latest := (self versionNames select:
- latest := (versionNames select:
[ : eachMCFileName | eachMCFileName packageName = aMCWorkingCopy package name ]) detectMax:
[ : eachMCFileName | eachMCFileName versionNumber ].
^ latest notNil and:
[ aMCWorkingCopy ancestors allSatisfy:
[ : ancestor | | loadedVersionNumber ancestorName |
ancestorName := ancestor mcName.
loadedVersionNumber := ancestorName versionNumber.
loadedVersionNumber < latest versionNumber or:
[ loadedVersionNumber = latest versionNumber and: [ ancestorName author ~= latest author ] ] ] ]!
Item was added:
+ ----- Method: MCRepositoryInspector>>initialize (in category 'initialize-release') -----
+ initialize
+ super initialize.
+ self initializeEmphasis!
Item was added:
+ ----- Method: MCRepositoryInspector>>initializeEmphasis (in category 'initialize-release') -----
+ initializeEmphasis
+ newer := Set new.
+ inherited := Set new.
+ loaded := Set new!
Item was changed:
----- Method: MCRepositoryInspector>>packageList (in category 'morphic ui') -----
packageList
-
| result loadedPackages |
+ packageNames ifNotNil: [ ^ packageNames ].
+ result := repository allPackageNames.
- packageNames ifNotNil: [ ^packageNames ].
- result := Set new: versionNames size.
- versionNames do: [ :each | result add: each packageName ].
-
"sort loaded packages first, then alphabetically"
loadedPackages := Set new: loaded size.
+ loaded do:
+ [ : each | loadedPackages add: each packageName ].
+ result := result asArray sort:
+ [ : a : b | | loadedA loadedB |
- loaded do: [ :each |
- loadedPackages add: (each packageName) ].
- result := result asArray sort: [ :a :b |
- | loadedA loadedB |
loadedA := loadedPackages includes: a.
loadedB := loadedPackages includes: b.
+ loadedA = loadedB
- loadedA = loadedB
ifTrue: [ a < b ]
ifFalse: [ loadedA ] ].
+ ^ packageNames := result collect:
+ [ : each | self packageHighlight: each ]!
-
- ^packageNames := result collect: [ :each | self packageHighlight: each ]!
Item was changed:
----- Method: MCRepositoryInspector>>packageSelection: (in category 'morphic ui') -----
packageSelection: aNumber
selectedPackage := aNumber isZero
ifFalse: [ (self packageList at: aNumber) asString ].
self versionSelection: 0.
+ versionNames := nil.
self changed: #packageSelection; changed: #versionList!
Item was changed:
----- Method: MCRepositoryInspector>>refresh (in category 'actions') -----
refresh
+ packageNames := versionNames := nil.
- packageNames := nil.
- versionNames := repository readableFileNames collect: [ : each | MCFileName on: each ].
self
- refreshEmphasis ;
changed: #packageList ;
changed: #versionList!
Item was changed:
----- Method: MCRepositoryInspector>>refreshEmphasis (in category 'morphic ui') -----
refreshEmphasis
+ self initializeEmphasis.
- newer := Set new.
- inherited := Set new.
- loaded := Set new.
MCWorkingCopy allManagers do:
[ : each | | latest |
self identifyLoadedAndInherited: each.
(self hasNewerVersionsFor: each) ifTrue: [ newer add: each package name ] ]!
Item was changed:
----- Method: MCRepositoryInspector>>versionList (in category 'morphic ui') -----
versionList
| result |
+ result := self versionNames.
- result := selectedPackage
- ifNil: [ versionNames copy ]
- ifNotNil:
- [ versionNames select:
- [ : each | selectedPackage = each packageName ] ].
"Not sure why we need this ugly Error trapping here.."
(self orderSpecs at: order) value ifNotNil:
[ : sortBlock | result sort:
[ : a : b | [ sortBlock
value: a
value: b ]
on: Error
do: [ true ] ] ].
+ ^ result collect: [ : each | self versionHighlight: each ]!
- ^ result replace:
- [ : each | self versionHighlight: each ]!
Item was added:
+ ----- Method: MCRepositoryInspector>>versionNames (in category 'private') -----
+ versionNames
+ ^ versionNames ifNil:
+ [ selectedPackage
+ ifNil: [ Array empty ]
+ ifNotNil:
+ [ versionNames := repository fileNamesForPackageNamed: selectedPackage.
+ self refreshEmphasis.
+ versionNames ] ]!
Item was changed:
----- Method: MCWorkingCopy>>possiblyNewerVersionsIn: (in category 'private') -----
+ possiblyNewerVersionsIn: aRepository
+ ^ aRepository possiblyNewerVersionsOfAnyOf:
+ (self ancestors collect:
+ [ : each | each name ])!
- possiblyNewerVersionsIn: aRepository
-
- ^aRepository possiblyNewerVersionsOfAnyOf: self ancestors!
More information about the Squeak-dev
mailing list
|