112
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
MCRepository subclass:#MCGOODSRepository
|
|
4 |
instanceVariableNames:'hostname port connection'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
631
|
7 |
category:'SCM-Monticello-Repositories'
|
112
|
8 |
!
|
|
9 |
|
|
10 |
|
905
|
11 |
!MCGOODSRepository class methodsFor:'instance creation'!
|
|
12 |
|
|
13 |
host: hostname port: portNumber
|
|
14 |
^ self new
|
|
15 |
host: hostname;
|
|
16 |
port: portNumber
|
|
17 |
! !
|
|
18 |
|
|
19 |
!MCGOODSRepository class methodsFor:'queries'!
|
112
|
20 |
|
|
21 |
creationTemplate
|
|
22 |
^
|
|
23 |
'MCGOODSRepository
|
|
24 |
host: ''localhost''
|
|
25 |
port: 6100'
|
|
26 |
!
|
|
27 |
|
|
28 |
description
|
|
29 |
^ 'GOODS'
|
|
30 |
! !
|
|
31 |
|
905
|
32 |
!MCGOODSRepository methodsFor:'accessing'!
|
112
|
33 |
|
|
34 |
description
|
|
35 |
^ 'goods://', hostname asString, ':', port asString
|
|
36 |
!
|
|
37 |
|
|
38 |
host: aString
|
215
|
39 |
hostname := aString
|
112
|
40 |
!
|
|
41 |
|
|
42 |
packages
|
|
43 |
^ (self root collect: [:ea | ea package]) asSet asSortedCollection
|
|
44 |
!
|
|
45 |
|
|
46 |
port: aNumber
|
215
|
47 |
port := aNumber
|
905
|
48 |
! !
|
|
49 |
|
|
50 |
!MCGOODSRepository methodsFor:'as yet unclassified'!
|
|
51 |
|
|
52 |
db
|
|
53 |
(connection isNil or: [connection isConnected not]) ifTrue: [
|
|
54 |
connection := Smalltalk at: #KKDatabase ifPresent: [:cl |
|
|
55 |
cl onHost:hostname port: port
|
|
56 |
]
|
|
57 |
].
|
|
58 |
^ connection
|
112
|
59 |
!
|
|
60 |
|
|
61 |
root
|
|
62 |
self db root ifNil: [self db root: Dictionary new].
|
|
63 |
^ self db root
|
|
64 |
!
|
|
65 |
|
|
66 |
versionWithInfo: aVersionInfo ifAbsent: errorBlock
|
|
67 |
^ self root at: aVersionInfo ifAbsent: errorBlock
|
905
|
68 |
! !
|
|
69 |
|
|
70 |
!MCGOODSRepository methodsFor:'printing & storing'!
|
|
71 |
|
|
72 |
basicStoreVersion: aVersion
|
|
73 |
self root at: aVersion info put: aVersion.
|
|
74 |
self db commit.
|
|
75 |
! !
|
|
76 |
|
|
77 |
!MCGOODSRepository methodsFor:'queries'!
|
112
|
78 |
|
|
79 |
versionsAvailableForPackage: aPackage
|
|
80 |
^ self root asArray select: [:ea | ea package = aPackage] thenCollect: [:ea | ea info]
|
|
81 |
! !
|
|
82 |
|
|
83 |
!MCGOODSRepository class methodsFor:'documentation'!
|
|
84 |
|
|
85 |
version
|
905
|
86 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCGOODSRepository.st,v 1.5 2014-02-12 14:53:36 cg Exp $'
|
215
|
87 |
!
|
|
88 |
|
|
89 |
version_CVS
|
905
|
90 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCGOODSRepository.st,v 1.5 2014-02-12 14:53:36 cg Exp $'
|
215
|
91 |
!
|
|
92 |
|
|
93 |
version_SVN
|
905
|
94 |
^ '$Id: MCGOODSRepository.st,v 1.5 2014-02-12 14:53:36 cg Exp $'
|
112
|
95 |
! !
|
905
|
96 |
|