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