30
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
45
|
3 |
All Rights Reserved
|
30
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
ChangesBrowser subclass:#ChangeSetBrowser
|
45
|
14 |
instanceVariableNames:'changeSet originalChangeSet'
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Interface-Browsers'
|
30
|
18 |
!
|
|
19 |
|
|
20 |
!ChangeSetBrowser class methodsFor:'documentation'!
|
|
21 |
|
|
22 |
copyright
|
|
23 |
"
|
|
24 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
45
|
25 |
All Rights Reserved
|
30
|
26 |
|
|
27 |
This software is furnished under a license and may be used
|
|
28 |
only in accordance with the terms of that license and with the
|
|
29 |
inclusion of the above copyright notice. This software may not
|
|
30 |
be provided or otherwise made available to, or used by, any
|
|
31 |
other person. No title to or ownership of the software is
|
|
32 |
hereby transferred.
|
|
33 |
"
|
|
34 |
!
|
|
35 |
|
|
36 |
documentation
|
|
37 |
"
|
|
38 |
like a changesBrowser, but manipulates the per-project change-lists.
|
|
39 |
"
|
|
40 |
! !
|
|
41 |
|
|
42 |
!ChangeSetBrowser class methodsFor:'instance creation'!
|
|
43 |
|
40
|
44 |
openOn:aChangeSet
|
30
|
45 |
"create c changes browser on a change set"
|
|
46 |
|
45
|
47 |
^ ((self new label:'ChangeSet Browser') changeSet:aChangeSet) open
|
30
|
48 |
! !
|
|
49 |
|
|
50 |
!ChangeSetBrowser methodsFor:'initialize / release'!
|
|
51 |
|
224
|
52 |
changeListMenu
|
|
53 |
|labels selectors|
|
30
|
54 |
|
224
|
55 |
labels := #(
|
|
56 |
'apply change'
|
|
57 |
'apply changes to end'
|
|
58 |
'apply all changes'
|
|
59 |
'-'
|
|
60 |
'delete'
|
|
61 |
'delete to end'
|
|
62 |
'delete changes for this class to end'
|
|
63 |
'delete all changes for this class'
|
|
64 |
'-'
|
|
65 |
'update'
|
|
66 |
"/ 'compress'
|
|
67 |
'compare with current version'
|
|
68 |
'-'
|
|
69 |
'make change a patch'
|
|
70 |
"/ 'update sourcefile from change'
|
|
71 |
'-'
|
|
72 |
'saveback changeSet'
|
|
73 |
).
|
30
|
74 |
|
224
|
75 |
selectors := #(
|
|
76 |
doApply
|
|
77 |
doApplyRest
|
|
78 |
doApplyAll
|
|
79 |
nil
|
|
80 |
doDelete
|
|
81 |
doDeleteRest
|
|
82 |
doDeleteClassRest
|
|
83 |
doDeleteClassAll
|
|
84 |
nil
|
|
85 |
doUpdate
|
|
86 |
"/ doCompress
|
|
87 |
doCompare
|
|
88 |
nil
|
|
89 |
doMakePatch
|
|
90 |
"/ doMakePermanent
|
|
91 |
nil
|
|
92 |
doSaveBack
|
|
93 |
).
|
|
94 |
|
|
95 |
^ PopUpMenu
|
|
96 |
labels:labels
|
|
97 |
selectors:selectors
|
|
98 |
receiver:self
|
|
99 |
|
|
100 |
"Created: 3.12.1995 / 18:06:35 / cg"
|
|
101 |
"Modified: 3.12.1995 / 18:13:06 / cg"
|
30
|
102 |
! !
|
|
103 |
|
|
104 |
!ChangeSetBrowser methodsFor:'private'!
|
|
105 |
|
|
106 |
changeSet:aChangeSet
|
|
107 |
originalChangeSet := aChangeSet.
|
|
108 |
changeSet := OrderedCollection new.
|
106
|
109 |
originalChangeSet notNil ifTrue:[
|
|
110 |
originalChangeSet do:[:aChange |
|
|
111 |
changeSet add:aChange
|
|
112 |
].
|
30
|
113 |
].
|
|
114 |
!
|
|
115 |
|
222
|
116 |
checkIfFileHasChanged
|
|
117 |
Processor removeTimedBlock:checkBlock.
|
|
118 |
changeSet size ~= originalChangeSet size ifTrue:[
|
|
119 |
self newLabel:'(outdated)'.
|
|
120 |
autoUpdate ifTrue:[
|
|
121 |
self doUpdate
|
|
122 |
]
|
|
123 |
] ifFalse:[
|
|
124 |
self newLabel:''
|
|
125 |
].
|
|
126 |
Processor addTimedBlock:checkBlock afterSeconds:5.
|
|
127 |
|
|
128 |
"Created: 3.12.1995 / 13:52:30 / cg"
|
|
129 |
"Modified: 3.12.1995 / 14:15:06 / cg"
|
|
130 |
!
|
|
131 |
|
224
|
132 |
classNameOfChange:nr
|
|
133 |
^ (changeSet at:nr) class name
|
|
134 |
|
|
135 |
"Created: 3.12.1995 / 18:15:56 / cg"
|
|
136 |
"Modified: 3.12.1995 / 18:20:12 / cg"
|
|
137 |
!
|
|
138 |
|
|
139 |
numberOfChanges
|
|
140 |
^ changeSet size
|
|
141 |
|
|
142 |
"Created: 3.12.1995 / 18:15:56 / cg"
|
|
143 |
!
|
|
144 |
|
222
|
145 |
queryCloseText
|
|
146 |
^ 'Quit without updating changeSet ?'
|
|
147 |
!
|
|
148 |
|
45
|
149 |
readChangesFileInBackground:dummy
|
30
|
150 |
"read the changeSet, create a list of header-lines"
|
|
151 |
|
|
152 |
changeSet size == 0 ifTrue:[^ nil].
|
|
153 |
|
224
|
154 |
self newLabel:'updating ...'.
|
30
|
155 |
self withCursor:(Cursor read) do:[
|
45
|
156 |
changeChunks := OrderedCollection new.
|
|
157 |
changeHeaderLines := OrderedCollection new.
|
30
|
158 |
|
45
|
159 |
changeSet do:[:aChange |
|
|
160 |
changeChunks add:(aChange printString).
|
|
161 |
changeHeaderLines add:(aChange printString)
|
|
162 |
].
|
|
163 |
changeClassNames := OrderedCollection new:(changeChunks size).
|
|
164 |
anyChanges := false
|
224
|
165 |
].
|
|
166 |
self newLabel:''.
|
|
167 |
|
|
168 |
"Created: 3.12.1995 / 18:02:39 / cg"
|
30
|
169 |
!
|
|
170 |
|
|
171 |
saveBackChanges
|
|
172 |
"save back the change set"
|
|
173 |
|
|
174 |
[originalChangeSet isEmpty] whileFalse:[
|
45
|
175 |
originalChangeSet removeLast
|
30
|
176 |
].
|
|
177 |
changeSet do:[:aChange |
|
45
|
178 |
originalChangeSet add:aChange
|
30
|
179 |
]
|
|
180 |
!
|
|
181 |
|
|
182 |
silentDeleteChange:changeNr
|
|
183 |
"delete a change do not update changeListView"
|
|
184 |
|
|
185 |
anyChanges := true.
|
|
186 |
changeChunks removeIndex:changeNr.
|
224
|
187 |
changeHeaderLines removeIndex:changeNr.
|
|
188 |
"/ changeClassNames removeIndex:changeNr.
|
30
|
189 |
changeSet removeIndex:changeNr
|
224
|
190 |
|
|
191 |
"Created: 3.12.1995 / 18:14:17 / cg"
|
|
192 |
"Modified: 3.12.1995 / 18:18:42 / cg"
|
222
|
193 |
!
|
|
194 |
|
|
195 |
streamForChange:changeNr
|
|
196 |
"answer a stream for change"
|
|
197 |
|
|
198 |
|change|
|
|
199 |
|
|
200 |
change := changeSet at:changeNr.
|
|
201 |
change isNil ifTrue:[^nil].
|
|
202 |
^ ReadStream on:(change source)
|
30
|
203 |
! !
|
|
204 |
|
|
205 |
!ChangeSetBrowser methodsFor:'user actions'!
|
|
206 |
|
|
207 |
doSaveBack
|
|
208 |
anyChanges ifTrue:[
|
45
|
209 |
self saveBackChanges.
|
|
210 |
self doUpdate
|
30
|
211 |
]
|
222
|
212 |
!
|
|
213 |
|
|
214 |
doUpdate
|
|
215 |
changeSet := OrderedCollection new.
|
|
216 |
originalChangeSet notNil ifTrue:[
|
|
217 |
originalChangeSet do:[:aChange |
|
|
218 |
changeSet add:aChange
|
|
219 |
].
|
|
220 |
].
|
|
221 |
super doUpdate
|
|
222 |
|
|
223 |
"Created: 3.12.1995 / 13:54:14 / cg"
|
30
|
224 |
! !
|
222
|
225 |
|
|
226 |
!ChangeSetBrowser class methodsFor:'documentation'!
|
|
227 |
|
|
228 |
version
|
224
|
229 |
^ '$Header: /cvs/stx/stx/libtool/Attic/ChgSetBrwsr.st,v 1.11 1995-12-03 18:44:23 cg Exp $'
|
222
|
230 |
! !
|