108
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
MCRepository subclass:#MCDictionaryRepository
|
|
4 |
instanceVariableNames:'description dict'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
621
|
7 |
category:'SCM-Monticello-Repositories'
|
108
|
8 |
!
|
|
9 |
|
|
10 |
|
242
|
11 |
!MCDictionaryRepository class methodsFor:'initialization'!
|
|
12 |
|
|
13 |
new
|
|
14 |
^self basicNew initialize
|
|
15 |
! !
|
|
16 |
|
902
|
17 |
!MCDictionaryRepository methodsFor:'accessing'!
|
108
|
18 |
|
|
19 |
description
|
|
20 |
|
|
21 |
^ description ifNil: ['cache']
|
|
22 |
!
|
|
23 |
|
|
24 |
description: aString
|
|
25 |
|
242
|
26 |
description := aString
|
108
|
27 |
!
|
|
28 |
|
|
29 |
dictionary
|
|
30 |
|
|
31 |
^ dict
|
|
32 |
!
|
|
33 |
|
|
34 |
dictionary: aDictionary
|
|
35 |
|
242
|
36 |
dict := aDictionary
|
902
|
37 |
! !
|
108
|
38 |
|
902
|
39 |
!MCDictionaryRepository methodsFor:'as yet unclassified'!
|
108
|
40 |
|
|
41 |
includesVersionWithInfo: aVersionInfo
|
|
42 |
^ dict includesKey: aVersionInfo
|
|
43 |
!
|
|
44 |
|
|
45 |
sortedVersionInfos
|
|
46 |
| sorter |
|
242
|
47 |
sorter := MCVersionSorter new.
|
108
|
48 |
self allVersionInfos do: [:ea | sorter addVersionInfo: ea].
|
|
49 |
^ sorter sortedVersionInfos
|
242
|
50 |
|
108
|
51 |
!
|
|
52 |
|
|
53 |
versionWithInfo: aVersionInfo ifAbsent: errorBlock
|
|
54 |
^ dict at: aVersionInfo ifAbsent: errorBlock
|
|
55 |
! !
|
|
56 |
|
902
|
57 |
!MCDictionaryRepository methodsFor:'comparing'!
|
|
58 |
|
|
59 |
= other
|
|
60 |
^ self == other
|
|
61 |
! !
|
|
62 |
|
|
63 |
!MCDictionaryRepository methodsFor:'initialization'!
|
|
64 |
|
|
65 |
initialize
|
|
66 |
|
|
67 |
super initialize.
|
|
68 |
dict := Dictionary new.
|
|
69 |
|
|
70 |
! !
|
|
71 |
|
|
72 |
!MCDictionaryRepository methodsFor:'printing & storing'!
|
|
73 |
|
|
74 |
basicStoreVersion: aVersion
|
|
75 |
dict at: aVersion info put: aVersion
|
|
76 |
! !
|
|
77 |
|
|
78 |
!MCDictionaryRepository methodsFor:'queries'!
|
|
79 |
|
|
80 |
allVersionInfos
|
|
81 |
^ dict values collect: [:ea | ea info]
|
|
82 |
!
|
|
83 |
|
|
84 |
closestAncestorVersionFor: anAncestry ifNone: errorBlock
|
|
85 |
| info |
|
|
86 |
info := anAncestry breadthFirstAncestors
|
|
87 |
detect: [:ea | self includesVersionWithInfo: ea]
|
|
88 |
ifNone: [^ errorBlock value].
|
|
89 |
^ self versionWithInfo: info
|
|
90 |
!
|
|
91 |
|
|
92 |
includesVersionNamed: aString
|
|
93 |
^ dict anySatisfy: [:ea | ea info name = aString]
|
|
94 |
! !
|
|
95 |
|
108
|
96 |
!MCDictionaryRepository class methodsFor:'documentation'!
|
|
97 |
|
|
98 |
version
|
902
|
99 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCDictionaryRepository.st,v 1.5 2014-02-12 14:53:33 cg Exp $'
|
242
|
100 |
!
|
|
101 |
|
|
102 |
version_CVS
|
902
|
103 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCDictionaryRepository.st,v 1.5 2014-02-12 14:53:33 cg Exp $'
|
242
|
104 |
!
|
|
105 |
|
|
106 |
version_SVN
|
902
|
107 |
^ '$Id: MCDictionaryRepository.st,v 1.5 2014-02-12 14:53:33 cg Exp $'
|
108
|
108 |
! !
|
902
|
109 |
|