author | fm |
Mon, 19 Oct 2009 14:24:52 +0200 | |
changeset 481 | 175de20d9238 |
parent 287 | 64cc6e8db3df |
child 608 | a39e09f70a19 |
permissions | -rw-r--r-- |
481 | 1 |
"{ Package: 'stx:libsvn' }" |
33 | 2 |
|
3 |
"{ NameSpace: SVN }" |
|
4 |
||
5 |
Object subclass:#Repository |
|
6 |
instanceVariableNames:'manager package url credentials workingCopy' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'SVN-Core' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!Repository class methodsFor:'instance creation'! |
|
14 |
||
15 |
package: package url: url |
|
16 |
||
17 |
^self new |
|
18 |
package: package; |
|
19 |
url: url; |
|
20 |
yourself |
|
21 |
||
22 |
"Created: / 19-08-2009 / 12:24:29 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
23 |
! ! |
|
24 |
||
25 |
!Repository class methodsFor:'accessing - containers'! |
|
26 |
||
27 |
containerNameForClass: cls |
|
28 |
||
29 |
^(self containerNameWithoutSuffixForClass: cls) , '.' , cls sourceFileSuffix |
|
30 |
||
31 |
"Created: / 19-04-2008 / 17:24:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
32 |
"Modified: / 13-08-2009 / 15:26:22 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
33 |
! |
|
34 |
||
35 |
containerNameForExtensions |
|
36 |
||
37 |
^'extensions.st' |
|
38 |
||
39 |
"Created: / 19-04-2008 / 17:25:24 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
40 |
! |
|
41 |
||
42 |
containerNameWithoutSuffixForClass: cls |
|
43 |
||
44 |
^self containerNameWithoutSuffixForClassNamed: |
|
45 |
cls theNonMetaclass fullName |
|
46 |
||
47 |
"Created: / 13-08-2009 / 15:25:36 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
48 |
! |
|
49 |
||
50 |
containerNameWithoutSuffixForClassNamed: clsName |
|
51 |
||
52 |
| containerName | |
|
53 |
containerName := clsName copyReplaceAll:$: with:$_. |
|
54 |
"/Transcript showCR:'Container for ',clsName, ' is ' , containerName. |
|
55 |
^containerName. |
|
56 |
||
57 |
"Created: / 13-08-2009 / 15:24:51 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
58 |
! ! |
|
59 |
||
60 |
!Repository methodsFor:'accessing'! |
|
61 |
||
62 |
branch |
|
63 |
||
64 |
^self workingCopy branch |
|
65 |
||
66 |
"Created: / 19-04-2008 / 18:25:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
67 |
! |
|
68 |
||
69 |
branches |
|
70 |
||
71 |
^self branchesAndTags reject:[:branch|branch isTag] |
|
72 |
||
73 |
"Modified: / 14-04-2008 / 11:02:07 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
74 |
! |
|
75 |
||
76 |
branchesAndTags |
|
77 |
| topLevelDirs branches | |
|
78 |
||
79 |
branches := OrderedCollection new. |
|
80 |
topLevelDirs := ListCommand list: url. |
|
81 |
"Try trunk branch" |
|
82 |
(topLevelDirs anySatisfy: [:entry | entry path = 'trunk' ]) |
|
83 |
ifTrue: |
|
84 |
[ branches add: ((Branch new) |
|
85 |
repository: self; |
|
86 |
path: '/trunk/') ] |
|
87 |
ifFalse: |
|
88 |
[ branches add: ((Branch new) |
|
89 |
repository: self; |
|
90 |
path: ''). |
|
91 |
^ branches ]. |
|
92 |
"Try branches" |
|
93 |
(topLevelDirs anySatisfy: [:entry | entry path = 'branches' ]) |
|
94 |
ifTrue: |
|
95 |
[ (ListCommand list: url , '/branches/') do: |
|
96 |
[:branchEntry | |
|
97 |
branches add: ((Branch new) |
|
98 |
repository: self; |
|
99 |
path: '/branches/' , branchEntry path) ] ]. |
|
100 |
"Try tags" |
|
101 |
(topLevelDirs anySatisfy: [:entry | entry path = 'tags' ]) |
|
102 |
ifTrue: |
|
103 |
[ (ListCommand list: url , '/tags/') do: |
|
104 |
[:branchEntry | |
|
105 |
branches add: ((Branch new) |
|
106 |
repository: self; |
|
107 |
path: '/tags/' , branchEntry path) ] ]. |
|
108 |
^ branches. |
|
109 |
||
110 |
"Created: / 14-04-2008 / 11:01:15 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
111 |
"Modified: / 19-08-2009 / 13:27:48 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
112 |
! |
|
113 |
||
114 |
manager |
|
115 |
^ manager |
|
116 |
||
117 |
"Created: / 03-10-2008 / 15:41:49 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
118 |
! |
|
119 |
||
120 |
manager:aRepositoryManager |
|
121 |
manager := aRepositoryManager. |
|
122 |
||
123 |
"Created: / 03-10-2008 / 15:41:49 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
124 |
! |
|
125 |
||
126 |
package |
|
127 |
^ package |
|
128 |
||
129 |
"Created: / 15-03-2008 / 20:22:51 / janfrog" |
|
130 |
! |
|
131 |
||
132 |
package:something |
|
133 |
package := something. |
|
134 |
||
135 |
"Created: / 15-03-2008 / 20:22:51 / janfrog" |
|
136 |
! |
|
137 |
||
138 |
packageClasses |
|
139 |
||
140 |
^self workingCopy packageClasses |
|
141 |
||
142 |
"Created: / 19-04-2008 / 19:07:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
143 |
! |
|
144 |
||
145 |
packageExtensions |
|
146 |
||
147 |
^self workingCopy packageExtensions |
|
148 |
||
149 |
"Created: / 19-04-2008 / 19:07:52 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
150 |
! |
|
151 |
||
152 |
url |
|
153 |
^ url |
|
154 |
||
155 |
"Created: / 15-03-2008 / 20:21:30 / janfrog" |
|
156 |
! |
|
157 |
||
158 |
url:aString |
|
159 |
url := aString. |
|
160 |
||
161 |
"Created: / 15-03-2008 / 20:21:30 / janfrog" |
|
162 |
! |
|
163 |
||
164 |
workingCopy |
|
165 |
^ workingCopy |
|
166 |
||
167 |
"Created: / 15-03-2008 / 20:30:13 / janfrog" |
|
168 |
! |
|
169 |
||
170 |
workingCopy:aWorkingCopy |
|
171 |
workingCopy := aWorkingCopy. |
|
172 |
workingCopy repository: self. |
|
173 |
||
174 |
"Created: / 15-03-2008 / 20:30:13 / janfrog" |
|
175 |
"Modified: / 31-03-2008 / 12:47:43 / janfrog" |
|
176 |
! ! |
|
177 |
||
178 |
!Repository methodsFor:'accessing - containers'! |
|
179 |
||
180 |
containerNameForClass:arg |
|
181 |
^ self class containerNameForClass:arg |
|
182 |
! |
|
183 |
||
184 |
containerNameForExtensions |
|
185 |
^ self class containerNameForExtensions |
|
186 |
! ! |
|
187 |
||
188 |
!Repository methodsFor:'accessing - tasks'! |
|
189 |
||
190 |
commitTask |
|
191 |
||
192 |
^self workingCopy commitTask |
|
193 |
||
194 |
"Created: / 24-03-2009 / 15:14:31 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
195 |
! |
|
196 |
||
197 |
updateTask |
|
198 |
||
199 |
^self workingCopy updateTask |
|
200 |
||
201 |
"Created: / 24-03-2009 / 15:14:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
202 |
! ! |
|
203 |
||
204 |
!Repository methodsFor:'comparing'! |
|
205 |
||
206 |
= anotherRepo |
|
207 |
||
208 |
^self class = anotherRepo class |
|
209 |
and:[self url = anotherRepo url |
|
210 |
and:[self package = anotherRepo package]] |
|
211 |
||
212 |
"Created: / 31-03-2008 / 14:39:29 / janfrog" |
|
213 |
! |
|
214 |
||
215 |
hash |
|
216 |
||
217 |
^url hash bitXor: package hash |
|
218 |
||
219 |
"Created: / 31-03-2008 / 14:39:57 / janfrog" |
|
220 |
! ! |
|
221 |
||
222 |
!Repository methodsFor:'error reporting'! |
|
223 |
||
224 |
svnError: aMessage |
|
225 |
||
226 |
self error: aMessage |
|
227 |
||
228 |
"Created: / 19-03-2008 / 10:00:55 / janfrog" |
|
229 |
! ! |
|
230 |
||
231 |
!Repository methodsFor:'queries'! |
|
232 |
||
233 |
exists |
|
234 |
||
235 |
^[ |
|
236 |
ListCommand new |
|
237 |
branch: self; |
|
238 |
execute. |
|
239 |
true |
|
240 |
] on: SVN::Error do:[ false ] |
|
241 |
||
242 |
"Created: / 16-03-2008 / 12:12:17 / janfrog" |
|
243 |
"Modified: / 19-08-2009 / 13:08:25 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
244 |
! ! |
|
245 |
||
246 |
!Repository class methodsFor:'documentation'! |
|
247 |
||
248 |
version |
|
249 |
^ '$Header$' |
|
183 | 250 |
! |
251 |
||
252 |
version_CVS |
|
253 |
^ '$Header$' |
|
254 |
! |
|
255 |
||
256 |
version_SVN |
|
287
64cc6e8db3df
update #version_SVN with § as keyword expansion character
fm
parents:
183
diff
changeset
|
257 |
^'§Id: SVN__Repository.st 110 2009-08-19 13:21:10Z vranyj1 §' |
33 | 258 |
! ! |