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 |
|
621
|
17 |
|
108
|
18 |
!MCDictionaryRepository methodsFor:'as yet unclassified'!
|
|
19 |
|
|
20 |
= other
|
|
21 |
^ self == other
|
|
22 |
!
|
|
23 |
|
|
24 |
allVersionInfos
|
|
25 |
^ dict values collect: [:ea | ea info]
|
|
26 |
!
|
|
27 |
|
|
28 |
basicStoreVersion: aVersion
|
|
29 |
dict at: aVersion info put: aVersion
|
|
30 |
!
|
|
31 |
|
|
32 |
closestAncestorVersionFor: anAncestry ifNone: errorBlock
|
|
33 |
| info |
|
242
|
34 |
info := anAncestry breadthFirstAncestors
|
108
|
35 |
detect: [:ea | self includesVersionWithInfo: ea]
|
|
36 |
ifNone: [^ errorBlock value].
|
|
37 |
^ self versionWithInfo: info
|
|
38 |
!
|
|
39 |
|
|
40 |
description
|
|
41 |
|
|
42 |
^ description ifNil: ['cache']
|
|
43 |
!
|
|
44 |
|
|
45 |
description: aString
|
|
46 |
|
242
|
47 |
description := aString
|
108
|
48 |
!
|
|
49 |
|
|
50 |
dictionary
|
|
51 |
|
|
52 |
^ dict
|
|
53 |
!
|
|
54 |
|
|
55 |
dictionary: aDictionary
|
|
56 |
|
242
|
57 |
dict := aDictionary
|
108
|
58 |
!
|
|
59 |
|
|
60 |
includesVersionNamed: aString
|
|
61 |
^ dict anySatisfy: [:ea | ea info name = aString]
|
|
62 |
!
|
|
63 |
|
|
64 |
includesVersionWithInfo: aVersionInfo
|
|
65 |
^ dict includesKey: aVersionInfo
|
|
66 |
!
|
|
67 |
|
|
68 |
initialize
|
|
69 |
|
242
|
70 |
super initialize.
|
|
71 |
dict := Dictionary new.
|
108
|
72 |
|
|
73 |
!
|
|
74 |
|
|
75 |
sortedVersionInfos
|
|
76 |
| sorter |
|
242
|
77 |
sorter := MCVersionSorter new.
|
108
|
78 |
self allVersionInfos do: [:ea | sorter addVersionInfo: ea].
|
|
79 |
^ sorter sortedVersionInfos
|
242
|
80 |
|
108
|
81 |
!
|
|
82 |
|
|
83 |
versionWithInfo: aVersionInfo ifAbsent: errorBlock
|
|
84 |
^ dict at: aVersionInfo ifAbsent: errorBlock
|
|
85 |
! !
|
|
86 |
|
|
87 |
!MCDictionaryRepository class methodsFor:'documentation'!
|
|
88 |
|
|
89 |
version
|
621
|
90 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCDictionaryRepository.st,v 1.4 2012-09-11 21:21:28 cg Exp $'
|
242
|
91 |
!
|
|
92 |
|
|
93 |
version_CVS
|
621
|
94 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCDictionaryRepository.st,v 1.4 2012-09-11 21:21:28 cg Exp $'
|
242
|
95 |
!
|
|
96 |
|
|
97 |
version_SVN
|
|
98 |
^ '§Id: MCDictionaryRepository.st 7 2010-09-12 07:18:55Z vranyj1 §'
|
108
|
99 |
! !
|