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