--- a/MCFileBasedRepository.st Sat Aug 20 13:45:44 2011 +0200
+++ b/MCFileBasedRepository.st Sat Aug 20 13:45:50 2011 +0200
@@ -28,6 +28,14 @@
^ allFileNames ifNil: [self allFileNames]
!
+allPackageNames
+ ^ (self readableFileNames collect: [:ea | self packageNameFromFileName: ea])
+ asSet asOrderedCollection
+
+ "Created: / 16-09-2010 / 16:10:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 16-09-2010 / 18:44:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
allVersionNames
^ self readableFileNames collect: [:ea | self versionNameFromFileName: ea]
!
@@ -37,17 +45,18 @@
writeStreamForFileNamed: aVersion fileName
do: [:s | aVersion fileOutOn: s].
aVersion isCacheable ifTrue: [
- cache ifNil: [cache _ Dictionary new].
+ cache ifNil: [cache := Dictionary new].
cache at: aVersion fileName put: aVersion].
+
!
cache
- ^ cache ifNil: [cache _ Dictionary new]
+ ^ cache ifNil: [cache := Dictionary new]
!
cacheAllFileNamesDuring: aBlock
- allFileNames _ self allFileNames.
- ^ aBlock ensure: [allFileNames _ nil]
+ allFileNames := self allFileNames.
+ ^ aBlock ensure: [allFileNames := nil]
!
cachedFileNames
@@ -58,7 +67,7 @@
canReadFileNamed: aString
| reader |
- reader _ MCVersionReader readerClassForFileNamed: aString.
+ reader := MCVersionReader readerClassForFileNamed: aString.
^ reader notNil
!
@@ -72,7 +81,7 @@
!
flushCache
- cache _ nil
+ cache := nil
!
includesVersionNamed: aString
@@ -92,17 +101,21 @@
^ 8
!
-morphicOpen: aWorkingCopy
- (MCFileRepositoryInspector repository: self workingCopy: aWorkingCopy)
- show
+notifyList
+ | list |
+ (self allFileNames includes: 'notify') ifFalse: [^ #()].
+ ^ self readStreamForFileNamed: 'notify' do:
+ [:s |
+ s upToEnd asStringWithSqueakLineEndings findTokens: (String with: Character cr)]
+
+ "Modified: / 12-09-2010 / 16:06:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-notifyList
- | list |
- (self allFileNames includes: 'notify') ifFalse: [^ #()].
- ^ self readStreamForFileNamed: 'notify' do:
- [:s |
- s upToEnd withSqueakLineEndings findTokens: (String with: Character cr)]
+packageNameFromFileName: aString
+ ^ (aString copyUpToLast: $-)
+
+ "Created: / 16-09-2010 / 16:10:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 16-09-2010 / 18:45:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
possiblyNewerVersionsOfAnyOf: someVersions
@@ -131,8 +144,10 @@
!
resizeCache: aDictionary
- [aDictionary size <= self maxCacheSize] whileFalse:
- [aDictionary removeKey: aDictionary keys atRandom]
+ [aDictionary size <= self maxCacheSize] whileFalse:
+ [aDictionary removeKey: aDictionary keys asArray atRandom]
+
+ "Modified: / 15-09-2010 / 13:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
versionFromFileNamed: aString
@@ -153,18 +168,20 @@
!
versionReaderForFileNamed: aString do: aBlock
- ^ self
- readStreamForFileNamed: aString
- do: [:s |
- (MCVersionReader readerClassForFileNamed: aString) ifNotNilDo:
- [:class | aBlock value: (class on: s fileName: aString)]]
+ ^ self
+ readStreamForFileNamed: aString
+ do: [:s | | class |
+ (class := MCVersionReader readerClassForFileNamed: aString) ifNotNil:
+ [ aBlock value: (class on: s fileName: aString)]]
+
+ "Modified: / 12-09-2010 / 19:40:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
versionWithInfo: aVersionInfo ifAbsent: errorBlock
| version |
(self allFileNamesForVersionNamed: aVersionInfo name) do:
[:fileName |
- version _ self versionFromFileNamed: fileName.
+ version := self versionFromFileNamed: fileName.
version info = aVersionInfo ifTrue: [^ version]].
^ errorBlock value
!
@@ -176,5 +193,13 @@
!MCFileBasedRepository class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/goodies/monticello/MCFileBasedRepository.st,v 1.1 2006-11-22 13:22:23 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/goodies/monticello/MCFileBasedRepository.st,v 1.2 2011-08-20 11:45:50 cg Exp $'
+!
+
+version_CVS
+ ^ '$Header: /cvs/stx/stx/goodies/monticello/MCFileBasedRepository.st,v 1.2 2011-08-20 11:45:50 cg Exp $'
+!
+
+version_SVN
+ ^ '§Id: MCFileBasedRepository.st 14 2010-09-17 14:16:41Z vranyj1 §'
! !