775
|
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 |
"
|
403
|
26 |
"{ Package: 'stx:libsvn' }"
|
9
|
27 |
|
|
28 |
"{ NameSpace: SVN }"
|
|
29 |
|
|
30 |
Browser subclass:#WorkingCopyBrowser
|
|
31 |
instanceVariableNames:''
|
|
32 |
classVariableNames:''
|
|
33 |
poolDictionaries:''
|
|
34 |
category:'SVN-UI-Browsers'
|
|
35 |
!
|
|
36 |
|
775
|
37 |
!WorkingCopyBrowser 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 |
! !
|
|
67 |
|
|
68 |
!WorkingCopyBrowser class methodsFor:'instance creation'!
|
|
69 |
|
|
70 |
on: aWorkingCopy
|
|
71 |
|
|
72 |
^self new workingCopy: aWorkingCopy
|
|
73 |
! !
|
9
|
74 |
|
|
75 |
!WorkingCopyBrowser class methodsFor:'interface specs'!
|
|
76 |
|
|
77 |
windowSpec
|
|
78 |
"This resource specification was automatically generated
|
|
79 |
by the UIPainter of ST/X."
|
|
80 |
|
|
81 |
"Do not manually edit this!! If it is corrupted,
|
|
82 |
the UIPainter may not be able to read the specification."
|
|
83 |
|
|
84 |
"
|
775
|
85 |
UIPainter new openOnClass:SVN::WorkingCopyBrowser andSelector:#windowSpec
|
|
86 |
SVN::WorkingCopyBrowser new openInterface:#windowSpec
|
|
87 |
SVN::WorkingCopyBrowser open
|
9
|
88 |
"
|
|
89 |
|
|
90 |
<resource: #canvas>
|
|
91 |
|
|
92 |
^
|
|
93 |
#(FullSpec
|
|
94 |
name: windowSpec
|
|
95 |
window:
|
|
96 |
(WindowSpec
|
|
97 |
label: 'Working Copy Status'
|
|
98 |
name: 'Working Copy Status'
|
|
99 |
min: (Point 10 10)
|
|
100 |
bounds: (Rectangle 0 0 300 300)
|
|
101 |
)
|
|
102 |
component:
|
|
103 |
(SpecCollection
|
|
104 |
collection: (
|
|
105 |
(DataSetSpec
|
|
106 |
name: 'WCEntryTable'
|
|
107 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
|
|
108 |
model: selectionHolder
|
775
|
109 |
menu: entryMenu
|
9
|
110 |
hasHorizontalScrollBar: true
|
|
111 |
hasVerticalScrollBar: true
|
|
112 |
dataList: workingCopyEntriesAspect
|
|
113 |
useIndex: false
|
|
114 |
columnHolder: wcEntryTableColumns
|
|
115 |
)
|
|
116 |
(CheckBoxSpec
|
|
117 |
label: 'Show only changed etries'
|
|
118 |
name: 'ShowOnlyChanged'
|
|
119 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
|
|
120 |
model: showOnlyChanged
|
|
121 |
translateLabel: true
|
|
122 |
)
|
|
123 |
)
|
|
124 |
|
|
125 |
)
|
|
126 |
)
|
|
127 |
! !
|
|
128 |
|
|
129 |
!WorkingCopyBrowser class methodsFor:'menu specs'!
|
|
130 |
|
775
|
131 |
entryMenu
|
9
|
132 |
"This resource specification was automatically generated
|
|
133 |
by the MenuEditor of ST/X."
|
|
134 |
|
|
135 |
"Do not manually edit this!! If it is corrupted,
|
|
136 |
the MenuEditor may not be able to read the specification."
|
|
137 |
|
|
138 |
"
|
775
|
139 |
MenuEditor new openOnClass:SVN::WorkingCopyBrowser andSelector:#entryMenu
|
|
140 |
(Menu new fromLiteralArrayEncoding:(SVN::WorkingCopyBrowser entryMenu)) startUp
|
9
|
141 |
"
|
|
142 |
|
|
143 |
<resource: #menu>
|
|
144 |
|
|
145 |
^
|
|
146 |
#(Menu
|
|
147 |
(
|
|
148 |
(MenuItem
|
775
|
149 |
label: 'Show changes'
|
|
150 |
itemValue: entryMenuShowChanges
|
9
|
151 |
translateLabel: true
|
775
|
152 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' compare 'Show changes')
|
9
|
153 |
)
|
|
154 |
(MenuItem
|
775
|
155 |
label: '-'
|
|
156 |
)
|
|
157 |
(MenuItem
|
|
158 |
label: 'Revert'
|
|
159 |
itemValue: entryMenuRevert
|
9
|
160 |
translateLabel: true
|
775
|
161 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' revert 'Revert')
|
9
|
162 |
)
|
|
163 |
)
|
|
164 |
nil
|
|
165 |
nil
|
|
166 |
)
|
775
|
167 |
! !
|
9
|
168 |
|
775
|
169 |
!WorkingCopyBrowser class methodsFor:'others'!
|
|
170 |
|
|
171 |
version_CVS
|
|
172 |
^ '$Header$'
|
9
|
173 |
! !
|
|
174 |
|
|
175 |
!WorkingCopyBrowser class methodsFor:'plugIn spec'!
|
|
176 |
|
|
177 |
aspectSelectors
|
|
178 |
"This resource specification was automatically generated
|
|
179 |
by the UIPainter of ST/X."
|
|
180 |
|
|
181 |
"Do not manually edit this. If it is corrupted,
|
|
182 |
the UIPainter may not be able to read the specification."
|
|
183 |
|
|
184 |
"Return a description of exported aspects;
|
|
185 |
these can be connected to aspects of an embedding application
|
|
186 |
(if this app is embedded in a subCanvas)."
|
|
187 |
|
|
188 |
^ #(
|
|
189 |
#model
|
|
190 |
).
|
|
191 |
|
|
192 |
! !
|
|
193 |
|
|
194 |
!WorkingCopyBrowser class methodsFor:'tableColumns specs'!
|
|
195 |
|
|
196 |
wcEntryTableColumns
|
|
197 |
"This resource specification was automatically generated
|
|
198 |
by the DataSetBuilder of ST/X."
|
|
199 |
|
|
200 |
"Do not manually edit this!! If it is corrupted,
|
|
201 |
the DataSetBuilder may not be able to read the specification."
|
|
202 |
|
|
203 |
"
|
|
204 |
DataSetBuilder new openOnClass:SVN::WorkingCopyStatusUI andSelector:#wcEntryTableColumns
|
|
205 |
"
|
|
206 |
|
|
207 |
<resource: #tableColumns>
|
|
208 |
|
|
209 |
^#(
|
|
210 |
(DataSetColumnSpec
|
|
211 |
label: ''
|
|
212 |
activeHelpKey: ''
|
|
213 |
labelButtonType: Button
|
|
214 |
printSelector: statusIcon
|
|
215 |
canSelect: false
|
|
216 |
showRowSeparator: false
|
|
217 |
showColSeparator: false
|
|
218 |
)
|
|
219 |
(DataSetColumnSpec
|
|
220 |
label: 'Container'
|
|
221 |
activeHelpKey: ''
|
|
222 |
labelButtonType: Button
|
|
223 |
printSelector: pathText
|
|
224 |
canSelect: false
|
|
225 |
showRowSeparator: false
|
|
226 |
showColSeparator: false
|
|
227 |
)
|
|
228 |
(DataSetColumnSpec
|
|
229 |
label: 'Rev'
|
|
230 |
activeHelpKey: ''
|
|
231 |
labelButtonType: Button
|
|
232 |
printSelector: revision
|
|
233 |
canSelect: false
|
|
234 |
showRowSeparator: false
|
|
235 |
showColSeparator: false
|
|
236 |
)
|
|
237 |
(DataSetColumnSpec
|
|
238 |
label: 'Author'
|
|
239 |
activeHelpKey: ''
|
|
240 |
labelButtonType: Button
|
|
241 |
printSelector: author
|
|
242 |
canSelect: false
|
|
243 |
showRowSeparator: false
|
|
244 |
showColSeparator: false
|
|
245 |
)
|
|
246 |
(DataSetColumnSpec
|
|
247 |
label: 'Date'
|
|
248 |
activeHelpKey: ''
|
|
249 |
labelButtonType: Button
|
|
250 |
printSelector: date
|
|
251 |
canSelect: false
|
|
252 |
showRowSeparator: false
|
|
253 |
showColSeparator: false
|
|
254 |
)
|
|
255 |
)
|
|
256 |
|
|
257 |
"Modified: / 18-08-2009 / 14:31:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
258 |
! !
|
|
259 |
|
|
260 |
!WorkingCopyBrowser methodsFor:'accessing'!
|
|
261 |
|
|
262 |
workingCopy
|
|
263 |
|
|
264 |
^self model
|
|
265 |
|
|
266 |
"Created: / 11-04-2008 / 10:20:36 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
267 |
"Modified: / 12-04-2008 / 21:02:26 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
268 |
!
|
|
269 |
|
|
270 |
workingCopy: aWorkingCopy
|
|
271 |
|
|
272 |
self model: aWorkingCopy
|
|
273 |
|
|
274 |
"Created: / 11-04-2008 / 10:20:22 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
275 |
"Modified: / 12-04-2008 / 21:02:34 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
276 |
! !
|
|
277 |
|
|
278 |
!WorkingCopyBrowser methodsFor:'aspects'!
|
|
279 |
|
|
280 |
showOnlyChanged
|
|
281 |
|
|
282 |
|holder|
|
|
283 |
|
|
284 |
(holder := builder bindingAt:#showOnlyChanged) isNil ifTrue:[
|
|
285 |
holder := true asValue.
|
|
286 |
holder onChangeEvaluate:
|
|
287 |
[self model changed].
|
|
288 |
builder aspectAt:#showOnlyChanged put:holder.
|
|
289 |
].
|
|
290 |
^ holder.
|
|
291 |
|
|
292 |
"Created: / 21-10-2008 / 18:53:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
293 |
!
|
|
294 |
|
|
295 |
workingCopyEntriesAspect
|
|
296 |
|
|
297 |
|
|
298 |
|holder|
|
|
299 |
|
|
300 |
(holder := builder bindingAt:#workingCopyEntriesAspect) isNil ifTrue:[
|
|
301 |
holder := (PluggableAdaptor on: self modelHolder)
|
|
302 |
getBlock:[:model|self workingCopyEntries]
|
|
303 |
putBlock:[:model :value|self error:'Should never be sent']
|
|
304 |
updateBlock:[:model :aspect :value|true].
|
|
305 |
builder aspectAt:#workingCopyEntriesAspect put:holder.
|
|
306 |
].
|
|
307 |
^ holder.
|
|
308 |
|
|
309 |
"Created: / 11-04-2008 / 10:24:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
310 |
"Modified: / 21-10-2008 / 18:55:05 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
311 |
! !
|
|
312 |
|
|
313 |
!WorkingCopyBrowser methodsFor:'hooks'!
|
|
314 |
|
|
315 |
commonPostBuild
|
|
316 |
|
|
317 |
^self model changed
|
|
318 |
|
|
319 |
"Created: / 11-04-2008 / 10:33:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
320 |
"Modified: / 12-04-2008 / 21:05:05 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
321 |
! !
|
|
322 |
|
|
323 |
!WorkingCopyBrowser methodsFor:'menu actions'!
|
|
324 |
|
775
|
325 |
entryMenuRevert
|
9
|
326 |
|
775
|
327 |
| entry |
|
9
|
328 |
entry := self selection.
|
775
|
329 |
entry ifNotNil:[entry revert]
|
|
330 |
|
|
331 |
"Modified: / 09-10-2008 / 20:30:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
332 |
"Created: / 05-12-2009 / 20:10:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
333 |
!
|
9
|
334 |
|
775
|
335 |
entryMenuShowChanges
|
|
336 |
self entryMenuShowChangesAgainst:SVN::Revision head
|
|
337 |
|
|
338 |
"Modified: / 09-10-2008 / 20:30:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
339 |
"Created: / 05-12-2009 / 20:10:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
9
|
340 |
!
|
|
341 |
|
775
|
342 |
entryMenuShowChangesAgainst:rev
|
|
343 |
|wc entry wcChangeSet repoChangeSet diffset lang |
|
9
|
344 |
wc := self model.
|
|
345 |
entry := self selection.
|
775
|
346 |
lang := entry programmingLanguage.
|
|
347 |
(lang notNil and: [lang isSmalltalk]) ifTrue:[
|
|
348 |
wcChangeSet := wc changeSetForContainer:entry path.
|
|
349 |
wcChangeSet name: wcChangeSet name, ' (working copy)'.
|
|
350 |
repoChangeSet := wc branch changeSetForContainer:entry path revision:rev.
|
|
351 |
diffset := ChangeSetDiff versionA:wcChangeSet versionB:repoChangeSet.
|
|
352 |
(Tools::ChangeSetDiffTool new)
|
|
353 |
beSingleColumn;
|
|
354 |
diffset:diffset;
|
|
355 |
title:('%1: Diffbetween working copy and rev. %2 ' bindWith: entry path with: rev printString);
|
|
356 |
open
|
|
357 |
] ifFalse:[
|
|
358 |
| text1 text2 |
|
|
359 |
text1 := (wc containerReadStreamFor: entry path) contents asString.
|
|
360 |
text2 := wc branch cat: entry path.
|
|
361 |
(Tools::TextDiffTool new)
|
|
362 |
versionALabel: 'Working copy';
|
|
363 |
versionBLabel: ('r %1' bindWith: rev printString);
|
|
364 |
versionA: text1 versionB: text2;
|
|
365 |
title:('%1: Diffbetween working copy and rev. %2 ' bindWith: entry path with: rev printString);
|
|
366 |
open
|
|
367 |
]
|
9
|
368 |
|
|
369 |
"Created: / 09-10-2008 / 20:14:24 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
370 |
"Modified: / 09-08-2009 / 14:14:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
775
|
371 |
"Modified: / 07-07-2011 / 21:49:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
372 |
"Modified: / 07-07-2011 / 23:09:09 / jv"
|
9
|
373 |
! !
|
|
374 |
|
|
375 |
!WorkingCopyBrowser methodsFor:'private'!
|
|
376 |
|
|
377 |
workingCopyEntries
|
|
378 |
| status |
|
|
379 |
|
|
380 |
status := self model status.
|
|
381 |
^ self showOnlyChanged value
|
|
382 |
ifTrue: [ status reject: [:entry | entry status isNormal ] ]
|
|
383 |
ifFalse: [ status ]
|
|
384 |
|
|
385 |
"Created: / 21-10-2008 / 18:55:34 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
386 |
"Modified: / 18-08-2009 / 09:12:04 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
387 |
! !
|
|
388 |
|
|
389 |
!WorkingCopyBrowser class methodsFor:'documentation'!
|
|
390 |
|
210
|
391 |
version_SVN
|
775
|
392 |
^ '§Id: SVN__WorkingCopyBrowser.st 354 2011-07-07 22:28:54Z vranyj1 §'
|
9
|
393 |
! !
|