718
|
1 |
"
|
|
2 |
Copyright (c) 2007-2010 Jan Vrany
|
|
3 |
Copyright (c) 2009-2010 eXept Software AG
|
|
4 |
|
|
5 |
Permission is hereby granted, free of charge, to any person
|
|
6 |
obtaining a copy of this software and associated documentation
|
|
7 |
files (the 'Software'), to deal in the Software without
|
|
8 |
restriction, including without limitation the rights to use,
|
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10 |
copies of the Software, and to permit persons to whom the
|
|
11 |
Software is furnished to do so, subject to the following
|
|
12 |
conditions:
|
|
13 |
|
|
14 |
The above copyright notice and this permission notice shall be
|
|
15 |
included in all copies or substantial portions of the Software.
|
|
16 |
|
|
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
24 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
25 |
"
|
467
|
26 |
"{ Package: 'stx:libsvn' }"
|
69
|
27 |
|
|
28 |
"{ NameSpace: SVN }"
|
|
29 |
|
|
30 |
Object subclass:#RepositoryConfiguration
|
|
31 |
instanceVariableNames:'package url'
|
|
32 |
classVariableNames:''
|
|
33 |
poolDictionaries:''
|
|
34 |
category:'SVN-Core'
|
|
35 |
!
|
|
36 |
|
718
|
37 |
!RepositoryConfiguration class methodsFor:'documentation'!
|
|
38 |
|
|
39 |
copyright
|
|
40 |
"
|
|
41 |
Copyright (c) 2007-2010 Jan Vrany
|
|
42 |
Copyright (c) 2009-2010 eXept Software AG
|
|
43 |
|
|
44 |
Permission is hereby granted, free of charge, to any person
|
|
45 |
obtaining a copy of this software and associated documentation
|
|
46 |
files (the 'Software'), to deal in the Software without
|
|
47 |
restriction, including without limitation the rights to use,
|
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
49 |
copies of the Software, and to permit persons to whom the
|
|
50 |
Software is furnished to do so, subject to the following
|
|
51 |
conditions:
|
|
52 |
|
|
53 |
The above copyright notice and this permission notice shall be
|
|
54 |
included in all copies or substantial portions of the Software.
|
|
55 |
|
|
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
63 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
64 |
|
|
65 |
"
|
|
66 |
! !
|
69
|
67 |
|
|
68 |
!RepositoryConfiguration class methodsFor:'instance creation'!
|
|
69 |
|
|
70 |
package: package url: url
|
|
71 |
|
|
72 |
^self new
|
|
73 |
package: package;
|
|
74 |
url: url
|
|
75 |
|
|
76 |
"Created: / 19-08-2009 / 12:17:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
77 |
! !
|
|
78 |
|
|
79 |
!RepositoryConfiguration methodsFor:'accessing'!
|
|
80 |
|
|
81 |
package
|
|
82 |
^ package
|
|
83 |
!
|
|
84 |
|
|
85 |
package:aString
|
|
86 |
package := aString.
|
|
87 |
!
|
|
88 |
|
|
89 |
packagePattern: aString
|
|
90 |
|
|
91 |
<resource: #obsolete>
|
|
92 |
|
|
93 |
self package: aString
|
|
94 |
|
|
95 |
"Created: / 16-08-2009 / 16:59:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
96 |
!
|
|
97 |
|
|
98 |
url
|
|
99 |
^ url
|
|
100 |
!
|
|
101 |
|
|
102 |
url: aStringOrUrl
|
|
103 |
| givenUrl |
|
|
104 |
|
|
105 |
givenUrl := aStringOrUrl asURL.
|
568
|
106 |
givenUrl isValidSvnRepositoryUrl ifTrue:[
|
|
107 |
url := givenUrl.
|
|
108 |
] ifFalse: [
|
|
109 |
self error: 'Invalid repository URL' mayProceed:true.
|
|
110 |
url := nil.
|
|
111 |
].
|
69
|
112 |
|
|
113 |
"Modified: / 16-08-2009 / 16:42:20 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
114 |
!
|
|
115 |
|
|
116 |
urlForPackage: pkg
|
|
117 |
|
|
118 |
| packageAsPath |
|
|
119 |
packageAsPath := pkg asString copy replaceAll:$: with:$/.
|
|
120 |
^url asString expandPlaceholdersWith:
|
|
121 |
(Dictionary new
|
|
122 |
at: 'p' put: packageAsPath;
|
|
123 |
yourself)
|
|
124 |
|
|
125 |
"Created: / 16-08-2009 / 16:56:22 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
126 |
!
|
|
127 |
|
|
128 |
urlPattern: aString
|
|
129 |
|
|
130 |
<resource: #obsolete>
|
|
131 |
|
|
132 |
self url: aString
|
|
133 |
|
|
134 |
"Created: / 16-08-2009 / 16:59:45 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
135 |
!
|
|
136 |
|
|
137 |
urlString
|
231
|
138 |
url isNil ifTrue: [^''].
|
69
|
139 |
^ url urlPrintString
|
|
140 |
|
|
141 |
"Created: / 16-08-2009 / 17:28:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
142 |
! !
|
|
143 |
|
|
144 |
!RepositoryConfiguration methodsFor:'comparing'!
|
|
145 |
|
|
146 |
= anotherConf
|
|
147 |
|
|
148 |
^self class == anotherConf class
|
|
149 |
and:[package = anotherConf package
|
|
150 |
and:[url = anotherConf url]].
|
|
151 |
|
|
152 |
"Created: / 25-05-2009 / 18:54:47 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
153 |
"Modified: / 16-08-2009 / 17:24:37 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
154 |
!
|
|
155 |
|
|
156 |
hash
|
|
157 |
|
|
158 |
^package hash bitXor:
|
|
159 |
url hash
|
|
160 |
|
|
161 |
"Created: / 25-05-2009 / 18:53:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
162 |
! !
|
|
163 |
|
|
164 |
!RepositoryConfiguration methodsFor:'converting'!
|
|
165 |
|
|
166 |
literalArrayEncoding
|
|
167 |
|
|
168 |
^Array
|
|
169 |
with: self class name
|
|
170 |
with: #package:
|
|
171 |
with: package literalArrayEncoding
|
|
172 |
with: #url:
|
|
173 |
with: url asString.
|
|
174 |
|
|
175 |
"
|
718
|
176 |
(SVN::RepositoryConfiguration package:'stx:libsvn' url: 'http://smalltalk.felk.cvut.cz/svn/stx/goodies/libsvn')
|
69
|
177 |
literalArrayEncoding
|
|
178 |
decodeAsLiteralArray
|
|
179 |
|
|
180 |
"
|
|
181 |
|
|
182 |
"Created: / 19-08-2009 / 21:56:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
183 |
! !
|
|
184 |
|
|
185 |
!RepositoryConfiguration methodsFor:'printing & storing'!
|
|
186 |
|
|
187 |
printOn:aStream
|
|
188 |
"append a printed representation if the receiver to the argument, aStream"
|
|
189 |
|
|
190 |
self class storeOn:aStream.
|
|
191 |
aStream space.
|
|
192 |
aStream nextPutAll:'package: '.
|
|
193 |
package storeOn:aStream.
|
|
194 |
aStream space.
|
|
195 |
aStream nextPutAll:'url: '.
|
|
196 |
url asString storeOn:aStream.
|
|
197 |
|
|
198 |
"Modified: / 19-08-2009 / 12:18:04 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
199 |
! !
|
|
200 |
|
|
201 |
!RepositoryConfiguration methodsFor:'queries'!
|
|
202 |
|
|
203 |
matchesPackage: pkg
|
|
204 |
|
|
205 |
^pkg
|
|
206 |
ifNil:[false]
|
|
207 |
ifNotNil:[pkg matches: package]
|
|
208 |
|
|
209 |
"Created: / 26-05-2008 / 09:36:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
210 |
"Modified: / 16-08-2009 / 16:29:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
211 |
! !
|
|
212 |
|
|
213 |
!RepositoryConfiguration class methodsFor:'documentation'!
|
|
214 |
|
|
215 |
version
|
|
216 |
^ '$Header$'
|
195
|
217 |
!
|
|
218 |
|
|
219 |
version_CVS
|
|
220 |
^ '$Header$'
|
|
221 |
!
|
|
222 |
|
|
223 |
version_SVN
|
718
|
224 |
^ '§Id: SVN__RepositoryConfiguration.st 350 2011-07-07 18:42:56Z vranyj1 §'
|
69
|
225 |
! !
|