author | Claus Gittinger <cg@exept.de> |
Mon, 12 Apr 2010 13:42:32 +0200 | |
changeset 568 | 073adf9e4ccc |
parent 467 | c24d39535de8 |
child 718 | 6da6d4d1ffe6 |
permissions | -rw-r--r-- |
467 | 1 |
"{ Package: 'stx:libsvn' }" |
69 | 2 |
|
3 |
"{ NameSpace: SVN }" |
|
4 |
||
5 |
Object subclass:#RepositoryConfiguration |
|
6 |
instanceVariableNames:'package url' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'SVN-Core' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!RepositoryConfiguration class methodsFor:'instance creation'! |
|
14 |
||
15 |
package: package url: url |
|
16 |
||
17 |
^self new |
|
18 |
package: package; |
|
19 |
url: url |
|
20 |
||
21 |
"Created: / 19-08-2009 / 12:17:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
22 |
! ! |
|
23 |
||
24 |
!RepositoryConfiguration methodsFor:'accessing'! |
|
25 |
||
26 |
package |
|
27 |
^ package |
|
28 |
! |
|
29 |
||
30 |
package:aString |
|
31 |
package := aString. |
|
32 |
! |
|
33 |
||
34 |
packagePattern: aString |
|
35 |
||
36 |
<resource: #obsolete> |
|
37 |
||
38 |
self package: aString |
|
39 |
||
40 |
"Created: / 16-08-2009 / 16:59:27 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
41 |
! |
|
42 |
||
43 |
url |
|
44 |
^ url |
|
45 |
! |
|
46 |
||
47 |
url: aStringOrUrl |
|
48 |
| givenUrl | |
|
49 |
||
50 |
givenUrl := aStringOrUrl asURL. |
|
568 | 51 |
givenUrl isValidSvnRepositoryUrl ifTrue:[ |
52 |
url := givenUrl. |
|
53 |
] ifFalse: [ |
|
54 |
self error: 'Invalid repository URL' mayProceed:true. |
|
55 |
url := nil. |
|
56 |
]. |
|
69 | 57 |
|
58 |
"Modified: / 16-08-2009 / 16:42:20 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
59 |
! |
|
60 |
||
61 |
urlForPackage: pkg |
|
62 |
||
63 |
| packageAsPath | |
|
64 |
packageAsPath := pkg asString copy replaceAll:$: with:$/. |
|
65 |
^url asString expandPlaceholdersWith: |
|
66 |
(Dictionary new |
|
67 |
at: 'p' put: packageAsPath; |
|
68 |
yourself) |
|
69 |
||
70 |
"Created: / 16-08-2009 / 16:56:22 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
71 |
! |
|
72 |
||
73 |
urlPattern: aString |
|
74 |
||
75 |
<resource: #obsolete> |
|
76 |
||
77 |
self url: aString |
|
78 |
||
79 |
"Created: / 16-08-2009 / 16:59:45 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
80 |
! |
|
81 |
||
82 |
urlString |
|
231 | 83 |
url isNil ifTrue: [^'']. |
69 | 84 |
^ url urlPrintString |
85 |
||
86 |
"Created: / 16-08-2009 / 17:28:44 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
87 |
! ! |
|
88 |
||
89 |
!RepositoryConfiguration methodsFor:'comparing'! |
|
90 |
||
91 |
= anotherConf |
|
92 |
||
93 |
^self class == anotherConf class |
|
94 |
and:[package = anotherConf package |
|
95 |
and:[url = anotherConf url]]. |
|
96 |
||
97 |
"Created: / 25-05-2009 / 18:54:47 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
98 |
"Modified: / 16-08-2009 / 17:24:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
99 |
! |
|
100 |
||
101 |
hash |
|
102 |
||
103 |
^package hash bitXor: |
|
104 |
url hash |
|
105 |
||
106 |
"Created: / 25-05-2009 / 18:53:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
107 |
! ! |
|
108 |
||
109 |
!RepositoryConfiguration methodsFor:'converting'! |
|
110 |
||
111 |
literalArrayEncoding |
|
112 |
||
113 |
^Array |
|
114 |
with: self class name |
|
115 |
with: #package: |
|
116 |
with: package literalArrayEncoding |
|
117 |
with: #url: |
|
118 |
with: url asString. |
|
119 |
||
120 |
" |
|
121 |
(SVN::RepositoryConfiguration package:'stx:goodies/libsvn' url: 'http://smalltalk.felk.cvut.cz/svn/stx/goodies/libsvn') |
|
122 |
literalArrayEncoding |
|
123 |
decodeAsLiteralArray |
|
124 |
||
125 |
" |
|
126 |
||
127 |
"Created: / 19-08-2009 / 21:56:21 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
128 |
! ! |
|
129 |
||
130 |
!RepositoryConfiguration methodsFor:'printing & storing'! |
|
131 |
||
132 |
printOn:aStream |
|
133 |
"append a printed representation if the receiver to the argument, aStream" |
|
134 |
||
135 |
self class storeOn:aStream. |
|
136 |
aStream space. |
|
137 |
aStream nextPutAll:'package: '. |
|
138 |
package storeOn:aStream. |
|
139 |
aStream space. |
|
140 |
aStream nextPutAll:'url: '. |
|
141 |
url asString storeOn:aStream. |
|
142 |
||
143 |
"Modified: / 19-08-2009 / 12:18:04 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
144 |
! ! |
|
145 |
||
146 |
!RepositoryConfiguration methodsFor:'queries'! |
|
147 |
||
148 |
matchesPackage: pkg |
|
149 |
||
150 |
^pkg |
|
151 |
ifNil:[false] |
|
152 |
ifNotNil:[pkg matches: package] |
|
153 |
||
154 |
"Created: / 26-05-2008 / 09:36:27 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
155 |
"Modified: / 16-08-2009 / 16:29:21 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
156 |
! ! |
|
157 |
||
158 |
!RepositoryConfiguration class methodsFor:'documentation'! |
|
159 |
||
160 |
version |
|
161 |
^ '$Header$' |
|
195 | 162 |
! |
163 |
||
164 |
version_CVS |
|
165 |
^ '$Header$' |
|
166 |
! |
|
167 |
||
168 |
version_SVN |
|
361
aea6288f6543
update #version_SVN with § as keyword expansion character
fm
parents:
231
diff
changeset
|
169 |
^'§Id: SVN__RepositoryConfiguration.st 111 2009-08-19 20:07:10Z vranyj1 §' |
69 | 170 |
! ! |