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 comment:'
|
|
21 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
45
|
22 |
All Rights Reserved
|
30
|
23 |
|
111
|
24 |
$Header: /cvs/stx/stx/libtool/ChangeSetBrowser.st,v 1.7 1995-08-10 18:37:11 claus Exp $
|
30
|
25 |
'!
|
|
26 |
|
|
27 |
!ChangeSetBrowser class methodsFor:'documentation'!
|
|
28 |
|
|
29 |
copyright
|
|
30 |
"
|
|
31 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
45
|
32 |
All Rights Reserved
|
30
|
33 |
|
|
34 |
This software is furnished under a license and may be used
|
|
35 |
only in accordance with the terms of that license and with the
|
|
36 |
inclusion of the above copyright notice. This software may not
|
|
37 |
be provided or otherwise made available to, or used by, any
|
|
38 |
other person. No title to or ownership of the software is
|
|
39 |
hereby transferred.
|
|
40 |
"
|
|
41 |
!
|
|
42 |
|
|
43 |
version
|
|
44 |
"
|
111
|
45 |
$Header: /cvs/stx/stx/libtool/ChangeSetBrowser.st,v 1.7 1995-08-10 18:37:11 claus Exp $
|
30
|
46 |
"
|
|
47 |
!
|
|
48 |
|
|
49 |
documentation
|
|
50 |
"
|
|
51 |
like a changesBrowser, but manipulates the per-project change-lists.
|
|
52 |
"
|
|
53 |
! !
|
|
54 |
|
|
55 |
!ChangeSetBrowser class methodsFor:'instance creation'!
|
|
56 |
|
40
|
57 |
openOn:aChangeSet
|
30
|
58 |
"create c changes browser on a change set"
|
|
59 |
|
45
|
60 |
^ ((self new label:'ChangeSet Browser') changeSet:aChangeSet) open
|
30
|
61 |
! !
|
|
62 |
|
|
63 |
!ChangeSetBrowser methodsFor:'initialize / release'!
|
|
64 |
|
|
65 |
initializeMiddleButtonMenu
|
|
66 |
|labels|
|
|
67 |
|
|
68 |
labels := resources array:#(
|
45
|
69 |
'apply change'
|
|
70 |
'apply changes to end'
|
|
71 |
'apply all changes'
|
|
72 |
'-'
|
|
73 |
'delete'
|
|
74 |
'delete to end'
|
|
75 |
'delete changes for this class to end'
|
|
76 |
'delete all changes for this class'
|
|
77 |
'-'
|
|
78 |
'update'
|
|
79 |
'compress'
|
|
80 |
'compare with current version'
|
|
81 |
'-'
|
|
82 |
'make change a patch'
|
|
83 |
'update sourcefile from change'
|
|
84 |
'-'
|
|
85 |
'saveback changeSet').
|
30
|
86 |
|
|
87 |
changeListView
|
45
|
88 |
middleButtonMenu:(PopUpMenu
|
|
89 |
labels:labels
|
|
90 |
selectors:#(
|
|
91 |
doApply
|
|
92 |
doApplyRest
|
|
93 |
doApplyAll
|
|
94 |
nil
|
|
95 |
doDelete
|
|
96 |
doDeleteRest
|
|
97 |
doDeleteClassRest
|
|
98 |
doDeleteClassAll
|
|
99 |
nil
|
|
100 |
doUpdate
|
|
101 |
doCompress
|
|
102 |
doCompare
|
|
103 |
nil
|
|
104 |
doMakePatch
|
|
105 |
doMakePermanent
|
|
106 |
nil
|
|
107 |
doSaveBack)
|
|
108 |
receiver:self
|
|
109 |
for:changeListView)
|
30
|
110 |
! !
|
|
111 |
|
|
112 |
!ChangeSetBrowser methodsFor:'private'!
|
|
113 |
|
|
114 |
queryCloseText
|
45
|
115 |
^ 'Quit without updating changeSet ?'
|
30
|
116 |
!
|
|
117 |
|
|
118 |
streamForChange:changeNr
|
|
119 |
"answer a stream for change"
|
|
120 |
|
|
121 |
|change|
|
|
122 |
|
|
123 |
change := changeSet at:changeNr.
|
|
124 |
change isNil ifTrue:[^nil].
|
|
125 |
^ ReadStream on:(change source)
|
|
126 |
!
|
|
127 |
|
|
128 |
changeSet:aChangeSet
|
|
129 |
originalChangeSet := aChangeSet.
|
|
130 |
changeSet := OrderedCollection new.
|
106
|
131 |
originalChangeSet notNil ifTrue:[
|
|
132 |
originalChangeSet do:[:aChange |
|
|
133 |
changeSet add:aChange
|
|
134 |
].
|
30
|
135 |
].
|
|
136 |
!
|
|
137 |
|
45
|
138 |
readChangesFileInBackground:dummy
|
30
|
139 |
"read the changeSet, create a list of header-lines"
|
|
140 |
|
|
141 |
changeSet size == 0 ifTrue:[^ nil].
|
|
142 |
|
|
143 |
self withCursor:(Cursor read) do:[
|
45
|
144 |
changeChunks := OrderedCollection new.
|
|
145 |
changeHeaderLines := OrderedCollection new.
|
30
|
146 |
|
45
|
147 |
changeSet do:[:aChange |
|
|
148 |
changeChunks add:(aChange printString).
|
|
149 |
changeHeaderLines add:(aChange printString)
|
|
150 |
].
|
|
151 |
changeClassNames := OrderedCollection new:(changeChunks size).
|
|
152 |
anyChanges := false
|
30
|
153 |
]
|
|
154 |
!
|
|
155 |
|
|
156 |
saveBackChanges
|
|
157 |
"save back the change set"
|
|
158 |
|
|
159 |
[originalChangeSet isEmpty] whileFalse:[
|
45
|
160 |
originalChangeSet removeLast
|
30
|
161 |
].
|
|
162 |
changeSet do:[:aChange |
|
45
|
163 |
originalChangeSet add:aChange
|
30
|
164 |
]
|
|
165 |
!
|
|
166 |
|
|
167 |
silentDeleteChange:changeNr
|
|
168 |
"delete a change do not update changeListView"
|
|
169 |
|
|
170 |
anyChanges := true.
|
|
171 |
changeChunks removeIndex:changeNr.
|
|
172 |
changeClassNames removeIndex:changeNr.
|
|
173 |
changeSet removeIndex:changeNr
|
|
174 |
! !
|
|
175 |
|
|
176 |
!ChangeSetBrowser methodsFor:'user actions'!
|
|
177 |
|
|
178 |
doSaveBack
|
|
179 |
anyChanges ifTrue:[
|
45
|
180 |
self saveBackChanges.
|
|
181 |
self doUpdate
|
30
|
182 |
]
|
|
183 |
! !
|