9
|
1 |
"{ Package: 'cvut:stx/goodies/libsvn' }"
|
|
2 |
|
|
3 |
"{ NameSpace: SVN }"
|
|
4 |
|
|
5 |
Browser subclass:#WorkingCopyBrowser
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'SVN-UI-Browsers'
|
|
10 |
!
|
|
11 |
|
|
12 |
!WorkingCopyBrowser class methodsFor:'documentation'!
|
|
13 |
|
|
14 |
version_SVN
|
|
15 |
^'$Id$'
|
|
16 |
! !
|
|
17 |
|
|
18 |
!WorkingCopyBrowser class methodsFor:'interface specs'!
|
|
19 |
|
|
20 |
windowSpec
|
|
21 |
"This resource specification was automatically generated
|
|
22 |
by the UIPainter of ST/X."
|
|
23 |
|
|
24 |
"Do not manually edit this!! If it is corrupted,
|
|
25 |
the UIPainter may not be able to read the specification."
|
|
26 |
|
|
27 |
"
|
|
28 |
UIPainter new openOnClass:SVN::WCStatusApp andSelector:#windowSpec
|
|
29 |
SVN::WCStatusApp new openInterface:#windowSpec
|
|
30 |
SVN::WCStatusApp open
|
|
31 |
"
|
|
32 |
|
|
33 |
<resource: #canvas>
|
|
34 |
|
|
35 |
^
|
|
36 |
#(FullSpec
|
|
37 |
name: windowSpec
|
|
38 |
window:
|
|
39 |
(WindowSpec
|
|
40 |
label: 'Working Copy Status'
|
|
41 |
name: 'Working Copy Status'
|
|
42 |
min: (Point 10 10)
|
|
43 |
bounds: (Rectangle 0 0 300 300)
|
|
44 |
)
|
|
45 |
component:
|
|
46 |
(SpecCollection
|
|
47 |
collection: (
|
|
48 |
(DataSetSpec
|
|
49 |
name: 'WCEntryTable'
|
|
50 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
|
|
51 |
model: selectionHolder
|
|
52 |
menu: workingCopyEntryMenu
|
|
53 |
hasHorizontalScrollBar: true
|
|
54 |
hasVerticalScrollBar: true
|
|
55 |
dataList: workingCopyEntriesAspect
|
|
56 |
useIndex: false
|
|
57 |
columnHolder: wcEntryTableColumns
|
|
58 |
)
|
|
59 |
(CheckBoxSpec
|
|
60 |
label: 'Show only changed etries'
|
|
61 |
name: 'ShowOnlyChanged'
|
|
62 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
|
|
63 |
model: showOnlyChanged
|
|
64 |
translateLabel: true
|
|
65 |
)
|
|
66 |
)
|
|
67 |
|
|
68 |
)
|
|
69 |
)
|
|
70 |
|
|
71 |
"Modified: / 22-10-2008 / 11:30:58 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
72 |
! !
|
|
73 |
|
|
74 |
!WorkingCopyBrowser class methodsFor:'menu specs'!
|
|
75 |
|
|
76 |
workingCopyEntryMenu
|
|
77 |
"This resource specification was automatically generated
|
|
78 |
by the MenuEditor of ST/X."
|
|
79 |
|
|
80 |
"Do not manually edit this!! If it is corrupted,
|
|
81 |
the MenuEditor may not be able to read the specification."
|
|
82 |
|
|
83 |
"
|
|
84 |
MenuEditor new openOnClass:SVN::WCStatusApp andSelector:#workingCopyEntryMenu
|
|
85 |
(Menu new fromLiteralArrayEncoding:(SVN::WCStatusApp workingCopyEntryMenu)) startUp
|
|
86 |
"
|
|
87 |
|
|
88 |
<resource: #menu>
|
|
89 |
|
|
90 |
^
|
|
91 |
#(Menu
|
|
92 |
(
|
|
93 |
(MenuItem
|
|
94 |
label: 'Show changes (against HEAD)'
|
|
95 |
itemValue: menuActionShowChangesAgainstHEAD
|
|
96 |
translateLabel: true
|
|
97 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' compare 'Show changes (against HEAD)')
|
|
98 |
)
|
|
99 |
(MenuItem
|
|
100 |
label: 'Show changes'
|
|
101 |
itemValue: menuActionShowChanges
|
|
102 |
translateLabel: true
|
|
103 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' compare 'Show changes')
|
|
104 |
)
|
|
105 |
)
|
|
106 |
nil
|
|
107 |
nil
|
|
108 |
)
|
|
109 |
|
|
110 |
"Modified: / 19-04-2008 / 13:13:43 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
111 |
! !
|
|
112 |
|
|
113 |
!WorkingCopyBrowser class methodsFor:'plugIn spec'!
|
|
114 |
|
|
115 |
aspectSelectors
|
|
116 |
"This resource specification was automatically generated
|
|
117 |
by the UIPainter of ST/X."
|
|
118 |
|
|
119 |
"Do not manually edit this. If it is corrupted,
|
|
120 |
the UIPainter may not be able to read the specification."
|
|
121 |
|
|
122 |
"Return a description of exported aspects;
|
|
123 |
these can be connected to aspects of an embedding application
|
|
124 |
(if this app is embedded in a subCanvas)."
|
|
125 |
|
|
126 |
^ #(
|
|
127 |
#model
|
|
128 |
).
|
|
129 |
|
|
130 |
"Modified: / 21-10-2008 / 18:53:15 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
131 |
! !
|
|
132 |
|
|
133 |
!WorkingCopyBrowser class methodsFor:'tableColumns specs'!
|
|
134 |
|
|
135 |
wcEntryTableColumns
|
|
136 |
"This resource specification was automatically generated
|
|
137 |
by the DataSetBuilder of ST/X."
|
|
138 |
|
|
139 |
"Do not manually edit this!! If it is corrupted,
|
|
140 |
the DataSetBuilder may not be able to read the specification."
|
|
141 |
|
|
142 |
"
|
|
143 |
DataSetBuilder new openOnClass:SVN::WorkingCopyStatusUI andSelector:#wcEntryTableColumns
|
|
144 |
"
|
|
145 |
|
|
146 |
<resource: #tableColumns>
|
|
147 |
|
|
148 |
^#(
|
|
149 |
(DataSetColumnSpec
|
|
150 |
label: ''
|
|
151 |
activeHelpKey: ''
|
|
152 |
labelButtonType: Button
|
|
153 |
printSelector: statusIcon
|
|
154 |
canSelect: false
|
|
155 |
showRowSeparator: false
|
|
156 |
showColSeparator: false
|
|
157 |
)
|
|
158 |
(DataSetColumnSpec
|
|
159 |
label: 'Container'
|
|
160 |
activeHelpKey: ''
|
|
161 |
labelButtonType: Button
|
|
162 |
printSelector: pathText
|
|
163 |
canSelect: false
|
|
164 |
showRowSeparator: false
|
|
165 |
showColSeparator: false
|
|
166 |
)
|
|
167 |
(DataSetColumnSpec
|
|
168 |
label: 'Rev'
|
|
169 |
activeHelpKey: ''
|
|
170 |
labelButtonType: Button
|
|
171 |
printSelector: revision
|
|
172 |
canSelect: false
|
|
173 |
showRowSeparator: false
|
|
174 |
showColSeparator: false
|
|
175 |
)
|
|
176 |
(DataSetColumnSpec
|
|
177 |
label: 'Author'
|
|
178 |
activeHelpKey: ''
|
|
179 |
labelButtonType: Button
|
|
180 |
printSelector: author
|
|
181 |
canSelect: false
|
|
182 |
showRowSeparator: false
|
|
183 |
showColSeparator: false
|
|
184 |
)
|
|
185 |
(DataSetColumnSpec
|
|
186 |
label: 'Date'
|
|
187 |
activeHelpKey: ''
|
|
188 |
labelButtonType: Button
|
|
189 |
printSelector: date
|
|
190 |
canSelect: false
|
|
191 |
showRowSeparator: false
|
|
192 |
showColSeparator: false
|
|
193 |
)
|
|
194 |
)
|
|
195 |
|
|
196 |
"Modified: / 18-08-2009 / 14:31:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
197 |
! !
|
|
198 |
|
|
199 |
!WorkingCopyBrowser methodsFor:'accessing'!
|
|
200 |
|
|
201 |
workingCopy
|
|
202 |
|
|
203 |
^self model
|
|
204 |
|
|
205 |
"Created: / 11-04-2008 / 10:20:36 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
206 |
"Modified: / 12-04-2008 / 21:02:26 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
207 |
!
|
|
208 |
|
|
209 |
workingCopy: aWorkingCopy
|
|
210 |
|
|
211 |
self model: aWorkingCopy
|
|
212 |
|
|
213 |
"Created: / 11-04-2008 / 10:20:22 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
214 |
"Modified: / 12-04-2008 / 21:02:34 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
215 |
! !
|
|
216 |
|
|
217 |
!WorkingCopyBrowser methodsFor:'aspects'!
|
|
218 |
|
|
219 |
showOnlyChanged
|
|
220 |
|
|
221 |
|holder|
|
|
222 |
|
|
223 |
(holder := builder bindingAt:#showOnlyChanged) isNil ifTrue:[
|
|
224 |
holder := true asValue.
|
|
225 |
holder onChangeEvaluate:
|
|
226 |
[self model changed].
|
|
227 |
builder aspectAt:#showOnlyChanged put:holder.
|
|
228 |
].
|
|
229 |
^ holder.
|
|
230 |
|
|
231 |
"Created: / 21-10-2008 / 18:53:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
232 |
!
|
|
233 |
|
|
234 |
workingCopyEntriesAspect
|
|
235 |
|
|
236 |
|
|
237 |
|holder|
|
|
238 |
|
|
239 |
(holder := builder bindingAt:#workingCopyEntriesAspect) isNil ifTrue:[
|
|
240 |
holder := (PluggableAdaptor on: self modelHolder)
|
|
241 |
getBlock:[:model|self workingCopyEntries]
|
|
242 |
putBlock:[:model :value|self error:'Should never be sent']
|
|
243 |
updateBlock:[:model :aspect :value|true].
|
|
244 |
builder aspectAt:#workingCopyEntriesAspect put:holder.
|
|
245 |
].
|
|
246 |
^ holder.
|
|
247 |
|
|
248 |
"Created: / 11-04-2008 / 10:24:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
249 |
"Modified: / 21-10-2008 / 18:55:05 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
250 |
! !
|
|
251 |
|
|
252 |
!WorkingCopyBrowser methodsFor:'hooks'!
|
|
253 |
|
|
254 |
commonPostBuild
|
|
255 |
|
|
256 |
^self model changed
|
|
257 |
|
|
258 |
"Created: / 11-04-2008 / 10:33:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
259 |
"Modified: / 12-04-2008 / 21:05:05 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
260 |
! !
|
|
261 |
|
|
262 |
!WorkingCopyBrowser methodsFor:'menu actions'!
|
|
263 |
|
|
264 |
menuActionShowChanges
|
|
265 |
|
|
266 |
| entry log revision |
|
|
267 |
entry := self selection.
|
|
268 |
log := self model branch log: entry path.
|
|
269 |
revision := SVN::RevisionSelectionDialog openOn: log.
|
|
270 |
revision ifNotNil:
|
|
271 |
[self menuActionShowChangesAgainst: revision]
|
|
272 |
|
|
273 |
"Modified: / 22-10-2008 / 11:31:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
274 |
!
|
|
275 |
|
|
276 |
menuActionShowChangesAgainst: rev
|
|
277 |
|
|
278 |
| wc entry wcChangeSet repoChangeSet |
|
|
279 |
wc := self model.
|
|
280 |
entry := self selection.
|
|
281 |
wcChangeSet := wc changeSetForContainer: entry path.
|
|
282 |
repoChangeSet := wc branch changeSetForContainer: entry path revision: rev.
|
|
283 |
Tools::SmalltalkDiffTool
|
|
284 |
openOnDiffSet: (wcChangeSet diffSetsAgainst: repoChangeSet)
|
|
285 |
labelA: 'Working copy'
|
|
286 |
labelB: 'Revision ', rev printString
|
|
287 |
title: 'Changes for ', entry path
|
|
288 |
|
|
289 |
"Created: / 09-10-2008 / 20:14:24 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
290 |
"Modified: / 09-08-2009 / 14:14:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
291 |
!
|
|
292 |
|
|
293 |
menuActionShowChangesAgainstHEAD
|
|
294 |
|
|
295 |
self menuActionShowChangesAgainst: SVN::Revision head
|
|
296 |
|
|
297 |
"Modified: / 09-10-2008 / 20:30:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
298 |
! !
|
|
299 |
|
|
300 |
!WorkingCopyBrowser methodsFor:'private'!
|
|
301 |
|
|
302 |
workingCopyEntries
|
|
303 |
| status |
|
|
304 |
|
|
305 |
status := self model status.
|
|
306 |
^ self showOnlyChanged value
|
|
307 |
ifTrue: [ status reject: [:entry | entry status isNormal ] ]
|
|
308 |
ifFalse: [ status ]
|
|
309 |
|
|
310 |
"Created: / 21-10-2008 / 18:55:34 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
311 |
"Modified: / 18-08-2009 / 09:12:04 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
312 |
! !
|
|
313 |
|
|
314 |
!WorkingCopyBrowser class methodsFor:'documentation'!
|
|
315 |
|
|
316 |
version
|
|
317 |
^ '$Header$'
|
|
318 |
! !
|