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