[Pkg] The Trunk: Monticello-ul.543.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat May 11 20:01:21 UTC 2013
Levente Uzonyi uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-ul.543.mcz
==================== Summary ====================
Name: Monticello-ul.543
Author: ul
Time: 11 May 2013, 9:45:02.11 pm
UUID: 15c9a1ec-4e02-45f0-b5f0-cd1a42670015
Ancestors: Monticello-bf.542, Monticello-ul.540
Merged.
=============== Diff against Monticello-bf.542 ===============
Item was changed:
MCRepository subclass: #MCFileBasedRepository
+ instanceVariableNames: 'cache allFileNamesCache allVersionNamesCache'
- instanceVariableNames: 'cache allFileNames'
classVariableNames: ''
poolDictionaries: ''
category: 'Monticello-Repositories'!
Item was changed:
----- Method: MCFileBasedRepository>>allFileNamesOrCache (in category 'private-files') -----
allFileNamesOrCache
+
+ ^allFileNamesCache ifNil: [ self allFileNames ]!
- ^ allFileNames ifNil: [self allFileNames]!
Item was changed:
----- Method: MCFileBasedRepository>>allVersionNames (in category 'private-files') -----
allVersionNames
+ ^allVersionNamesCache ifNil: [
+ self readableFileNames collect: [ :each | each versionName ] ]!
- ^self readableFileNames collect: [ :each | each versionName ]!
Item was changed:
----- Method: MCFileBasedRepository>>cacheAllFileNamesDuring: (in category 'private') -----
cacheAllFileNamesDuring: aBlock
+ "Cache the result of #allFileNames and #allVersionNames during aBlock"
+
+ allFileNamesCache ifNotNil: [ ^aBlock value ].
+ allFileNamesCache := self allFileNames.
+ allVersionNamesCache := self allVersionNames.
+ ^aBlock ensure: [ allFileNamesCache := allVersionNamesCache := nil ]!
- allFileNames ifNotNil:[^aBlock value].
- allFileNames := self allFileNames.
- ^ aBlock ensure: [allFileNames := nil]!
Item was changed:
----- Method: MCFileBasedRepository>>flushCache (in category 'private') -----
flushCache
+
+ cache := allFileNamesCache := allVersionNamesCache := nil!
- cache := allFileNames := nil!
Item was changed:
----- Method: MCFileBasedRepository>>includesVersionNamed: (in category 'versions') -----
includesVersionNamed: aString
+
| comparable |
comparable := ((aString endsWith: '.mcz') and: [ aString size > 4 ])
+ ifTrue: [ aString allButLast: 4 ]
- ifTrue:
- [ aString
- copyFrom: 1
- to: aString size - 4 ]
ifFalse: [ aString ].
^ self allVersionNames includes: comparable!
Item was changed:
----- Method: MCVersionName>>versionName (in category 'accessing') -----
versionName
"Answer my version name as a ByteString, without the file suffix or any ancestor-attributes."
| end |
self isEmpty ifTrue: [^ String empty].
end := self indexOf: $( ifAbsent: [
+ (self size > 4
+ and: [ (self at: self size - 3) == $.
+ and: [ (self at: self size - 2) == $m
+ and: [ (self at: self size - 1) == $c ] ] ])
+ ifTrue: [self size - 3]
+ ifFalse: [self size + 1]].
- (self size > 4 and: [(self copyFrom: self size - 3 to: self size - 1) = '.mc'])
- ifTrue: [self size - 3]
- ifFalse: [self size + 1]].
^self first: end - 1!
More information about the Packages
mailing list