author | Claus Gittinger <cg@exept.de> |
Thu, 22 Dec 2011 10:00:17 +0100 | |
changeset 10999 | ad10cd0cd55e |
parent 10986 | 79f022aaa60d |
child 11006 | 7491dc45fec7 |
permissions | -rw-r--r-- |
9822 | 1 |
" |
2 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
"{ Package: 'stx:libtool' }" |
|
13 |
||
9858 | 14 |
AbstractSourceCodeManagementSettingsAppl subclass:#CVSSourceCodeManagementSettingsAppl |
10981 | 15 |
instanceVariableNames:'sourceCacheDir repositoryHolder manager repository listOfModules |
9822 | 16 |
cvsRootPrototypeList addPerModuleRoot removeEnabled |
17 |
perModuleRootModule acceptChannel removePerModuleRoot |
|
18 |
perModuleRoot cvsRootHolder selectedPerModuleRoot |
|
19 |
cvsBinDirectoryHolder cvsExecutableHolder rootsPerModule |
|
10981 | 20 |
cvsLoginInModuleEnabled cvsLoginEnabled verboseSourceCodeAccess' |
10999 | 21 |
classVariableNames:'RecentlyUsedCVSRoots' |
9822 | 22 |
poolDictionaries:'' |
23 |
category:'System-SourceCodeManagement' |
|
24 |
! |
|
25 |
||
26 |
!CVSSourceCodeManagementSettingsAppl class methodsFor:'documentation'! |
|
27 |
||
28 |
copyright |
|
29 |
" |
|
30 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
31 |
All Rights Reserved |
|
32 |
||
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
! |
|
41 |
||
42 |
documentation |
|
43 |
" |
|
10981 | 44 |
CVS part of the source code settings. |
45 |
This settings app controls the parameters of the CVSSourceCodeManager. |
|
46 |
||
47 |
Extrated for pluggability from SourceCodeManagerSettings in the AbstractSettingsApplication. |
|
9822 | 48 |
" |
49 |
! ! |
|
50 |
||
9845
bfb845fd9ff2
added: #defaultRepositoryName
Claus Gittinger <cg@exept.de>
parents:
9822
diff
changeset
|
51 |
!CVSSourceCodeManagementSettingsAppl class methodsFor:'defaults'! |
bfb845fd9ff2
added: #defaultRepositoryName
Claus Gittinger <cg@exept.de>
parents:
9822
diff
changeset
|
52 |
|
bfb845fd9ff2
added: #defaultRepositoryName
Claus Gittinger <cg@exept.de>
parents:
9822
diff
changeset
|
53 |
defaultRepositoryName |
bfb845fd9ff2
added: #defaultRepositoryName
Claus Gittinger <cg@exept.de>
parents:
9822
diff
changeset
|
54 |
|
bfb845fd9ff2
added: #defaultRepositoryName
Claus Gittinger <cg@exept.de>
parents:
9822
diff
changeset
|
55 |
^ '/cvs/stx' |
bfb845fd9ff2
added: #defaultRepositoryName
Claus Gittinger <cg@exept.de>
parents:
9822
diff
changeset
|
56 |
|
bfb845fd9ff2
added: #defaultRepositoryName
Claus Gittinger <cg@exept.de>
parents:
9822
diff
changeset
|
57 |
"Created: / 19-04-2011 / 11:00:11 / cg" |
bfb845fd9ff2
added: #defaultRepositoryName
Claus Gittinger <cg@exept.de>
parents:
9822
diff
changeset
|
58 |
! ! |
bfb845fd9ff2
added: #defaultRepositoryName
Claus Gittinger <cg@exept.de>
parents:
9822
diff
changeset
|
59 |
|
9822 | 60 |
!CVSSourceCodeManagementSettingsAppl class methodsFor:'interface specs'! |
61 |
||
62 |
windowSpec |
|
63 |
"This resource specification was automatically generated |
|
64 |
by the UIPainter of ST/X." |
|
65 |
||
66 |
"Do not manually edit this!! If it is corrupted, |
|
67 |
the UIPainter may not be able to read the specification." |
|
68 |
||
69 |
" |
|
70 |
UIPainter new openOnClass:CVSSourceCodeManagementSettingsAppl andSelector:#windowSpec |
|
71 |
CVSSourceCodeManagementSettingsAppl new openInterface:#windowSpec |
|
72 |
CVSSourceCodeManagementSettingsAppl open |
|
73 |
" |
|
74 |
||
75 |
<resource: #canvas> |
|
76 |
||
77 |
^ |
|
78 |
#(FullSpec |
|
79 |
name: windowSpec |
|
80 |
window: |
|
81 |
(WindowSpec |
|
82 |
label: 'CVS Settings' |
|
83 |
name: 'CVS Settings' |
|
84 |
min: (Point 10 10) |
|
85 |
bounds: (Rectangle 0 0 659 580) |
|
86 |
) |
|
87 |
component: |
|
88 |
(SpecCollection |
|
89 |
collection: ( |
|
90 |
(VerticalPanelViewSpec |
|
91 |
name: 'VerticalPanel2' |
|
92 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
93 |
horizontalLayout: fit |
|
94 |
verticalLayout: topSpace |
|
95 |
horizontalSpace: 3 |
|
96 |
verticalSpace: 20 |
|
97 |
component: |
|
98 |
(SpecCollection |
|
99 |
collection: ( |
|
100 |
(VerticalPanelViewSpec |
|
101 |
name: 'VerticalPanel3' |
|
102 |
horizontalLayout: fit |
|
103 |
verticalLayout: top |
|
104 |
horizontalSpace: 3 |
|
105 |
verticalSpace: 4 |
|
106 |
component: |
|
107 |
(SpecCollection |
|
108 |
collection: ( |
|
109 |
(ViewSpec |
|
110 |
name: 'ManagerSetupBoxx' |
|
111 |
component: |
|
112 |
(SpecCollection |
|
113 |
collection: ( |
|
114 |
(FramedBoxSpec |
|
9872
22f0e9324999
changed: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents:
9858
diff
changeset
|
115 |
label: 'CVS Sourcecode Manager Settings' |
9822 | 116 |
name: 'CVSSetupBox' |
117 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
118 |
labelPosition: topLeft |
|
119 |
translateLabel: true |
|
120 |
component: |
|
121 |
(SpecCollection |
|
122 |
collection: ( |
|
123 |
(ViewSpec |
|
124 |
name: 'Box1' |
|
125 |
layout: (LayoutFrame 0 0 0 0 0 1 25 0) |
|
126 |
component: |
|
127 |
(SpecCollection |
|
128 |
collection: ( |
|
129 |
(LabelSpec |
|
130 |
label: 'CVS Command or Path:' |
|
131 |
name: 'Label1' |
|
132 |
layout: (LayoutFrame 0 0.0 0 0 60 0.25 22 0) |
|
133 |
level: 0 |
|
134 |
translateLabel: true |
|
135 |
adjust: right |
|
136 |
) |
|
137 |
(InputFieldSpec |
|
138 |
name: 'CVSExecutableField' |
|
139 |
layout: (LayoutFrame 64 0.25 0 0 0 1 22 0) |
|
140 |
tabable: true |
|
141 |
model: cvsExecutableHolder |
|
142 |
acceptChannel: acceptChannel |
|
143 |
acceptOnPointerLeave: true |
|
144 |
) |
|
145 |
) |
|
146 |
||
147 |
) |
|
148 |
) |
|
149 |
(ViewSpec |
|
150 |
name: 'Box7' |
|
151 |
layout: (LayoutFrame 0 0.0 27 0 0 1 52 0) |
|
152 |
component: |
|
153 |
(SpecCollection |
|
154 |
collection: ( |
|
155 |
(LabelSpec |
|
156 |
label: 'CVSRoot default:' |
|
157 |
name: 'defaultCvsRootLabel' |
|
158 |
layout: (LayoutFrame 0 0.0 0 0 60 0.25 22 0) |
|
159 |
level: 0 |
|
160 |
translateLabel: true |
|
161 |
adjust: right |
|
162 |
) |
|
163 |
(ComboBoxSpec |
|
164 |
name: 'cvsRootComboBox' |
|
165 |
layout: (LayoutFrame 64 0.25 0 0 0 1 22 0) |
|
166 |
tabable: true |
|
167 |
model: cvsRootHolder |
|
168 |
immediateAccept: true |
|
169 |
acceptOnLeave: true |
|
170 |
acceptOnReturn: true |
|
171 |
acceptOnTab: true |
|
172 |
acceptOnLostFocus: true |
|
173 |
acceptChannel: acceptChannel |
|
174 |
acceptOnPointerLeave: true |
|
175 |
comboList: cvsRootPrototypeList |
|
176 |
) |
|
177 |
) |
|
178 |
||
179 |
) |
|
180 |
) |
|
181 |
(HorizontalPanelViewSpec |
|
182 |
name: 'HorizontalPanel3' |
|
183 |
layout: (LayoutFrame 44 0.25 51 0 -1 1 82 0) |
|
184 |
horizontalLayout: fitSpace |
|
185 |
verticalLayout: center |
|
186 |
horizontalSpace: 3 |
|
187 |
verticalSpace: 3 |
|
188 |
component: |
|
189 |
(SpecCollection |
|
190 |
collection: ( |
|
191 |
(ViewSpec |
|
192 |
name: 'Box8' |
|
193 |
extent: (Point 102 10) |
|
194 |
) |
|
195 |
(ViewSpec |
|
196 |
name: 'Box9' |
|
197 |
extent: (Point 102 10) |
|
198 |
) |
|
199 |
(ViewSpec |
|
200 |
name: 'Box10' |
|
201 |
extent: (Point 102 10) |
|
202 |
) |
|
203 |
(ActionButtonSpec |
|
204 |
label: 'CVS-Login' |
|
205 |
name: 'loginButton1' |
|
206 |
translateLabel: true |
|
207 |
tabable: true |
|
208 |
model: loginCVSRoot |
|
209 |
enableChannel: cvsLoginEnabled |
|
210 |
extent: (Point 103 22) |
|
211 |
) |
|
212 |
) |
|
213 |
||
214 |
) |
|
215 |
) |
|
216 |
(LabelSpec |
|
217 |
label: 'CVSRoot per Module:' |
|
218 |
name: 'knownModulesLabel' |
|
219 |
layout: (LayoutFrame 0 0.0 82 0 60 0.25 104 0) |
|
220 |
translateLabel: true |
|
221 |
adjust: right |
|
222 |
) |
|
223 |
(SequenceViewSpec |
|
224 |
name: 'List1' |
|
225 |
layout: (LayoutFrame 64 0.25 82 0 0 1 201 0) |
|
226 |
tabable: true |
|
227 |
model: selectedPerModuleRoot |
|
228 |
hasHorizontalScrollBar: true |
|
229 |
hasVerticalScrollBar: true |
|
230 |
miniScrollerHorizontal: true |
|
231 |
useIndex: false |
|
232 |
sequenceList: listOfModules |
|
233 |
) |
|
234 |
(LabelSpec |
|
235 |
label: 'Module:' |
|
236 |
name: 'moduleLabel' |
|
237 |
layout: (LayoutFrame 0 0.0 211 0 60 0.25 228 0) |
|
238 |
translateLabel: true |
|
239 |
adjust: right |
|
240 |
) |
|
241 |
(InputFieldSpec |
|
242 |
name: 'perModuleRootModuleEntryField' |
|
243 |
layout: (LayoutFrame 64 0.25 207 0 0 1 229 0) |
|
244 |
tabable: true |
|
245 |
model: perModuleRootModule |
|
246 |
acceptChannel: acceptChannel |
|
247 |
acceptOnPointerLeave: true |
|
248 |
) |
|
249 |
(LabelSpec |
|
250 |
label: 'CVSRoot:' |
|
251 |
name: 'cvsRootLabel' |
|
252 |
layout: (LayoutFrame 0 0.0 236 0 60 0.25 253 0) |
|
253 |
translateLabel: true |
|
254 |
adjust: right |
|
255 |
) |
|
256 |
(ComboBoxSpec |
|
257 |
name: 'perModuleRootComboBox' |
|
258 |
layout: (LayoutFrame 64 0.25 232 0 0 1.0 254 0) |
|
259 |
tabable: true |
|
260 |
model: perModuleRoot |
|
261 |
immediateAccept: true |
|
262 |
acceptOnLeave: true |
|
263 |
acceptOnReturn: true |
|
264 |
acceptOnTab: true |
|
265 |
acceptOnLostFocus: true |
|
266 |
acceptChannel: acceptChannel |
|
267 |
acceptOnPointerLeave: true |
|
268 |
comboList: cvsRootPrototypeList |
|
269 |
) |
|
270 |
(HorizontalPanelViewSpec |
|
271 |
name: 'HorizontalPanel2' |
|
272 |
layout: (LayoutFrame 64 0.25 -25 1 -1 1 0 1) |
|
273 |
horizontalLayout: fitSpace |
|
274 |
verticalLayout: center |
|
275 |
horizontalSpace: 3 |
|
276 |
verticalSpace: 3 |
|
277 |
component: |
|
278 |
(SpecCollection |
|
279 |
collection: ( |
|
280 |
(ActionButtonSpec |
|
281 |
label: 'Add/Apply' |
|
282 |
name: 'addButton' |
|
283 |
translateLabel: true |
|
284 |
tabable: true |
|
285 |
model: addPerModuleRoot |
|
286 |
extent: (Point 97 22) |
|
287 |
) |
|
288 |
(ActionButtonSpec |
|
289 |
label: 'Remove' |
|
290 |
name: 'removeButton' |
|
291 |
translateLabel: true |
|
292 |
tabable: true |
|
293 |
model: removePerModuleRoot |
|
294 |
enableChannel: removeEnabled |
|
295 |
extent: (Point 97 22) |
|
296 |
) |
|
297 |
(ViewSpec |
|
298 |
name: 'Box11' |
|
299 |
extent: (Point 97 10) |
|
300 |
) |
|
301 |
(ActionButtonSpec |
|
302 |
label: 'CVS-Login' |
|
303 |
name: 'loginButton2' |
|
304 |
translateLabel: true |
|
305 |
tabable: true |
|
306 |
model: loginPerModuleRoot |
|
307 |
enableChannel: cvsLoginInModuleEnabled |
|
308 |
extent: (Point 98 22) |
|
309 |
) |
|
310 |
) |
|
311 |
||
312 |
) |
|
313 |
) |
|
314 |
) |
|
315 |
||
316 |
) |
|
317 |
) |
|
318 |
) |
|
319 |
||
320 |
) |
|
321 |
extent: (Point 659 327) |
|
322 |
) |
|
323 |
(FramedBoxSpec |
|
324 |
label: 'Source Cache' |
|
325 |
name: 'FramedBox1' |
|
326 |
labelPosition: topLeft |
|
327 |
translateLabel: true |
|
328 |
component: |
|
329 |
(SpecCollection |
|
330 |
collection: ( |
|
331 |
(ViewSpec |
|
332 |
name: 'SourceCacheDirBox' |
|
333 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
334 |
component: |
|
335 |
(SpecCollection |
|
336 |
collection: ( |
|
337 |
(LabelSpec |
|
338 |
label: 'Source Cache Dir:' |
|
339 |
name: 'SourceCacheDirLabel' |
|
340 |
layout: (LayoutFrame 0 0.0 0 0 60 0.25 22 0) |
|
341 |
translateLabel: true |
|
342 |
adjust: right |
|
343 |
) |
|
344 |
(InputFieldSpec |
|
345 |
name: 'SourceCacheDirEntryField' |
|
346 |
layout: (LayoutFrame 64 0.25 0 0 0 1 22 0) |
|
347 |
model: sourceCacheDir |
|
348 |
immediateAccept: false |
|
349 |
acceptOnReturn: true |
|
350 |
acceptOnTab: true |
|
351 |
acceptOnLostFocus: true |
|
352 |
acceptOnPointerLeave: true |
|
353 |
) |
|
354 |
) |
|
355 |
||
356 |
) |
|
357 |
) |
|
358 |
(HorizontalPanelViewSpec |
|
359 |
name: 'CacheActionsHorizontalPanel' |
|
360 |
layout: (LayoutFrame 44 0.25 33 0 0 1 67 0) |
|
361 |
horizontalLayout: fitSpace |
|
362 |
verticalLayout: center |
|
363 |
horizontalSpace: 3 |
|
364 |
verticalSpace: 3 |
|
365 |
component: |
|
366 |
(SpecCollection |
|
367 |
collection: ( |
|
368 |
(ActionButtonSpec |
|
369 |
label: 'Flush Cache now' |
|
370 |
name: 'FlushCacheNowButton' |
|
371 |
translateLabel: true |
|
372 |
tabable: true |
|
373 |
model: flushSourceCache |
|
374 |
extent: (Point 208 22) |
|
375 |
) |
|
376 |
(ActionButtonSpec |
|
377 |
label: 'Condense Cache now' |
|
378 |
name: 'CondenseCacheNowButton' |
|
379 |
translateLabel: true |
|
380 |
tabable: true |
|
381 |
model: condenseSourceCache |
|
382 |
extent: (Point 208 22) |
|
383 |
) |
|
384 |
) |
|
385 |
||
386 |
) |
|
387 |
) |
|
388 |
) |
|
389 |
||
390 |
) |
|
391 |
extent: (Point 659 95) |
|
392 |
) |
|
393 |
) |
|
394 |
||
395 |
) |
|
396 |
extent: (Point 659 768) |
|
397 |
) |
|
398 |
) |
|
399 |
||
400 |
) |
|
401 |
) |
|
402 |
) |
|
403 |
||
404 |
) |
|
405 |
) |
|
10981 | 406 |
|
407 |
"Modified: / 21-12-2011 / 12:14:13 / cg" |
|
9822 | 408 |
! ! |
409 |
||
9858 | 410 |
!CVSSourceCodeManagementSettingsAppl class methodsFor:'queries'! |
411 |
||
412 |
managerClass |
|
413 |
"backlink to my manager class (needed by the settings app)" |
|
414 |
||
415 |
^ CVSSourceCodeManager |
|
416 |
||
417 |
"Created: / 19-04-2011 / 12:46:52 / cg" |
|
418 |
! ! |
|
419 |
||
9822 | 420 |
!CVSSourceCodeManagementSettingsAppl methodsFor:'actions'! |
421 |
||
422 |
addModule:module withData:data |
|
423 |
(self listOfModules includes:module) ifFalse:[ |
|
424 |
self listOfModules add:module; sort. |
|
425 |
]. |
|
426 |
rootsPerModule at:module put:data. |
|
427 |
||
428 |
self updateModifiedChannel. |
|
429 |
||
430 |
"Created: / 08-11-2006 / 19:25:21 / cg" |
|
431 |
! |
|
432 |
||
433 |
basicReadSettings |
|
10986
79f022aaa60d
comment/format in: #removePerModuleRoot
Claus Gittinger <cg@exept.de>
parents:
10982
diff
changeset
|
434 |
|infoPerModule| |
79f022aaa60d
comment/format in: #removePerModuleRoot
Claus Gittinger <cg@exept.de>
parents:
10982
diff
changeset
|
435 |
|
9822 | 436 |
self initialize. |
437 |
||
438 |
self sourceCacheDir value:(CVSSourceCodeManager cacheDirectoryName). |
|
439 |
||
440 |
CVSSourceCodeManager forgetDisabledModules. |
|
441 |
repository := CVSSourceCodeManager repositoryName. |
|
442 |
repositoryHolder := (repository ? '') asValue. |
|
443 |
||
10986
79f022aaa60d
comment/format in: #removePerModuleRoot
Claus Gittinger <cg@exept.de>
parents:
10982
diff
changeset
|
444 |
infoPerModule := CVSSourceCodeManager repositoryInfoPerModule. |
79f022aaa60d
comment/format in: #removePerModuleRoot
Claus Gittinger <cg@exept.de>
parents:
10982
diff
changeset
|
445 |
infoPerModule keysAndValuesDo:[:module :info | |
79f022aaa60d
comment/format in: #removePerModuleRoot
Claus Gittinger <cg@exept.de>
parents:
10982
diff
changeset
|
446 |
rootsPerModule at:module put:(Array with:CVSSourceCodeManager with:info). |
9822 | 447 |
]. |
448 |
||
9845
bfb845fd9ff2
added: #defaultRepositoryName
Claus Gittinger <cg@exept.de>
parents:
9822
diff
changeset
|
449 |
self cvsRootHolder value:CVSSourceCodeManager repositoryName ? self class defaultRepositoryName. |
9822 | 450 |
self cvsExecutableHolder value:CVSSourceCodeManager cvsExecutable. |
451 |
self verboseSourceCodeAccess value:CVSSourceCodeManager verboseSourceCodeAccess. |
|
452 |
||
453 |
rootsPerModule notNil ifTrue:[ |
|
454 |
self listOfModules removeAll. |
|
455 |
listOfModules addAll:rootsPerModule keys asList. |
|
456 |
]. |
|
457 |
"/ self selectedPerModuleRootChanged. |
|
458 |
||
10986
79f022aaa60d
comment/format in: #removePerModuleRoot
Claus Gittinger <cg@exept.de>
parents:
10982
diff
changeset
|
459 |
"Modified: / 21-12-2011 / 14:28:11 / cg" |
9822 | 460 |
! |
461 |
||
462 |
basicSaveSettings |
|
463 |
|modules nm fn| |
|
464 |
||
465 |
nm := self sourceCacheDir value. |
|
466 |
nm notEmptyOrNil ifTrue:[ |
|
467 |
(fn := nm asFilename) exists ifFalse:[ |
|
468 |
(self confirm:('CVS cache directory ''' , nm , ''' does not exist\create ?' withCRs)) ifTrue:[ |
|
469 |
fn recursiveMakeDirectory; |
|
470 |
makeReadableForAll; |
|
471 |
makeWritableForAll; |
|
472 |
makeExecutableForAll. |
|
473 |
] |
|
474 |
]. |
|
475 |
(fn isDirectory |
|
476 |
and:[fn isReadable |
|
477 |
and:[fn isWritable]]) ifTrue:[ |
|
478 |
CVSSourceCodeManager cacheDirectoryName:nm. |
|
479 |
] ifFalse:[ |
|
480 |
self warn:'Invalid sourceCache directory.' |
|
481 |
] |
|
482 |
]. |
|
483 |
||
484 |
(Array with:CVSSourceCodeManager) "self availableManagers" do:[:eachManager | |
|
485 |
|infoPerModule| |
|
486 |
modules := rootsPerModule select:[:entry | entry first == eachManager]. |
|
487 |
infoPerModule := Dictionary new. |
|
488 |
modules keysAndValuesDo:[:module :entry | |
|
489 |
entry first == eachManager ifTrue:[ |
|
490 |
infoPerModule at:module put:(entry second). |
|
491 |
]. |
|
492 |
]. |
|
493 |
eachManager repositoryInfoPerModule:infoPerModule. |
|
494 |
]. |
|
495 |
||
496 |
self basicSaveCVSSettings. |
|
497 |
||
498 |
self sourceCacheDir value:(AbstractSourceCodeManager cacheDirectoryName). |
|
499 |
||
500 |
DebugView newDebugger. "/ ??? |
|
501 |
||
502 |
self acceptChannel value. |
|
503 |
||
504 |
"Modified: / 18-04-2011 / 18:26:57 / cg" |
|
505 |
! |
|
506 |
||
507 |
condenseSourceCache |
|
508 |
self withWaitCursorDo:[ AbstractSourceCodeManager condenseSourceCache ]. |
|
509 |
Method flushSourceStreamCache. |
|
510 |
||
511 |
"Modified: / 28-11-2006 / 12:21:33 / cg" |
|
512 |
! |
|
513 |
||
514 |
flushSourceCache |
|
515 |
self withWaitCursorDo:[ AbstractSourceCodeManager flushSourceCache ]. |
|
516 |
||
10740 | 517 |
"Modified: / 30-09-2011 / 13:33:47 / cg" |
9822 | 518 |
! |
519 |
||
520 |
removePerModuleRoot |
|
521 |
|module| |
|
522 |
||
523 |
acceptChannel value:true. |
|
524 |
module := self perModuleRootModule value. |
|
525 |
self listOfModules remove:module ifAbsent:nil. |
|
526 |
rootsPerModule removeKey:module ifAbsent:nil. |
|
527 |
self perModuleRootModule value:nil. |
|
528 |
self perModuleRoot value:nil. |
|
529 |
self updateModifiedChannel. |
|
530 |
||
10986
79f022aaa60d
comment/format in: #removePerModuleRoot
Claus Gittinger <cg@exept.de>
parents:
10982
diff
changeset
|
531 |
"Modified (format): / 21-12-2011 / 14:25:29 / cg" |
9822 | 532 |
! ! |
533 |
||
534 |
!CVSSourceCodeManagementSettingsAppl methodsFor:'actions - cvs'! |
|
535 |
||
536 |
addPerModuleRoot |
|
537 |
|module cvsRoot| |
|
538 |
||
539 |
acceptChannel value:true. |
|
540 |
||
541 |
module := self perModuleRootModule value. |
|
542 |
cvsRoot := self perModuleRoot value. |
|
543 |
||
544 |
cvsRoot size > 0 ifTrue:[ |
|
545 |
self addModule:module withData:(Array with:CVSSourceCodeManager with:cvsRoot). |
|
546 |
]. |
|
547 |
||
548 |
"Modified: / 08-11-2006 / 19:27:39 / cg" |
|
549 |
! |
|
550 |
||
551 |
basicSaveCVSSettings |
|
552 |
|cvsRoot| |
|
553 |
||
554 |
repositoryHolder notNil ifTrue:[ |
|
555 |
repositoryHolder value size > 0 ifTrue:[ |
|
556 |
manager notNil ifTrue:[ |
|
557 |
manager initializeForRepository:repositoryHolder value. |
|
558 |
] |
|
559 |
]. |
|
560 |
]. |
|
561 |
CVSSourceCodeManager cvsExecutable:((self cvsExecutableHolder value ? '') withoutSeparators). |
|
562 |
CVSSourceCodeManager initializeForRepository:(cvsRoot := self cvsRootHolder value). |
|
563 |
CVSSourceCodeManager verboseSourceCodeAccess: verboseSourceCodeAccess value. |
|
564 |
||
565 |
RecentlyUsedCVSRoots isNil ifTrue:[ |
|
566 |
RecentlyUsedCVSRoots := OrderedCollection new. |
|
567 |
]. |
|
568 |
(RecentlyUsedCVSRoots includes:cvsRoot) ifFalse:[ |
|
569 |
RecentlyUsedCVSRoots addFirst:cvsRoot. |
|
570 |
RecentlyUsedCVSRoots size > 20 ifTrue:[ |
|
571 |
RecentlyUsedCVSRoots removeLast. |
|
572 |
]. |
|
573 |
]. |
|
574 |
||
575 |
"Modified: / 29-09-2006 / 12:28:50 / cg" |
|
576 |
! |
|
577 |
||
578 |
cvsLogin:cvsRoot |
|
579 |
|cmd term| |
|
580 |
||
581 |
VT100TerminalView isNil ifTrue:[ |
|
582 |
self warn:'Function not available'. |
|
583 |
^ self. |
|
584 |
]. |
|
585 |
||
586 |
cmd := 'cvs -d ' , cvsRoot , ' login ; exit'. |
|
587 |
term := VT100TerminalView open. |
|
588 |
term topView |
|
589 |
label:'CVS Login for ' , cvsRoot; |
|
590 |
waitUntilVisible. |
|
591 |
term shellTerminateAction:[ |
|
592 |
"/ term topView destroy |
|
593 |
]. |
|
594 |
||
595 |
term showCR:(('Please enter the CVS-password then close this terminal window.') allBold colorizeAllWith:Color red). |
|
596 |
term showCR:''. |
|
597 |
term endEntry. |
|
598 |
Delay waitForSeconds:1. |
|
599 |
term sendLine:cmd. |
|
600 |
||
601 |
" |
|
602 |
self basicNew cvsLogin:':pserver:stx@exept.eu.org:/stx' |
|
603 |
" |
|
604 |
||
605 |
"Modified: / 25-08-2010 / 23:03:19 / cg" |
|
606 |
! |
|
607 |
||
608 |
loginCVSRoot |
|
609 |
self cvsLogin:cvsRootHolder value. |
|
610 |
! |
|
611 |
||
612 |
loginPerModuleRoot |
|
613 |
self cvsLogin:perModuleRoot value. |
|
614 |
! ! |
|
615 |
||
616 |
!CVSSourceCodeManagementSettingsAppl methodsFor:'aspects'! |
|
617 |
||
618 |
acceptChannel |
|
619 |
||
620 |
acceptChannel isNil ifTrue:[ |
|
621 |
acceptChannel := TriggerValue new. |
|
622 |
]. |
|
623 |
^ acceptChannel. |
|
624 |
! |
|
625 |
||
626 |
cvsExecutableHolder |
|
627 |
cvsExecutableHolder isNil ifTrue:[ |
|
628 |
cvsExecutableHolder := ValueHolder new. |
|
629 |
cvsExecutableHolder onChangeSend:#updateModifiedChannel to:self |
|
630 |
]. |
|
631 |
^ cvsExecutableHolder. |
|
632 |
||
633 |
"Created: / 21-09-2006 / 15:37:06 / cg" |
|
634 |
! |
|
635 |
||
636 |
cvsLoginEnabled |
|
637 |
cvsLoginEnabled isNil ifTrue:[ |
|
638 |
cvsLoginEnabled := false asValue. |
|
639 |
]. |
|
640 |
^ cvsLoginEnabled. |
|
641 |
! |
|
642 |
||
643 |
cvsLoginInModuleEnabled |
|
644 |
cvsLoginInModuleEnabled isNil ifTrue:[ |
|
645 |
cvsLoginInModuleEnabled := false asValue. |
|
646 |
]. |
|
647 |
^ cvsLoginInModuleEnabled. |
|
648 |
! |
|
649 |
||
650 |
cvsRootHolder |
|
651 |
||
652 |
cvsRootHolder isNil ifTrue:[ |
|
653 |
cvsRootHolder := self cvsRootFromCVSRootFileOrNil asValue. |
|
654 |
cvsRootHolder addDependent:self. |
|
655 |
]. |
|
656 |
^ cvsRootHolder. |
|
657 |
! |
|
658 |
||
659 |
cvsRootPrototypeList |
|
660 |
|cvsRoot prototypeList| |
|
661 |
||
662 |
cvsRootPrototypeList isNil ifTrue:[ |
|
663 |
prototypeList := OrderedSet new. |
|
664 |
||
665 |
cvsRoot := self cvsRootFromCVSRootFileOrNil. |
|
666 |
cvsRoot notNil ifTrue:[ |
|
667 |
prototypeList add:cvsRoot |
|
668 |
]. |
|
669 |
||
670 |
prototypeList add:(':pserver:cvs@cvs.smalltalk-x.de:/cvs/stx'). |
|
671 |
||
672 |
OperatingSystem getDomainName = 'bh.exept.de' ifTrue:[ |
|
673 |
prototypeList add:(':pserver:' , OperatingSystem getLoginName , '@cvs.bh.exept.de:/cvs/stx') |
|
674 |
] ifFalse:[ |
|
675 |
prototypeList add:(':pserver:' , OperatingSystem getLoginName , '@CVSHOST:/cvs/stx'). |
|
676 |
]. |
|
677 |
||
678 |
OperatingSystem isUNIXlike ifTrue:[ |
|
679 |
prototypeList add:'/cvs/stx'. |
|
680 |
] ifFalse:[ |
|
681 |
OperatingSystem isMSDOSlike ifTrue:[ |
|
682 |
prototypeList addFirst:':local:c:\cvs\stx'. |
|
683 |
] ifFalse:[ |
|
684 |
"there might be more here in the future" |
|
685 |
] |
|
686 |
]. |
|
687 |
||
688 |
cvsRootPrototypeList := prototypeList asOrderedCollection. |
|
689 |
]. |
|
690 |
^ cvsRootPrototypeList. |
|
691 |
! |
|
692 |
||
693 |
listOfModules |
|
694 |
||
695 |
listOfModules isNil ifTrue:[ |
|
696 |
rootsPerModule notNil ifTrue:[ |
|
697 |
listOfModules := rootsPerModule keys asList. |
|
698 |
]. |
|
699 |
listOfModules sort. |
|
700 |
listOfModules onChangeSend:#updateModifiedChannel to:self |
|
701 |
]. |
|
702 |
^ listOfModules. |
|
703 |
! |
|
704 |
||
705 |
perModuleRoot |
|
706 |
perModuleRoot isNil ifTrue:[ |
|
707 |
perModuleRoot := ValueHolder new. |
|
708 |
perModuleRoot addDependent:self. |
|
709 |
]. |
|
710 |
^ perModuleRoot. |
|
711 |
! |
|
712 |
||
713 |
perModuleRootModule |
|
714 |
perModuleRootModule isNil ifTrue:[ |
|
715 |
perModuleRootModule := ValueHolder new. |
|
716 |
]. |
|
717 |
^ perModuleRootModule. |
|
718 |
! |
|
719 |
||
720 |
removeEnabled |
|
721 |
||
722 |
removeEnabled isNil ifTrue:[ |
|
723 |
removeEnabled := false asValue. |
|
724 |
]. |
|
725 |
^ removeEnabled. |
|
726 |
! |
|
727 |
||
728 |
selectedPerModuleRoot |
|
729 |
selectedPerModuleRoot isNil ifTrue:[ |
|
730 |
selectedPerModuleRoot := ValueHolder new. |
|
731 |
selectedPerModuleRoot addDependent:self. |
|
732 |
]. |
|
733 |
^ selectedPerModuleRoot. |
|
734 |
! |
|
735 |
||
736 |
sourceCacheDir |
|
737 |
sourceCacheDir isNil ifTrue:[ |
|
738 |
sourceCacheDir := ValueHolder new. |
|
739 |
sourceCacheDir onChangeSend:#updateModifiedChannel to:self |
|
740 |
]. |
|
741 |
^ sourceCacheDir. |
|
742 |
! |
|
743 |
||
744 |
verboseSourceCodeAccess |
|
745 |
verboseSourceCodeAccess isNil ifTrue:[ |
|
746 |
verboseSourceCodeAccess := false asValue. |
|
747 |
verboseSourceCodeAccess onChangeSend:#updateModifiedChannel to:self |
|
748 |
]. |
|
749 |
^ verboseSourceCodeAccess. |
|
750 |
! ! |
|
751 |
||
752 |
!CVSSourceCodeManagementSettingsAppl methodsFor:'change & update'! |
|
753 |
||
754 |
selectedPerModuleRootChanged |
|
755 |
|module entry| |
|
756 |
||
757 |
self acceptChannel value:true. |
|
758 |
module := self selectedPerModuleRoot value. |
|
759 |
module isNil ifTrue:[ |
|
760 |
self removeEnabled value:false. |
|
761 |
self perModuleRootModule value:' '. |
|
762 |
self perModuleRoot value:''. |
|
763 |
^ self |
|
764 |
]. |
|
765 |
||
766 |
entry := rootsPerModule at:module ifAbsent:#(). |
|
767 |
(entry first = CVSSourceCodeManager) ifTrue:[ |
|
768 |
self removeEnabled value:true. |
|
769 |
self perModuleRootModule value:module. |
|
770 |
self perModuleRoot value:(entry at:2). |
|
771 |
] ifFalse:[ |
|
772 |
self removeEnabled value:false. |
|
773 |
self perModuleRootModule value:module , ' ',('<<use ',entry first managerTypeName,'>>') allBold. |
|
774 |
self perModuleRoot value:''. |
|
775 |
]. |
|
776 |
! |
|
777 |
||
778 |
sourceDirChanged |
|
779 |
|nm fn previousDir| |
|
780 |
||
781 |
manager isNil ifTrue:[^ self]. |
|
782 |
||
783 |
previousDir := AbstractSourceCodeManager cacheDirectoryName. |
|
784 |
||
785 |
nm := self sourceCacheDir value. |
|
786 |
nm isEmptyOrNil ifTrue:[^ self]. |
|
787 |
||
788 |
(fn := nm asFilename) exists ifFalse:[ |
|
789 |
(self confirm:(resources |
|
790 |
stringWithCRs:'SourceCache directory "%1" does not exist.\Create ?' |
|
791 |
with:nm) |
|
792 |
) ifFalse:[ |
|
793 |
self sourceCacheDir value:previousDir. |
|
794 |
^ self. |
|
795 |
]. |
|
796 |
fn |
|
797 |
recursiveMakeDirectory; |
|
798 |
makeReadableForAll; |
|
799 |
makeWritableForAll; |
|
800 |
makeExecutableForAll. |
|
801 |
^ self. |
|
802 |
]. |
|
803 |
||
804 |
(fn isDirectory) ifFalse:[ |
|
805 |
self warn:(resources |
|
806 |
stringWithCRs:'Not a directory: "%1"' |
|
807 |
with:nm). |
|
808 |
self sourceCacheDir value:previousDir. |
|
809 |
^ self. |
|
810 |
]. |
|
811 |
||
812 |
(fn isReadable and:[fn isWritable]) ifFalse:[ |
|
813 |
(self confirm:(resources |
|
814 |
stringWithCRs:'SourceCache directory "%1" is not both readable and writable.\Change ?' |
|
815 |
with:nm) |
|
816 |
) ifFalse:[ |
|
817 |
self sourceCacheDir value:previousDir. |
|
818 |
^ self. |
|
819 |
]. |
|
820 |
fn |
|
821 |
makeReadableForAll; |
|
822 |
makeWritableForAll; |
|
823 |
makeExecutableForAll. |
|
824 |
]. |
|
825 |
"/ (fn isReadableForAll and:[fn isWritableForAll]) ifFalse:[ |
|
826 |
"/ (self confirm:(resources |
|
827 |
"/ stringWithCRs:'SourceCache directory "%1" is not both readable and writable for other users.\Change ?' |
|
828 |
"/ with:nm) |
|
829 |
"/ ) ifTrue:[ |
|
830 |
"/ fn |
|
831 |
"/ makeReadableForAll; |
|
832 |
"/ makeWritableForAll; |
|
833 |
"/ makeExecutableForAll. |
|
834 |
"/ ] |
|
835 |
"/ ]. |
|
836 |
! |
|
837 |
||
838 |
update:something with:aParameter from:changedObject |
|
839 |
"/ common |
|
840 |
changedObject == sourceCacheDir ifTrue:[ |
|
841 |
self sourceDirChanged. |
|
842 |
self updateModifiedChannel. |
|
843 |
^ self |
|
844 |
]. |
|
845 |
||
846 |
"/ cvs |
|
847 |
changedObject == cvsRootHolder ifTrue:[ |
|
848 |
self updateModifiedChannel. |
|
849 |
self updateLoginEnableHolders. |
|
850 |
^ self |
|
851 |
]. |
|
852 |
changedObject == perModuleRoot ifTrue:[ |
|
853 |
self updateLoginEnableHolders. |
|
854 |
^ self |
|
855 |
]. |
|
856 |
changedObject == selectedPerModuleRoot ifTrue:[ |
|
857 |
self selectedPerModuleRootChanged. |
|
858 |
^ self |
|
859 |
]. |
|
860 |
||
861 |
super update:something with:aParameter from:changedObject |
|
862 |
||
863 |
"Modified: / 18-04-2011 / 18:18:04 / cg" |
|
864 |
! |
|
865 |
||
866 |
updateLoginEnableHolders |
|
867 |
self cvsLoginEnabled value:((cvsRootHolder value ? '') startsWith:':pserver:'). |
|
868 |
self cvsLoginInModuleEnabled value:((perModuleRoot value ? '') startsWith:':pserver:'). |
|
869 |
! ! |
|
870 |
||
871 |
!CVSSourceCodeManagementSettingsAppl methodsFor:'help'! |
|
872 |
||
873 |
helpFilename |
|
874 |
^ 'Launcher/cvsSetup.html' |
|
875 |
! ! |
|
876 |
||
877 |
!CVSSourceCodeManagementSettingsAppl methodsFor:'initialization & release'! |
|
878 |
||
879 |
initialize |
|
880 |
(AbstractSourceCodeManager notNil) ifTrue:[ AbstractSourceCodeManager autoload ]. |
|
881 |
||
882 |
sourceCacheDir := nil asValue. |
|
883 |
sourceCacheDir addDependent:self. |
|
884 |
||
885 |
repositoryHolder := '' asValue. |
|
886 |
rootsPerModule := Dictionary new. |
|
887 |
||
888 |
(Array with:CVSSourceCodeManager) "self availableManagers" do:[:eachManager | |
|
889 |
eachManager repositoryInfoPerModule |
|
890 |
keysAndValuesDo:[:module :info | |
|
891 |
module withoutSeparators ~= module ifTrue:[ |
|
892 |
self halt:'should not happen any longer' |
|
893 |
]. |
|
894 |
rootsPerModule at:module put:(Array with:eachManager with:info) |
|
895 |
]. |
|
896 |
]. |
|
897 |
||
898 |
super initialize. |
|
899 |
||
10981 | 900 |
"Modified: / 21-12-2011 / 12:14:25 / cg" |
9822 | 901 |
! ! |
902 |
||
903 |
!CVSSourceCodeManagementSettingsAppl methodsFor:'queries'! |
|
904 |
||
905 |
cvsRootFromCVSRootFileOrNil |
|
906 |
|cvsDir cvsRootFile cvsRoot| |
|
907 |
||
908 |
cvsDir := 'CVS' asFilename. |
|
10999 | 909 |
cvsDir isDirectory ifFalse:[ ^ nil ]. |
910 |
||
911 |
cvsRootFile := cvsDir construct:'Root'. |
|
912 |
cvsRootFile isReadable ifTrue:[ |
|
913 |
cvsRoot := cvsRootFile contents firstIfEmpty:nil. |
|
9822 | 914 |
]. |
915 |
^ cvsRoot |
|
10999 | 916 |
|
917 |
"Modified: / 22-12-2011 / 00:12:42 / cg" |
|
9822 | 918 |
! |
919 |
||
920 |
hasUnsavedChanges |
|
10999 | 921 |
|modules| |
922 |
||
9822 | 923 |
((CVSSourceCodeManager cacheDirectoryName ? '') ~= (self sourceCacheDir value ? '')) ifTrue:[^ true]. |
924 |
||
10999 | 925 |
modules := rootsPerModule select:[:entry | entry first == CVSSourceCodeManager]. |
9822 | 926 |
|
10999 | 927 |
CVSSourceCodeManager repositoryInfoPerModule keysAndValuesDo:[:module :info | |
928 |
((modules includesKey:module) and:[info = (modules at:module) second]) |
|
929 |
ifFalse:[^ true]. |
|
930 |
]. |
|
931 |
modules keysAndValuesDo:[:module :info| |
|
932 |
((CVSSourceCodeManager repositoryInfoPerModule includesKey:module) and:[(CVSSourceCodeManager repositoryInfoPerModule at:module) = info second]) |
|
933 |
ifFalse:[^ true]. |
|
9822 | 934 |
]. |
935 |
||
936 |
((CVSSourceCodeManager cvsExecutable ? '') ~= (self cvsExecutableHolder value ? '') withoutSeparators) |
|
937 |
ifTrue:[^ true]. |
|
938 |
||
9845
bfb845fd9ff2
added: #defaultRepositoryName
Claus Gittinger <cg@exept.de>
parents:
9822
diff
changeset
|
939 |
(CVSSourceCodeManager repositoryName ? self class defaultRepositoryName ~= self cvsRootHolder value) |
9822 | 940 |
ifTrue:[^ true]. |
941 |
||
942 |
(CVSSourceCodeManager verboseSourceCodeAccess ~= self verboseSourceCodeAccess value) |
|
943 |
ifTrue:[^ true]. |
|
944 |
||
945 |
^ false |
|
946 |
||
10999 | 947 |
"Modified: / 22-12-2011 / 00:22:03 / cg" |
9822 | 948 |
! ! |
949 |
||
950 |
!CVSSourceCodeManagementSettingsAppl class methodsFor:'documentation'! |
|
951 |
||
10982 | 952 |
version |
10999 | 953 |
^ '$Header: /cvs/stx/stx/libtool/CVSSourceCodeManagementSettingsAppl.st,v 1.9 2011-12-22 09:00:17 cg Exp $' |
10982 | 954 |
! |
955 |
||
9822 | 956 |
version_CVS |
10999 | 957 |
^ '$Header: /cvs/stx/stx/libtool/CVSSourceCodeManagementSettingsAppl.st,v 1.9 2011-12-22 09:00:17 cg Exp $' |
9822 | 958 |
! ! |