author | Claus Gittinger <cg@exept.de> |
Wed, 12 Feb 2014 15:53:41 +0100 | |
changeset 910 | 6a56267a1e3c |
parent 675 | 0f3c79b5226a |
child 965 | e5e12ca03097 |
permissions | -rw-r--r-- |
106 | 1 |
"{ Package: 'stx:goodies/monticello' }" |
2 |
||
3 |
Object subclass:#MCRepository |
|
4 |
instanceVariableNames:'creationTemplate storeDiffs' |
|
5 |
classVariableNames:'Settings' |
|
6 |
poolDictionaries:'' |
|
675 | 7 |
category:'SCM-Monticello-Repositories' |
106 | 8 |
! |
9 |
||
10 |
||
210 | 11 |
!MCRepository class methodsFor:'initialization'! |
12 |
||
13 |
initialize |
|
14 |
"self initialize" |
|
15 |
" |
|
16 |
ExternalSettings registerClient: self. |
|
17 |
" |
|
18 |
||
19 |
"Modified: / 13-10-2010 / 14:13:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
20 |
! ! |
|
21 |
||
106 | 22 |
!MCRepository class methodsFor:'as yet unclassified'! |
23 |
||
24 |
fillInTheBlankRequest |
|
25 |
self subclassResponsibility. |
|
26 |
! |
|
27 |
||
28 |
morphicConfigure |
|
29 |
^ self new |
|
30 |
! ! |
|
31 |
||
32 |
!MCRepository class methodsFor:'external settings'! |
|
33 |
||
34 |
fetchExternalSettingsIn: aDirectory |
|
35 |
"Scan for settings file" |
|
36 |
"MCRepository fetchExternalSettingsIn: ExternalSettings preferenceDirectory" |
|
37 |
||
38 |
| stream | |
|
39 |
(aDirectory fileExists: self settingsFileName) |
|
40 |
ifFalse: [^self]. |
|
210 | 41 |
stream := aDirectory readOnlyFileNamed: self settingsFileName. |
106 | 42 |
stream |
43 |
ifNotNil: [ |
|
210 | 44 |
[Settings := ExternalSettings parseServerEntryArgsFrom: stream] |
106 | 45 |
ensure: [stream close]]. |
210 | 46 |
|
106 | 47 |
! |
48 |
||
49 |
releaseExternalSettings |
|
50 |
Settings := nil. |
|
210 | 51 |
|
106 | 52 |
! |
53 |
||
54 |
settingsFileName |
|
55 |
^ 'mcSettings' |
|
56 |
! ! |
|
57 |
||
910 | 58 |
!MCRepository class methodsFor:'queries'! |
106 | 59 |
|
910 | 60 |
allConcreteSubclasses |
61 |
^ self withAllSubclasses reject: [:ea | ea isAbstract] |
|
62 |
! |
|
63 |
||
64 |
creationTemplate |
|
65 |
self subclassResponsibility. |
|
106 | 66 |
! |
67 |
||
910 | 68 |
description |
69 |
^ nil |
|
106 | 70 |
! |
71 |
||
910 | 72 |
isAbstract |
73 |
^ self description isNil |
|
74 |
! ! |
|
75 |
||
76 |
!MCRepository methodsFor:'accessing'! |
|
106 | 77 |
|
78 |
creationTemplate |
|
79 |
^ creationTemplate |
|
80 |
! |
|
81 |
||
82 |
creationTemplate: aString |
|
83 |
self creationTemplate ifNotNil: [ self error: 'Creation template already set for this MCRepository instance.' ]. |
|
84 |
||
210 | 85 |
creationTemplate := aString. |
106 | 86 |
! |
87 |
||
88 |
description |
|
89 |
^ self class name |
|
910 | 90 |
! ! |
91 |
||
92 |
!MCRepository methodsFor:'as yet unclassified'! |
|
93 |
||
94 |
alwaysStoreDiffs |
|
95 |
^ storeDiffs ifNil: [false] |
|
96 |
! |
|
97 |
||
98 |
asCreationTemplate |
|
99 |
^ self creationTemplate |
|
106 | 100 |
! |
101 |
||
102 |
doAlwaysStoreDiffs |
|
210 | 103 |
storeDiffs := true |
106 | 104 |
! |
105 |
||
106 |
doNotAlwaysStoreDiffs |
|
210 | 107 |
storeDiffs := false |
106 | 108 |
! |
109 |
||
110 |
notificationForVersion: aVersion |
|
111 |
^ MCVersionNotification version: aVersion repository: self |
|
112 |
! |
|
113 |
||
114 |
notifyList |
|
115 |
^ #() |
|
116 |
! |
|
117 |
||
118 |
prepareVersionForStorage: aVersion |
|
119 |
^ self alwaysStoreDiffs |
|
120 |
ifTrue: [aVersion asDiffAgainst: |
|
121 |
(self closestAncestorVersionFor: aVersion info ifNone: [^ aVersion])] |
|
122 |
ifFalse: [aVersion] |
|
123 |
! |
|
124 |
||
125 |
sendNotificationsForVersion: aVersion |
|
126 |
| notification notifyList | |
|
210 | 127 |
notifyList := self notifyList. |
106 | 128 |
notifyList isEmpty ifFalse: |
210 | 129 |
[notification := self notificationForVersion: aVersion. |
106 | 130 |
notifyList do: [:ea | notification notify: ea]] |
514 | 131 |
! ! |
132 |
||
133 |
!MCRepository methodsFor:'comparing'! |
|
134 |
||
135 |
= other |
|
136 |
^ other species = self species and: [other description = self description] |
|
106 | 137 |
! |
138 |
||
514 | 139 |
hash |
140 |
^ self description hash |
|
106 | 141 |
! ! |
142 |
||
143 |
!MCRepository methodsFor:'interface'! |
|
144 |
||
145 |
includesVersionNamed: aString |
|
146 |
self subclassResponsibility |
|
147 |
! |
|
148 |
||
149 |
versionWithInfo: aVersionInfo |
|
150 |
^ self versionWithInfo: aVersionInfo ifAbsent: [nil] |
|
151 |
! |
|
152 |
||
153 |
versionWithInfo: aVersionInfo ifAbsent: aBlock |
|
154 |
self subclassResponsibility |
|
155 |
! ! |
|
156 |
||
514 | 157 |
!MCRepository methodsFor:'printing & storing'! |
158 |
||
159 |
basicStoreVersion: aVersion |
|
160 |
self subclassResponsibility |
|
161 |
! |
|
162 |
||
163 |
printOn: aStream |
|
164 |
super printOn: aStream. |
|
165 |
aStream |
|
166 |
nextPut: $(; |
|
167 |
nextPutAll: self description; |
|
168 |
nextPut: $). |
|
169 |
! |
|
170 |
||
171 |
storeVersion: aVersion |
|
172 |
self basicStoreVersion: (self prepareVersionForStorage: aVersion). |
|
173 |
self sendNotificationsForVersion: aVersion |
|
174 |
! ! |
|
175 |
||
910 | 176 |
!MCRepository methodsFor:'queries'! |
177 |
||
178 |
closestAncestorVersionFor: anAncestry ifNone: errorBlock |
|
179 |
| v | |
|
180 |
anAncestry breadthFirstAncestorsDo: |
|
181 |
[:ancestorInfo | |
|
182 |
(v := self versionWithInfo: ancestorInfo) ifNotNil: [ ^ v]]. |
|
183 |
^ errorBlock value |
|
184 |
! |
|
185 |
||
186 |
possiblyNewerVersionsOfAnyOf: someVersions |
|
187 |
^#() |
|
188 |
! ! |
|
189 |
||
106 | 190 |
!MCRepository methodsFor:'testing'! |
191 |
||
192 |
isValid |
|
193 |
^true |
|
194 |
! ! |
|
195 |
||
196 |
!MCRepository class methodsFor:'documentation'! |
|
197 |
||
198 |
version |
|
910 | 199 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCRepository.st,v 1.7 2014-02-12 14:53:41 cg Exp $' |
137
98f158a061a2
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
106
diff
changeset
|
200 |
! |
98f158a061a2
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
106
diff
changeset
|
201 |
|
98f158a061a2
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
106
diff
changeset
|
202 |
version_CVS |
910 | 203 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCRepository.st,v 1.7 2014-02-12 14:53:41 cg Exp $' |
210 | 204 |
! |
205 |
||
206 |
version_SVN |
|
207 |
||
910 | 208 |
^'$Id: MCRepository.st,v 1.7 2014-02-12 14:53:41 cg Exp $' |
106 | 209 |
! ! |
210 |
||
910 | 211 |
|
106 | 212 |
MCRepository initialize! |