author | Claus Gittinger <cg@exept.de> |
Mon, 15 Oct 2007 16:27:14 +0200 | |
changeset 1972 | 32853d3cb43a |
parent 1971 | 11dfb42fa1bc |
child 1978 | 91cb79a651aa |
permissions | -rw-r--r-- |
906 | 1 |
" |
2 |
COPYRIGHT (c) 2000 eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
" |
|
920 | 12 |
"{ Package: 'stx:libbasic3' }" |
13 |
||
873 | 14 |
Object subclass:#SourceCodeManagerUtilities |
1728 | 15 |
instanceVariableNames:'' |
16 |
classVariableNames:'LastSourceLogMessage LastModule LastPackage YesToAllQuery |
|
17 |
YesToAllNotification' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'System-SourceCodeManagement' |
|
873 | 20 |
! |
21 |
||
22 |
!SourceCodeManagerUtilities class methodsFor:'documentation'! |
|
23 |
||
906 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 2000 eXept Software AG |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
||
37 |
! |
|
38 |
||
873 | 39 |
documentation |
40 |
" |
|
41 |
utility code which is useful at more than one place |
|
42 |
(extracted from the browser) |
|
43 |
||
44 |
[author:] |
|
45 |
Claus Gittinger (cg@exept) |
|
46 |
||
47 |
[see also:] |
|
48 |
||
49 |
[instance variables:] |
|
50 |
||
51 |
[class variables:] |
|
52 |
" |
|
53 |
! ! |
|
54 |
||
992 | 55 |
!SourceCodeManagerUtilities class methodsFor:'Signal constants'! |
56 |
||
57 |
yesToAllNotification |
|
58 |
YesToAllNotification isNil ifTrue:[ |
|
59 |
YesToAllNotification := QuerySignal new. |
|
60 |
]. |
|
61 |
^ YesToAllNotification |
|
62 |
! |
|
63 |
||
64 |
yesToAllQuery |
|
65 |
YesToAllQuery isNil ifTrue:[ |
|
66 |
YesToAllQuery := QuerySignal new. |
|
67 |
]. |
|
68 |
^ YesToAllQuery |
|
69 |
! ! |
|
70 |
||
1084 | 71 |
!SourceCodeManagerUtilities class methodsFor:'accessing'! |
72 |
||
73 |
lastModule |
|
74 |
"return the value of the static variable 'LastModule' (automatically generated)" |
|
75 |
||
76 |
^ LastModule |
|
77 |
! |
|
78 |
||
79 |
lastModule:something |
|
80 |
"set the value of the static variable 'LastModule' (automatically generated)" |
|
81 |
||
82 |
LastModule := something. |
|
83 |
! |
|
84 |
||
85 |
lastPackage |
|
86 |
"return the value of the static variable 'LastPackage' (automatically generated)" |
|
87 |
||
88 |
^ LastPackage |
|
89 |
! |
|
90 |
||
91 |
lastPackage:something |
|
92 |
"set the value of the static variable 'LastPackage' (automatically generated)" |
|
93 |
||
94 |
LastPackage := something. |
|
95 |
! ! |
|
96 |
||
1806 | 97 |
!SourceCodeManagerUtilities class methodsFor:'resources'! |
98 |
||
99 |
resourcePackage |
|
100 |
^ #'stx:libtool' |
|
101 |
! ! |
|
102 |
||
873 | 103 |
!SourceCodeManagerUtilities class methodsFor:'utilities'! |
104 |
||
1882
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
105 |
classIsNotYetInRepository:aClass withManager:mgr |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
106 |
|info| |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
107 |
|
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
108 |
info := mgr sourceInfoOfClass:aClass. |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
109 |
|
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
110 |
^ (info isNil |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
111 |
or:[(info at:#fileName ifAbsent:nil) isNil |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
112 |
or:[(info at:#module ifAbsent:nil) isNil |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
113 |
or:[(info at:#directory ifAbsent:nil) isNil]]]) |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
114 |
|
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
115 |
"Created: / 25-10-2006 / 09:43:00 / cg" |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
116 |
! |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
117 |
|
1704 | 118 |
nameOfExtensionsContainer |
119 |
^ 'extensions.st' |
|
120 |
! |
|
121 |
||
1375 | 122 |
setPackageOfAllMethodsIn:aClass to:aPackage |
123 |
"make all methods belong to the classes project" |
|
933
84fd7806afaf
offer existing modules/packages in source-container dialog
Claus Gittinger <cg@exept.de>
parents:
923
diff
changeset
|
124 |
|
1375 | 125 |
|anyChange anyChangeHere| |
893 | 126 |
|
1375 | 127 |
anyChange := false. |
128 |
aClass withAllPrivateClassesDo:[:eachClass | |
|
129 |
anyChangeHere := false. |
|
130 |
eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
131 |
mthd package ~= aPackage ifTrue:[ |
|
132 |
mthd setPackage:aPackage. |
|
133 |
anyChangeHere := true. |
|
134 |
]. |
|
135 |
]. |
|
136 |
anyChangeHere ifTrue:[ |
|
137 |
eachClass changed:#projectOrganization |
|
138 |
]. |
|
139 |
anyChangeHere ifTrue:[anyChange := true]. |
|
893 | 140 |
]. |
1375 | 141 |
anyChange ifTrue:[ |
142 |
Smalltalk changed:#projectOrganization |
|
1185 | 143 |
]. |
1375 | 144 |
^ anyChange |
893 | 145 |
! |
146 |
||
1375 | 147 |
sourceCodeManagerFor:aClass |
148 |
|mgr| |
|
934
4f06b1db2ca1
better user interface when asking for a revision to compare.
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
149 |
|
1782 | 150 |
mgr := aClass theNonMetaclass sourceCodeManager. |
1375 | 151 |
mgr isNil ifTrue:[ |
152 |
SourceCodeManager isNil ifTrue:[ |
|
153 |
(self warn:'SourceCodeManagement is disabled or not configured.\\Please setup in the Launcher.' withCRs) ifFalse:[ |
|
154 |
^ nil |
|
1012
92c4719178de
faster search for halts etc.
Claus Gittinger <cg@exept.de>
parents:
1011
diff
changeset
|
155 |
]. |
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
156 |
]. |
1375 | 157 |
(self confirm:'Class does not seem to provide a valid sourceCodeManager.\\Assume CVS ?' withCRs) ifFalse:[ |
158 |
^ nil |
|
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
159 |
]. |
1375 | 160 |
mgr := CVSSourceCodeManager. |
161 |
]. |
|
162 |
^ mgr |
|
1782 | 163 |
|
164 |
"Modified: / 12-09-2006 / 14:14:35 / cg" |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
165 |
! |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
166 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
167 |
sourceCodeOfClass:aClass |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
168 |
|stream src| |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
169 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
170 |
stream := '' writeStream. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
171 |
Method flushSourceStreamCache. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
172 |
aClass fileOutOn:stream withTimeStamp:false. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
173 |
src := stream contents asString. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
174 |
stream close. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
175 |
^ src |
1375 | 176 |
! ! |
1160 | 177 |
|
1375 | 178 |
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs'! |
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
179 |
|
1841
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
180 |
changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision using:aSourceCodeManager |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
181 |
"check-out an extension container from the source repository, and return the methods there as a change set. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
182 |
If askForRevision is false, check-out the newest version. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
183 |
Return a changeSet or nil (if any error occurred)" |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
184 |
|
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
185 |
|resources directory module file |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
186 |
inChangeSet extensionMethods |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
187 |
aStream sourceToLoad rev msg newestRev |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
188 |
listHere listRep diffSet |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
189 |
changed onlyHere onlyInRep answer labels values singleChangeSelector |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
190 |
changedClasses default | |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
191 |
|
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
192 |
resources := self classResources. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
193 |
|
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
194 |
directory := packageToCheckOut asPackageId directory. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
195 |
module := packageToCheckOut asPackageId module. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
196 |
file := self nameOfExtensionsContainer. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
197 |
|
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
198 |
"/ |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
199 |
"/ ask for revision |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
200 |
"/ |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
201 |
newestRev := aSourceCodeManager newestRevisionInFile:file directory:directory module:module. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
202 |
askForRevision ifFalse:[ |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
203 |
rev := newestRev ? '' |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
204 |
] ifTrue:[ |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
205 |
msg := resources string:'CheckOut which revision of extensions for ''%1'': (empty for newest)' with:packageToCheckOut allBold. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
206 |
newestRev notNil ifTrue:[ |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
207 |
msg := msg , '\' , (resources string:'Newest in reporitory is %1.' with:newestRev) |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
208 |
]. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
209 |
|
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
210 |
rev := SourceCodeManagerUtilities |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
211 |
askForExistingRevision:msg |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
212 |
title:'CheckOut from repository' |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
213 |
class:nil |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
214 |
manager:aSourceCodeManager |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
215 |
module:module package:directory fileName:file. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
216 |
|
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
217 |
rev isNil ifTrue:[ |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
218 |
^ nil "/ canceled |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
219 |
]. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
220 |
]. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
221 |
|
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
222 |
rev withoutSpaces isEmpty ifTrue:[ |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
223 |
rev := #newest. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
224 |
msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
225 |
] ifFalse:[ |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
226 |
msg := 'extracting previous %1'. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
227 |
]. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
228 |
aStream := aSourceCodeManager |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
229 |
streamForClass:nil |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
230 |
fileName:file |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
231 |
revision:rev |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
232 |
directory:directory |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
233 |
module:module |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
234 |
cache:true. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
235 |
|
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
236 |
aStream isNil ifTrue:[ |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
237 |
self warn:(resources string:'Could not extract "extensions.st" for %1 from repository' with:packageToCheckOut allBold). |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
238 |
^ nil |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
239 |
]. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
240 |
aStream class readErrorSignal handle:[:ex | |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
241 |
self warn:('read error while reading extracted source\\' , ex description) withCRs. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
242 |
aStream close. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
243 |
^ nil |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
244 |
] do:[ |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
245 |
sourceToLoad := aStream contents asString. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
246 |
]. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
247 |
aStream close. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
248 |
^ ChangeSet fromStream:(sourceToLoad readStream). |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
249 |
|
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
250 |
"Created: / 09-10-2006 / 13:04:37 / cg" |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
251 |
! |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
252 |
|
1704 | 253 |
checkForExistingModule:module directory:directory container:containerFileName using:mgr allowCreate:allowCreate |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
254 |
|resources moduleName directoryName containerName| |
1158 | 255 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
256 |
resources := self classResources. |
1158 | 257 |
moduleName := module allBold. |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
258 |
directoryName := directory allBold. |
1158 | 259 |
containerName := containerFileName allBold. |
260 |
||
261 |
"/ |
|
262 |
"/ check for the container |
|
263 |
"/ |
|
1787 | 264 |
(mgr checkForExistingContainer:containerFileName inModule:module directory:directory) ifFalse:[ |
1158 | 265 |
allowCreate ifFalse:[ |
266 |
self warn:(resources string:'A container for ''%1'' does not exist in ''%2:%3''' |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
267 |
with:containerName with:moduleName with:directoryName) withCRs. |
1158 | 268 |
^ false |
269 |
]. |
|
270 |
(Dialog |
|
271 |
confirm:(resources string:'''%1'' is a new container (in ''%2:%3'').\\Create it ?' |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
272 |
with:containerName with:moduleName with:directoryName) withCRs |
1158 | 273 |
noLabel:'Cancel') |
274 |
ifFalse:[ |
|
275 |
^ false. |
|
276 |
]. |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
277 |
(mgr createContainerForText:'' inModule:module package:directory container:containerFileName) ifFalse:[ |
1158 | 278 |
self warn:(resources string:'Cannot create new container: ''%1'' (in ''%2:%3'')' |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
279 |
with:containerName with:moduleName with:directoryName). |
1158 | 280 |
^ false. |
281 |
] |
|
282 |
]. |
|
283 |
^ true. |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
284 |
|
1787 | 285 |
"Modified: / 13-09-2006 / 18:24:57 / cg" |
1158 | 286 |
! |
287 |
||
1704 | 288 |
checkForExistingModule:module directory:directory using:mgr allowCreate:allowCreate |
289 |
|resources moduleNameBold directoryNameBold| |
|
1158 | 290 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
291 |
resources := self classResources. |
1704 | 292 |
moduleNameBold := module allBold. |
293 |
directoryNameBold := directory allBold. |
|
1158 | 294 |
|
295 |
"/ |
|
1704 | 296 |
"/ check for the directory |
1158 | 297 |
"/ |
1840 | 298 |
(mgr checkForExistingModule:module directory:directory) ifFalse:[ |
1158 | 299 |
allowCreate ifFalse:[ |
1704 | 300 |
self warn:(resources string:'A directory for ''%1'' does not exist in module ''%2''' |
301 |
with:directoryNameBold with:moduleNameBold) withCRs. |
|
1158 | 302 |
^ false |
303 |
]. |
|
304 |
(Dialog |
|
1704 | 305 |
confirm:(resources string:'''%1'' is a new directory in module ''%2''.\\create it ?' |
306 |
with:directoryNameBold with:moduleNameBold) withCRs |
|
1158 | 307 |
noLabel:'Cancel') |
308 |
ifFalse:[ |
|
309 |
^ false. |
|
310 |
]. |
|
1840 | 311 |
(mgr createModule:module directory:directory) ifFalse:[ |
1704 | 312 |
self warn:(resources string:'Cannot create new directory: ''%1'' in module ''%2''' |
313 |
with:directoryNameBold with:moduleNameBold) withCRs. |
|
1158 | 314 |
^ false. |
315 |
] |
|
316 |
]. |
|
317 |
^ true. |
|
1840 | 318 |
|
319 |
"Modified: / 06-10-2006 / 17:08:08 / cg" |
|
1158 | 320 |
! |
321 |
||
322 |
checkForExistingModule:module using:mgr allowCreate:allowCreate |
|
1483 | 323 |
|resources moduleName answer| |
1158 | 324 |
|
325 |
(mgr checkForExistingModule:module) ifFalse:[ |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
326 |
resources := self classResources. |
1158 | 327 |
moduleName := module allBold. |
328 |
||
329 |
allowCreate ifFalse:[ |
|
1423 | 330 |
self warn:(resources stringWithCRs:'A module named ''%1'' does not exist in the repository' |
331 |
with:moduleName) . |
|
1158 | 332 |
^ false |
333 |
]. |
|
1483 | 334 |
AbortAllOperationRequest isHandled ifTrue:[ |
335 |
answer := Dialog |
|
336 |
confirmWithCancel:(resources stringWithCRs:'''%1'' is a new module.\\create it ?' with:moduleName) |
|
337 |
labels:(resources array:#('Cancel All' 'Cancel' 'Yes' )). |
|
338 |
answer isNil ifTrue:[ AbortAllOperationRequest raise ]. |
|
339 |
] ifFalse:[ |
|
340 |
answer := Dialog |
|
341 |
confirm:(resources stringWithCRs:'''%1'' is a new module.\\create it ?' with:moduleName) |
|
342 |
noLabel:'Cancel' |
|
343 |
]. |
|
344 |
answer ifFalse:[ ^ false]. |
|
1158 | 345 |
|
346 |
(mgr createModule:module) ifFalse:[ |
|
1423 | 347 |
self warn:(resources stringWithCRs:'Cannot create new module: ''%1''' with:moduleName) . |
1158 | 348 |
^ false. |
349 |
] |
|
350 |
]. |
|
351 |
^ true. |
|
352 |
! |
|
353 |
||
886 | 354 |
checkinClass:aClass |
355 |
"check a class into the source repository. |
|
1704 | 356 |
Asks interactively for a log-message." |
882 | 357 |
|
1704 | 358 |
^ self checkinClass:aClass withInfo:nil |
882 | 359 |
! |
360 |
||
1704 | 361 |
checkinClass:aClass withInfo:aLogInfoOrNil |
886 | 362 |
"check a class into the source repository. |
1704 | 363 |
If the argument, aLogInfoOrNil isNil, ask interactively for a log-message." |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
364 |
|
1704 | 365 |
^ self checkinClass:aClass withInfo:aLogInfoOrNil withCheck:true |
977 | 366 |
! |
367 |
||
1704 | 368 |
checkinClass:aClass withInfo:aLogInfoNil withCheck:doCheckClass |
977 | 369 |
"check a class into the source repository. |
1704 | 370 |
If the argument, aLogInfoNil isNil, ask interactively for log-message. |
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
371 |
If doCheckClass is true, the class is checked for send of halts etc." |
977 | 372 |
|
1882
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
373 |
|logMessage checkinInfo mgr pri resources selectorsInChangeSet initialLog| |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
374 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
375 |
aClass isLoaded ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
376 |
self information:'cannot checkin unloaded classes (' , aClass name , ').'. |
881 | 377 |
^ false. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
378 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
379 |
|
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
380 |
mgr := self sourceCodeManagerFor:aClass. |
954 | 381 |
mgr isNil ifTrue:[ |
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
382 |
^ false |
954 | 383 |
]. |
384 |
||
1704 | 385 |
aLogInfoNil isNil ifTrue:[ |
1882
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
386 |
selectorsInChangeSet := ChangeSet current |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
387 |
select:[:aChange | aChange isMethodChange and:[aChange className = aClass name]] |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
388 |
thenCollect:[:aChange | aChange selector]. |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
389 |
selectorsInChangeSet size == 1 ifTrue:[ |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
390 |
initialLog := 'changed ',selectorsInChangeSet first storeString. |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
391 |
]. |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
392 |
"/ newSelectors := aClass selectors asSet. |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
393 |
"/ newSelectors addAll:(aClass class selectors). |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
394 |
"/ newSelectors size == 1 ifTrue:[ |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
395 |
"/ initialLog := 'Added/changed #' , newSelectors first |
1078 | 396 |
"/ ] ifFalse:[ |
397 |
"/ newSelectors size > 1 ifTrue:[ |
|
398 |
"/ initialLog := 'Added/changed some methods' |
|
399 |
"/ ] |
|
1882
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
400 |
"/ ]. |
1078 | 401 |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
402 |
checkinInfo := self |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
403 |
getCheckinInfoFor:aClass name |
1078 | 404 |
initialAnswer:initialLog. |
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
405 |
checkinInfo isNil ifTrue:[^ false]. |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
406 |
logMessage := checkinInfo logMessage. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
407 |
] ifFalse:[ |
1704 | 408 |
aLogInfoNil isString ifTrue:[ |
409 |
"soon obsolete..." |
|
410 |
logMessage := aLogInfoNil |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
411 |
] ifFalse:[ |
1704 | 412 |
checkinInfo := aLogInfoNil. |
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
413 |
logMessage := checkinInfo logMessage. |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
414 |
]. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
415 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
416 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
417 |
resources := self classResources. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
418 |
|
1882
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
419 |
(self classIsNotYetInRepository:aClass withManager:mgr) ifTrue:[ |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
420 |
(self createSourceContainerForClass:aClass) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
421 |
"/ self warn:'did not create a container for ''' , aClass name , ''''. |
881 | 422 |
^ false |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
423 |
]. |
881 | 424 |
^ true. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
425 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
426 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
427 |
self activityNotification:(resources string:'checking in %1' with:aClass name). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
428 |
pri := Processor activePriority. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
429 |
Processor activeProcess withPriority:pri-1 to:pri |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
430 |
do:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
431 |
|revision aborted freshCreated| |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
432 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
433 |
freshCreated := false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
434 |
revision := aClass revision. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
435 |
revision isNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
436 |
"/ mhmh - check if it has a container. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
437 |
(mgr checkForExistingContainerForClass:aClass) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
438 |
(self createSourceContainerForClass:aClass) ifFalse:[ |
1030 | 439 |
self warn:'Did not create/change repository container for ''' , aClass name allBold , ''''. |
440 |
^ false. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
441 |
]. |
1503 | 442 |
freshCreated := true. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
443 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
444 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
445 |
|
1426 | 446 |
doCheckClass value ifTrue:[ |
977 | 447 |
"/ check if the class contains halts, error-sends etc. |
1426 | 448 |
(self checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:doCheckClass) ifFalse:[ |
977 | 449 |
^ false |
450 |
]. |
|
973
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
451 |
]. |
b9004b37290a
check for #halt and #error when checking in
Claus Gittinger <cg@exept.de>
parents:
958
diff
changeset
|
452 |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
453 |
freshCreated ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
454 |
aborted := false. |
1113
30540d5fc3b7
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
1095
diff
changeset
|
455 |
AbortOperationRequest handle:[:ex | |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
456 |
aborted := true. |
881 | 457 |
ex return. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
458 |
] do:[ |
1828 | 459 |
|checkinState cause| |
460 |
checkinState := false. |
|
461 |
cause := ''. |
|
462 |
[ |
|
463 |
checkinState := mgr checkinClass:aClass logMessage:logMessage |
|
464 |
] on:SourceCodeManagerError do:[:ex| cause := ex description]. |
|
465 |
||
466 |
checkinState ifFalse:[ |
|
467 |
Transcript showCR:'checkin of ''' , aClass name , ''' failed - ', cause. |
|
468 |
self warn:'checkin of ''' , aClass name allBold , ''' failed - ', cause. |
|
881 | 469 |
^ false. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
470 |
]. |
1725 | 471 |
checkinInfo notNil ifTrue:[ |
472 |
checkinInfo isStable ifTrue:[ |
|
473 |
"set stable tag for class that has been checked in" |
|
1726 | 474 |
self tagClass:aClass as:#stable. |
1725 | 475 |
]. |
476 |
checkinInfo tagIt ifTrue:[ |
|
477 |
"set an additional tag for class that has been checked in" |
|
1728 | 478 |
self tagClass:aClass as:(checkinInfo tag). |
1725 | 479 |
]. |
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
480 |
]. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
481 |
]. |
1519
c0e28a7d3c73
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
482 |
aborted ifTrue:[ |con| |
1158 | 483 |
Transcript showCR:'Checkin of ''' , aClass name , ''' aborted'. |
1519
c0e28a7d3c73
no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
484 |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
485 |
AbortAllOperationRequest isHandled ifTrue:[ |
1032 | 486 |
(Dialog |
1423 | 487 |
confirm:(resources stringWithCRs:'Checkin of ''' , aClass name , ''' aborted.\\Cancel all ?') |
1032 | 488 |
default:false) |
489 |
ifTrue:[ |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
490 |
AbortAllOperationRequest raise. |
1032 | 491 |
] |
1016 | 492 |
]. |
881 | 493 |
^ false. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
494 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
495 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
496 |
]. |
881 | 497 |
^ true |
1113
30540d5fc3b7
class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents:
1095
diff
changeset
|
498 |
|
1882
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
499 |
"Modified: / 25-10-2006 / 09:43:26 / cg" |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
500 |
! |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
501 |
|
920 | 502 |
checkinClasses:aCollectionOfClass |
886 | 503 |
"check a collection of classes into the source repository. |
504 |
Asks interactively for log-message." |
|
505 |
||
1704 | 506 |
^ self checkinClasses:aCollectionOfClass withInfo:nil |
886 | 507 |
! |
508 |
||
1704 | 509 |
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrNil |
886 | 510 |
"check a bunch of classes into the source repository. |
1704 | 511 |
If the argument, aLogInfoOrNil isNil, ask interactively for log-message." |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
512 |
|
992 | 513 |
^ self |
1142
cba1ede48a4a
allow check for halt/error to be turned off via userPrefs
Claus Gittinger <cg@exept.de>
parents:
1137
diff
changeset
|
514 |
checkinClasses:aCollectionOfClasses |
1704 | 515 |
withInfo:aLogInfoOrNil |
1142
cba1ede48a4a
allow check for halt/error to be turned off via userPrefs
Claus Gittinger <cg@exept.de>
parents:
1137
diff
changeset
|
516 |
withCheck:(UserPreferences current at:#checkClassesWhenCheckingIn ifAbsent:true) |
992 | 517 |
! |
518 |
||
1704 | 519 |
checkinClasses:aCollectionOfClasses withInfo:aLogInfoOrStringNil withCheck:doCheckClasses |
992 | 520 |
"check a bunch of classes into the source repository. |
1704 | 521 |
If the argument, aLogInfoOrStringNil isNil, ask interactively for log-message." |
992 | 522 |
|
1726 | 523 |
|classes allClasses checkinInfoOrString resources yesOrNoToAll unchangedClasses| |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
524 |
|
920 | 525 |
"/ ignore private classes |
526 |
classes := aCollectionOfClasses select:[:aClass | aClass owningClass isNil]. |
|
527 |
classes isEmpty ifTrue:[ |
|
528 |
self information:'Only private classes given - nothing checked in.'. |
|
529 |
^ self |
|
530 |
]. |
|
531 |
classes := classes select:[:aClass | aClass isLoaded]. |
|
532 |
classes isEmpty ifTrue:[ |
|
533 |
self information:'Only unloaded classes given - nothing checked in.'. |
|
534 |
^ self |
|
535 |
]. |
|
1704 | 536 |
|
958 | 537 |
classes size == 1 ifTrue:[ |
1704 | 538 |
^ self checkinClass:classes first withInfo:aLogInfoOrStringNil withCheck:doCheckClasses. |
958 | 539 |
]. |
920 | 540 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
541 |
resources := self classResources. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
542 |
|
1726 | 543 |
"ask once, for all classes" |
1704 | 544 |
aLogInfoOrStringNil isNil ifTrue:[ |
545 |
checkinInfoOrString := self |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
546 |
getCheckinInfoFor:(resources string:'%1 classes to checkin' with:aCollectionOfClasses size) |
1704 | 547 |
initialAnswer:nil |
548 |
withQuickOption:true. |
|
549 |
checkinInfoOrString isNil ifTrue:[^ self]. |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
550 |
] ifFalse:[ |
1704 | 551 |
checkinInfoOrString := aLogInfoOrStringNil. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
552 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
553 |
|
1726 | 554 |
allClasses := classes. |
555 |
checkinInfoOrString quickCheckIn ifTrue:[ |
|
556 |
classes := classes select:[:aClass | ChangeSet current includesChangeForClassOrMetaclassOrPrivateClassOf:aClass]. |
|
557 |
]. |
|
558 |
||
1727 | 559 |
AbortAllOperationRequest handle:[:ex | |
560 |
ex return |
|
561 |
] do:[ |
|
562 |
classes notEmpty ifTrue:[ |
|
1726 | 563 |
self yesToAllNotification handle:[:ex | |
564 |
yesOrNoToAll := ex parameter. |
|
565 |
ex proceed |
|
1016 | 566 |
] do:[ |
1726 | 567 |
self yesToAllQuery handle:[:ex | |
568 |
ex proceedWith:yesOrNoToAll |
|
569 |
] do:[ |
|
570 |
classes do:[:aClass | |
|
571 |
self activityNotification:(resources string:'checking in %1' with:aClass name). |
|
572 |
"/ ca does not want boxes to pop up all over ... |
|
573 |
UserInformation handle:[:ex | |
|
574 |
Transcript showCR:ex description. |
|
575 |
ex proceed. |
|
576 |
] do:[ |
|
577 |
AbortOperationRequest catch:[ |
|
578 |
self |
|
579 |
checkinClass:aClass |
|
580 |
withInfo:checkinInfoOrString |
|
581 |
withCheck:doCheckClasses |
|
582 |
] |
|
583 |
]. |
|
992 | 584 |
]. |
1016 | 585 |
] |
1726 | 586 |
]. |
587 |
]. |
|
588 |
||
1727 | 589 |
(checkinInfoOrString isStable or:[checkinInfoOrString tagIt]) |
590 |
ifTrue:[ |
|
591 |
"/mhmh - but tag should be set on all (even unchanged ones) |
|
592 |
"/ the other onces have already been tagged |
|
593 |
unchangedClasses := allClasses select:[:eachClass | (classes includes:eachClass) not]. |
|
1726 | 594 |
|
1727 | 595 |
"mhmh - could still have to tag them" |
596 |
checkinInfoOrString isStable ifTrue:[ |
|
597 |
unchangedClasses do:[:eachClass | |
|
598 |
self tagClass:eachClass as:#stable. |
|
599 |
]. |
|
1726 | 600 |
]. |
1727 | 601 |
checkinInfoOrString tagIt ifTrue:[ |
602 |
unchangedClasses do:[:eachClass | |
|
1728 | 603 |
self tagClass:eachClass as:(checkinInfoOrString tag). |
1727 | 604 |
]. |
1726 | 605 |
]. |
1016 | 606 |
]. |
992 | 607 |
]. |
1782 | 608 |
|
609 |
"Modified: / 12-09-2006 / 13:07:49 / cg" |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
610 |
! |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
611 |
|
1704 | 612 |
checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withInfo:aLogInfoOrStringOrNil |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
613 |
"checkin a projects extensions into the source repository. |
1704 | 614 |
If the argument, aLogInfoOrStringOrNil isNil, ask interactively for log-message." |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
615 |
|
1704 | 616 |
|logMessage checkinInfo mgr pri resources module directory containerFileName s |
1015 | 617 |
methodSource methodsSortedByName| |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
618 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
619 |
resources := self classResources. |
957 | 620 |
|
1782 | 621 |
mgr := self sourceCodeManagerFor:aCollectionOfMethods first mclass. |
957 | 622 |
mgr isNil ifTrue:[ |
1782 | 623 |
^ false. |
957 | 624 |
]. |
1522 | 625 |
|
1704 | 626 |
module := aPackageID asPackageId module. |
627 |
directory := aPackageID asPackageId directory. |
|
628 |
containerFileName := self nameOfExtensionsContainer. |
|
957 | 629 |
|
1704 | 630 |
aLogInfoOrStringOrNil isNil ifTrue:[ |
631 |
checkinInfo := self getCheckinInfoFor:containerFileName allBold initialAnswer:nil. |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
632 |
checkinInfo isNil ifTrue:[^ false]. |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
633 |
logMessage := checkinInfo logMessage. |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
634 |
] ifFalse:[ |
1704 | 635 |
aLogInfoOrStringOrNil isString ifTrue:[ |
636 |
logMessage := aLogInfoOrStringOrNil |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
637 |
] ifFalse:[ |
1704 | 638 |
checkinInfo := aLogInfoOrStringOrNil. |
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
639 |
logMessage := checkinInfo logMessage. |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
640 |
]. |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
641 |
]. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
642 |
|
1158 | 643 |
(self checkForExistingModule:module using:mgr allowCreate:true) ifFalse:[^ false]. |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
644 |
LastModule := module. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
645 |
|
1704 | 646 |
(self checkForExistingModule:module directory:directory using:mgr allowCreate:true) ifFalse:[^ false]. |
647 |
LastPackage := directory. |
|
1015 | 648 |
|
1704 | 649 |
(self checkForExistingModule:module directory:directory container:containerFileName using:mgr allowCreate:true) ifFalse:[^ false]. |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
650 |
|
1120 | 651 |
self activityNotification:(resources string:'Checking in %1' with:containerFileName). |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
652 |
pri := Processor activePriority. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
653 |
Processor activeProcess withPriority:pri-1 to:pri |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
654 |
do:[ |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
655 |
s := '' writeStream. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
656 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
657 |
s nextPutAll:'"{ Package: '''. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
658 |
s nextPutAll:aPackageID asString. |
923 | 659 |
s nextPutAll:''' }"'; cr; nextPutChunkSeparator; cr; cr. |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
660 |
|
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
661 |
"/ s nextPutAll:(Smalltalk timeStamp). |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
662 |
"/ s nextPutChunkSeparator. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
663 |
"/ s cr; cr. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
664 |
|
1015 | 665 |
"/ sort them by name (to avoid conflict due to CVS merge) |
666 |
methodsSortedByName := aCollectionOfMethods asOrderedCollection. |
|
667 |
methodsSortedByName sort:[:a :b | |
|
668 |
|clsA clsB| |
|
669 |
||
670 |
clsA := a mclass name. |
|
671 |
clsB := b mclass name. |
|
672 |
clsA < clsB ifTrue:[ |
|
673 |
true |
|
674 |
] ifFalse:[ |
|
675 |
clsA > clsB ifTrue:[ |
|
676 |
false |
|
677 |
] ifFalse:[ |
|
678 |
a selector < b selector |
|
679 |
] |
|
680 |
] |
|
681 |
]. |
|
682 |
methodsSortedByName do:[:aMethod | |
|
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
683 |
aMethod mclass fileOutMethod:aMethod on:s. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
684 |
s cr. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
685 |
]. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
686 |
methodSource := s contents. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
687 |
|
1245 | 688 |
UserInformation handle:[:ex | |
1323 | 689 |
Transcript showCR:ex description. |
690 |
ex proceed. |
|
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
691 |
] do:[ |
1711 | 692 |
Transcript showCR:('checking in ',containerFileName,' ...'). |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
693 |
(mgr |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
694 |
checkin:containerFileName |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
695 |
text:methodSource |
1704 | 696 |
directory:directory |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
697 |
module:module |
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
698 |
logMessage:logMessage |
1090
8608e5b91fa7
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
699 |
force:false) |
8608e5b91fa7
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
700 |
ifFalse:[ |
1120 | 701 |
Transcript showCR:'Checkin of ''' , containerFileName , ''' failed'. |
702 |
self warn:'Checkin of ''' , containerFileName allBold , ''' failed'. |
|
1090
8608e5b91fa7
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
703 |
^ false. |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
704 |
]. |
1725 | 705 |
checkinInfo notNil ifTrue:[ |
1726 | 706 |
|path| |
707 |
||
708 |
path := (module, '/', directory, '/', containerFileName). |
|
1725 | 709 |
checkinInfo isStable ifTrue:[ |
710 |
"set stable tag for class that has been checked in" |
|
1726 | 711 |
self tagPath:path as:#stable using:mgr. |
1725 | 712 |
]. |
713 |
checkinInfo tagIt ifTrue:[ |
|
714 |
"set an additional tag for class that has been checked in" |
|
1728 | 715 |
self tagPath:path as:(checkinInfo tag) using:mgr. |
1725 | 716 |
]. |
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
717 |
]. |
1090
8608e5b91fa7
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
718 |
mgr postCheckInExtensionsForPackage:aPackageID |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
719 |
]. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
720 |
]. |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
721 |
^ true |
1090
8608e5b91fa7
condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents:
1084
diff
changeset
|
722 |
|
1782 | 723 |
"Modified: / 12-09-2006 / 14:14:49 / cg" |
922
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
724 |
! |
24cfcd3043a2
file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
725 |
|
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
726 |
checkoutClass:aClass askForMerge:askForMerge |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
727 |
"check-out a class from the source repository." |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
728 |
|
1006 | 729 |
self |
730 |
checkoutClass:aClass |
|
731 |
askForRevision:true |
|
732 |
askForMerge:askForMerge |
|
733 |
! |
|
734 |
||
735 |
checkoutClass:aClass askForRevision:askForRevision askForMerge:askForMerge |
|
736 |
"check-out a class from the source repository. |
|
737 |
If askForRevision is false, check-out the newest version." |
|
738 |
||
1084 | 739 |
|mgr resources sourceInfo |
1339 | 740 |
currentClass inChangeSet |
1055
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
741 |
aStream sourceToLoad currentSource rev revString |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
742 |
nm msg rev2 newestRev |
1030 | 743 |
containerModule containerPackage containerFile rslt |
744 |
pkg listHere listRep diffSet |
|
1054 | 745 |
changed onlyHere onlyInRep answer labels values singleChangeSelector |
1879
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
746 |
changedClasses default versionMethodsHere versionMethodsRep changedClassDefinitions |
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
747 |
wasInChangeSetBefore| |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
748 |
|
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
749 |
aClass isNil ifTrue:[self error:'nil class']. |
1158 | 750 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
751 |
resources := self classResources. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
752 |
|
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
753 |
currentClass := aClass theNonMetaclass. |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
754 |
|
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
755 |
nm := currentClass name. |
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
756 |
mgr := self sourceCodeManagerFor:currentClass. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
757 |
mgr isNil ifTrue:[ |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
758 |
^ self |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
759 |
]. |
1084 | 760 |
|
761 |
sourceInfo := mgr sourceInfoOfClass:currentClass. |
|
762 |
sourceInfo notNil ifTrue:[ |
|
1864 | 763 |
currentClass package ~= Project noProjectID ifTrue:[ |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
764 |
containerPackage := mgr directoryFromSourceInfo:sourceInfo. |
1084 | 765 |
containerModule := mgr moduleFromSourceInfo:sourceInfo. |
766 |
]. |
|
767 |
containerFile := mgr containerFromSourceInfo:sourceInfo. |
|
768 |
]. |
|
769 |
||
989
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
770 |
currentClass isLoaded ifTrue:[ |
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
771 |
rev := currentClass binaryRevision. |
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
772 |
rev2 := currentClass revision. |
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
773 |
rev isNil ifTrue:[ |
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
774 |
rev := rev2 |
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
775 |
]. |
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
776 |
rev isNil ifTrue:[ |
1084 | 777 |
pkg := currentClass package. |
1864 | 778 |
(pkg notNil and:[pkg ~= Project noProjectID]) ifTrue:[ |
1019 | 779 |
containerModule := pkg upTo:$:. |
780 |
containerPackage := pkg copyFrom:(containerModule size + 2). |
|
781 |
]. |
|
782 |
containerModule size == 0 ifTrue:[ |
|
1084 | 783 |
containerModule := (SourceCodeManagerUtilities lastModule ) ? Project current repositoryModule. |
1019 | 784 |
]. |
785 |
containerPackage size == 0 ifTrue:[ |
|
1084 | 786 |
containerPackage := (SourceCodeManagerUtilities lastPackage ) ? Project current package. |
1019 | 787 |
]. |
1030 | 788 |
answer := self confirmWithCancel:(resources |
1035 | 789 |
string:'The class %3 seems to have no (valid) repository information.\\I assume you want to check it out from: %1/%2.' |
1030 | 790 |
with:containerModule allBold |
1035 | 791 |
with:containerPackage allBold |
1084 | 792 |
with:currentClass name allBold) withCRs. |
1030 | 793 |
answer isNil ifTrue:[^ self "cancelled"]. |
794 |
answer ifFalse:[ |
|
795 |
rslt := SourceCodeManagerUtilities |
|
796 |
askForContainer:(resources string:'The class seems to have no repository information.\\Do you want to checkOut from an existing containers contents ?') |
|
797 |
title:'Container to load from' note:nil |
|
798 |
initialModule:containerModule |
|
799 |
initialPackage:containerPackage |
|
1158 | 800 |
initialFileName:(currentClass nameWithoutPrefix , '.st') |
1030 | 801 |
forNewContainer:false. |
1084 | 802 |
|
1030 | 803 |
rslt isNil ifTrue:[ |
804 |
"/ canel |
|
805 |
^ self |
|
806 |
]. |
|
807 |
containerModule := "lastModule :=" rslt at:#module. |
|
808 |
containerPackage := "lastPackage :=" rslt at:#package. |
|
809 |
containerFile := rslt at:#fileName. |
|
810 |
]. |
|
1019 | 811 |
|
812 |
"/ rslt := SourceCodeManagerUtilities |
|
813 |
"/ askForContainer:(resources string:'The class seems to have no (valid) repository information.\\Do you want to check it out from an existing container ?') |
|
814 |
"/ title:'Container to checkOut' note:nil |
|
815 |
"/ initialModule:containerModule |
|
816 |
"/ initialPackage:containerPackage |
|
817 |
"/ initialFileName:(currentClass name , '.st'). |
|
1030 | 818 |
"/ forNewContainer:false. |
1019 | 819 |
"/ rslt isNil ifTrue:[^ self]. |
820 |
"/ self warn:(resources string:'Class %1 seems to be not yet in the repository' with:currentClass name allBold). |
|
821 |
"/ ^ self |
|
989
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
822 |
]. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
823 |
]. |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
824 |
|
1966 | 825 |
containerFile isNil ifTrue:[ |
826 |
containerFile := currentClass classFilename. |
|
827 |
]. |
|
828 |
||
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
829 |
"/ |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
830 |
"/ class in repository - ask for revision |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
831 |
"/ |
1084 | 832 |
"/ newestRev := mgr newestRevisionOf:currentClass. |
833 |
newestRev := mgr newestRevisionInFile:containerFile directory:containerPackage module:containerModule. |
|
1006 | 834 |
askForRevision ifFalse:[ |
835 |
rev := newestRev ? '' |
|
836 |
] ifTrue:[ |
|
1019 | 837 |
msg := resources string:'CheckOut which revision of ''%1'': (empty for newest)' with:nm allBold. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
838 |
rev notNil ifTrue:[ |
1006 | 839 |
msg := msg , '\\' , (resources string:'Current ''%1'' is based upon rev %2.' |
1019 | 840 |
with:nm allBold with:rev). |
1006 | 841 |
(rev2 notNil and:[rev2 ~= rev]) ifTrue:[ |
842 |
msg := msg , '\' , (resources string:'And has been checked into the repository as %1.' |
|
843 |
with:rev2) |
|
844 |
] |
|
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
845 |
]. |
1006 | 846 |
newestRev notNil ifTrue:[ |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
847 |
msg := msg , '\' , (resources string:'Newest in repository is %1.' |
1006 | 848 |
with:newestRev) |
989
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
849 |
]. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
850 |
|
1006 | 851 |
rev := SourceCodeManagerUtilities |
852 |
askForExistingRevision:msg |
|
853 |
title:'CheckOut from repository' |
|
854 |
class:currentClass. |
|
855 |
rev isNil ifTrue:[ |
|
1339 | 856 |
^ self "/ canceled |
987 | 857 |
]. |
1006 | 858 |
]. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
859 |
|
1006 | 860 |
rev withoutSpaces isEmpty ifTrue:[ |
861 |
msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'. |
|
862 |
"/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm. |
|
863 |
aStream := mgr getSourceStreamFor:currentClass revision:newestRev. |
|
864 |
revString := '(newest: ' , (newestRev ? '???') , ')'. |
|
865 |
] ifFalse:[ |
|
866 |
msg := 'extracting previous %1'. |
|
1084 | 867 |
"/ aStream := mgr getSourceStreamFor:currentClass revision:rev. |
868 |
"/ revString := rev |
|
869 |
aStream := mgr |
|
870 |
streamForClass:currentClass |
|
871 |
fileName:containerFile |
|
872 |
revision:rev |
|
873 |
directory:containerPackage |
|
874 |
module:containerModule |
|
875 |
cache:true. |
|
1006 | 876 |
]. |
996 | 877 |
|
1006 | 878 |
aStream isNil ifTrue:[ |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
879 |
self warn:(resources string:'Could not extract source of %1 from repository' with:aClass name allBold). |
1006 | 880 |
^ self |
881 |
]. |
|
882 |
aStream class readErrorSignal handle:[:ex | |
|
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
883 |
self warn:('Read error while reading extracted source\\' , ex description) withCRs. |
1006 | 884 |
aStream close. |
885 |
^ self |
|
886 |
] do:[ |
|
887 |
sourceToLoad := aStream contents asString. |
|
888 |
]. |
|
889 |
aStream close. |
|
987 | 890 |
|
1919 | 891 |
wasInChangeSetBefore := ChangeSet current includesChangeForClassOrMetaclass:currentClass. |
1879
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
892 |
|
1006 | 893 |
currentClass isLoaded ifFalse:[ |
894 |
rev = newestRev ifTrue:[ |
|
895 |
currentClass autoload. |
|
996 | 896 |
] ifFalse:[ |
1006 | 897 |
sourceToLoad readStream fileIn. |
996 | 898 |
]. |
1879
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
899 |
wasInChangeSetBefore ifFalse:[ |
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
900 |
ChangeSet current condenseChangesForClass:currentClass. |
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
901 |
]. |
1006 | 902 |
^ self. |
903 |
]. |
|
904 |
||
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
905 |
inChangeSet := ChangeSet current includesChangeForClassOrMetaclassOrPrivateClassOf:aClass. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
906 |
|
1006 | 907 |
self activityNotification:'generating current source...'. |
908 |
||
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
909 |
currentSource := self sourceCodeOfClass:currentClass. |
1006 | 910 |
|
911 |
self activityNotification:'comparing...'. |
|
912 |
||
913 |
sourceToLoad = currentSource ifTrue:[ |
|
914 |
"/ make all methods belong to the classes project |
|
915 |
self setPackageOfAllMethodsIn:aClass to:aClass package. |
|
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
916 |
inChangeSet ifTrue:[ |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
917 |
rev = newestRev ifTrue:[ |
1879
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
918 |
(wasInChangeSetBefore not |
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
919 |
or:[ self confirm:(resources |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
920 |
stringWithCRs:'%1 is up-to-date.\\Remove entries for %1 from changeSet ?' |
1879
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
921 |
with:aClass name)]) |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
922 |
ifTrue:[ |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
923 |
ChangeSet current condenseChangesForClass:aClass. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
924 |
]. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
925 |
]. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
926 |
]. |
1006 | 927 |
^ self. |
928 |
]. |
|
929 |
||
930 |
self activityNotification:'generating diffSet...'. |
|
1972
32853d3cb43a
care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
931 |
Error handle:[:ex | |
32853d3cb43a
care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
932 |
(Dialog confirm:(resources stringWithCRs:'An error was encountered while generating the current source of the class %1.\This might be due to some missing or corrupted source file.\You may proceed, but no information about the differences between your current version and the repositories version can be shown.\\Continue ?' |
32853d3cb43a
care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
933 |
with:currentClass name allBold) noLabel:'Cancel') ifFalse:[ |
32853d3cb43a
care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
934 |
AbortSignal raise |
32853d3cb43a
care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
935 |
]. |
32853d3cb43a
care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
936 |
listHere := ChangeSet new |
32853d3cb43a
care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
937 |
] do:[ |
32853d3cb43a
care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
938 |
listHere := ChangeSet fromStream:(currentSource readStream). |
32853d3cb43a
care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
939 |
]. |
1006 | 940 |
listRep := ChangeSet fromStream:(sourceToLoad readStream). |
1051 | 941 |
|
942 |
versionMethodsHere := listHere select:[:change | (change isMethodChange |
|
943 |
and:[change selector == #version |
|
944 |
and:[change changeClass isMeta]])]. |
|
945 |
||
946 |
versionMethodsRep := listRep select:[:change | (change isMethodChange |
|
947 |
and:[change selector == #version |
|
948 |
and:[change changeClass isMeta]])]. |
|
949 |
||
1044 | 950 |
"/ compare all but the version methods |
951 |
listHere := listHere select:[:change | (change isMethodChange |
|
952 |
and:[change selector == #version |
|
953 |
and:[change changeClass isMeta]]) not]. |
|
954 |
listRep := listRep select:[:change | (change isMethodChange |
|
955 |
and:[change selector == #version |
|
956 |
and:[change changeClass isMeta]]) not]. |
|
957 |
||
1006 | 958 |
diffSet := listHere diffSetsAgainst:listRep. |
1157 | 959 |
changed := diffSet changed. |
960 |
onlyHere := diffSet onlyInReceiver. |
|
961 |
onlyInRep := diffSet onlyInArg. |
|
1006 | 962 |
|
1050 | 963 |
changedClassDefinitions := changed select:[:eachChangePair | eachChangePair first isClassDefinitionChange]. |
964 |
changed := changed reject:[:eachChangePair | eachChangePair first isClassDefinitionChange]. |
|
1966 | 965 |
changed := changed reject:[:eachChangePair | eachChangePair first isClassCommentChange]. |
1050 | 966 |
|
1121 | 967 |
labels := #('Cancel' 'Merge' 'Load'). |
1006 | 968 |
values := #(nil #merge #load). |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
969 |
default := askForRevision |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
970 |
ifTrue:[3. "i.e. load"] |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
971 |
ifFalse:[2. "i.e. merge"]. |
1006 | 972 |
|
1339 | 973 |
msg := 'About to load ''%4''.\\'. |
1006 | 974 |
onlyInRep size > 0 ifTrue:[ |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
975 |
msg := msg , 'The repositories version contains %1 method(s) which are not in your current class.\'. |
1006 | 976 |
]. |
977 |
onlyHere size > 0 ifTrue:[ |
|
978 |
onlyInRep size > 0 ifTrue:[ |
|
979 |
msg := msg , 'And there '. |
|
980 |
] ifFalse:[ |
|
981 |
msg := msg , 'There '. |
|
996 | 982 |
]. |
1006 | 983 |
msg := msg , 'are %2 methods in your current class, which are not in the repository.\'. |
984 |
]. |
|
985 |
changed size > 0 ifTrue:[ |
|
1054 | 986 |
changed size == 1 ifTrue:[ |
1339 | 987 |
msg := msg , 'The ''%6''-method is different (present in both).\\'. |
1291
60d89faa389f
no need for asText when sending allBold
Claus Gittinger <cg@exept.de>
parents:
1262
diff
changeset
|
988 |
singleChangeSelector := changed first first selector allBold |
1054 | 989 |
] ifFalse:[ |
990 |
msg := msg , '%3 methods are different (present in both).\\'. |
|
991 |
] |
|
1006 | 992 |
]. |
1050 | 993 |
changedClassDefinitions size > 0 ifTrue:[ |
994 |
changedClassDefinitions size == 1 ifTrue:[ |
|
1339 | 995 |
msg := msg , 'The class definition is different.\\'. |
1050 | 996 |
] ifFalse:[ |
997 |
msg := msg , '%5 class definitions are different.\\'. |
|
998 |
] |
|
999 |
]. |
|
996 | 1000 |
|
1006 | 1001 |
onlyHere isEmpty ifTrue:[ |
1002 |
onlyInRep isEmpty ifTrue:[ |
|
1050 | 1003 |
(changed isEmpty and:[changedClassDefinitions isEmpty]) ifTrue:[ |
1006 | 1004 |
"/ make all methods belong to the classes project |
1055
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1005 |
versionMethodsRep size == 1 ifTrue:[ |
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1006 |
"/ (self confirm:(resources string:'Versions are identical: %1\\Update the version-ID ?' with:aClass name) withCRs) ifTrue:[ |
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1007 |
versionMethodsRep first apply. |
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1008 |
"/ ] |
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1009 |
]. |
1006 | 1010 |
self setPackageOfAllMethodsIn:aClass to:aClass package. |
1011 |
^ self |
|
1012 |
]. |
|
1339 | 1013 |
inChangeSet ifTrue:[ |
1014 |
msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made).'. |
|
1015 |
]. |
|
1121 | 1016 |
labels := #('Cancel' 'Load'). |
1006 | 1017 |
values := #(nil #load). |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1018 |
default := askForRevision |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1019 |
ifTrue:[2. "i.e. load"] |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1020 |
ifFalse:[1. "i.e. cancel"]. |
1907 | 1021 |
default := 2. |
1006 | 1022 |
] ifFalse:[ |
1023 |
changed isEmpty ifTrue:[ |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1024 |
msg := msg , '\Attention:\Load will load methods which are not present in ''%4''.'. |
1121 | 1025 |
labels := #('Cancel' 'Load'). |
987 | 1026 |
values := #(nil #load). |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1027 |
default := askForRevision |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1028 |
ifTrue:[2. "i.e. load"] |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1029 |
ifFalse:[1. "i.e. cancel"]. |
1907 | 1030 |
default := 2. |
987 | 1031 |
] ifFalse:[ |
1339 | 1032 |
inChangeSet ifTrue:[ |
1033 |
msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'. |
|
1034 |
]. |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1035 |
msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'. |
1006 | 1036 |
]. |
1037 |
] |
|
1038 |
] ifFalse:[ |
|
1039 |
onlyInRep isEmpty ifTrue:[ |
|
1339 | 1040 |
inChangeSet ifTrue:[ |
1041 |
msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made),'. |
|
1042 |
msg := msg , '\and remove added methods which are not present in the repository version.'. |
|
1043 |
]. |
|
1121 | 1044 |
labels := #('Cancel' 'Load'). |
1006 | 1045 |
values := #(nil #load). |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1046 |
default := askForRevision |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1047 |
ifTrue:[2. "i.e. load"] |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1048 |
ifFalse:[1. "i.e. cancel"]. |
1907 | 1049 |
default := 2. |
1006 | 1050 |
] ifFalse:[ |
1339 | 1051 |
inChangeSet ifTrue:[ |
1052 |
msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'. |
|
1053 |
msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'. |
|
1054 |
] |
|
1006 | 1055 |
] |
1056 |
]. |
|
1050 | 1057 |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1058 |
msg := msg bindWith:onlyInRep size printString |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1059 |
with:onlyHere size printString |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1060 |
with:changed size printString |
1050 | 1061 |
with:aClass name allBold |
1054 | 1062 |
with:changedClassDefinitions size printString |
1063 |
with:singleChangeSelector. |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1064 |
|
1006 | 1065 |
answer := (Dialog confirmWithCancel:msg withCRs |
1066 |
labels:(resources array:labels) |
|
1067 |
values:values |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1068 |
default:default). |
1006 | 1069 |
answer isNil ifTrue:[^ self]. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1070 |
|
1006 | 1071 |
self activityNotification:'updating...'. |
1072 |
changedClasses := IdentitySet new. |
|
1000 | 1073 |
|
1058
90807c795eb5
do update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1057
diff
changeset
|
1074 |
"/ Class withoutUpdatingChangesDo:[ |
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1075 |
answer == #load ifTrue:[ |
1971
11dfb42fa1bc
when loading a changed class, remove the original class before,
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1076 |
changedClassDefinitions do:[:eachChangeArr | |
11dfb42fa1bc
when loading a changed class, remove the original class before,
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1077 |
"when loading, remove the classes first" |
11dfb42fa1bc
when loading a changed class, remove the original class before,
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1078 |
|cHere cls| |
11dfb42fa1bc
when loading a changed class, remove the original class before,
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1079 |
cHere := eachChangeArr at:1. |
11dfb42fa1bc
when loading a changed class, remove the original class before,
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1080 |
cls := cHere changeClass. |
11dfb42fa1bc
when loading a changed class, remove the original class before,
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1081 |
Smalltalk removeKey:(cls name). |
11dfb42fa1bc
when loading a changed class, remove the original class before,
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1082 |
]. |
11dfb42fa1bc
when loading a changed class, remove the original class before,
Claus Gittinger <cg@exept.de>
parents:
1966
diff
changeset
|
1083 |
|
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1084 |
changedClassDefinitions do:[:eachChangeArr | "apply this change (go to rep-version)" |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1085 |
|cHere cRep| |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1086 |
cHere := eachChangeArr at:1. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1087 |
cRep := eachChangeArr at:2. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1088 |
cRep apply. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1089 |
cRep isMethodChange ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1090 |
cRep changeMethod setPackage:(cRep changeClass package). |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1091 |
changedClasses add:cRep changeClass. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1092 |
] |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1093 |
]. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1094 |
]. |
1006 | 1095 |
onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)" |
1096 |
eachChange apply. |
|
1097 |
eachChange isMethodChange ifTrue:[ |
|
1011
647a8c2fabc1
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
1098 |
eachChange changeMethod setPackage:(eachChange changeClass package). |
1006 | 1099 |
changedClasses add:eachChange changeClass. |
1100 |
] |
|
1101 |
]. |
|
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1102 |
answer == #load ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1103 |
onlyHere do:[:eachChange | "remove this change (method not present in rep-version)" |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1104 |
|cClass cSel| |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1105 |
eachChange isMethodChange ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1106 |
cClass := eachChange changeClass. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1107 |
cSel := eachChange selector. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1108 |
cClass removeSelector:cSel. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1109 |
] |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1110 |
]. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1111 |
changed do:[:eachChangeArr | "apply this change (go to rep-version)" |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1112 |
|cHere cRep| |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1113 |
cHere := eachChangeArr at:1. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1114 |
cRep := eachChangeArr at:2. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1115 |
cRep apply. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1116 |
cRep isMethodChange ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1117 |
cRep changeMethod setPackage:(cRep changeClass package). |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1118 |
changedClasses add:cRep changeClass. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1119 |
] |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1120 |
]. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1121 |
"/ make all methods belong to the classes project |
1055
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1122 |
self setPackageOfAllMethodsIn:aClass to:aClass package. |
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1123 |
versionMethodsRep size == 1 ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1124 |
versionMethodsRep first apply. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1125 |
self setPackageOfAllMethodsIn:aClass to:aClass package. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1126 |
] ifFalse:[ |
1194 | 1127 |
self error:'too many version methods'. |
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1128 |
]. |
1055
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1129 |
]. |
1058
90807c795eb5
do update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1057
diff
changeset
|
1130 |
"/ ]. |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1131 |
|
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1132 |
answer == #load ifTrue:[ |
1811 | 1133 |
inChangeSet := ChangeSet current includesChangeForClassOrMetaclassOrPrivateClassOf:aClass. |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1134 |
inChangeSet ifTrue:[ |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1135 |
rev = newestRev ifTrue:[ |
1879
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
1136 |
(wasInChangeSetBefore not |
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
1137 |
or:[ self confirm:(resources |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1138 |
stringWithCRs:'%1 is now up-to-date.\\Remove entries for %1 from changeSet ?' |
1879
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
1139 |
with:aClass name)]) |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1140 |
ifTrue:[ |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1141 |
ChangeSet current condenseChangesForClass:aClass. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1142 |
]. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1143 |
]. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1144 |
]. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1145 |
]. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1146 |
|
1006 | 1147 |
changedClasses do:[:eachClass | |
1148 |
eachClass changed:#projectOrganization. |
|
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1149 |
]. |
1011
647a8c2fabc1
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
1150 |
Smalltalk changed:#projectOrganization. |
1044 | 1151 |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
1152 |
"Modified: / 07-02-2001 / 18:18:32 / ps" |
1972
32853d3cb43a
care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
1153 |
"Modified: / 15-10-2007 / 14:11:51 / cg" |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1154 |
! |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1155 |
|
1522 | 1156 |
checkoutExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision askForMerge:askForMerge using:aSourceCodeManager |
1157 |
"check-out a class from the source repository. |
|
1158 |
If askForRevision is false, check-out the newest version." |
|
1159 |
||
1841
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
1160 |
|resources |
1704 | 1161 |
inChangeSet extensionMethods |
1841
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
1162 |
rev msg |
1704 | 1163 |
listHere listRep diffSet |
1522 | 1164 |
changed onlyHere onlyInRep answer labels values singleChangeSelector |
1165 |
changedClasses default | |
|
1166 |
||
1841
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
1167 |
listRep := self changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision using:aSourceCodeManager. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
1168 |
listRep isNil ifTrue:[ ^self ]. |
1522 | 1169 |
|
1841
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
1170 |
resources := self classResources. |
1522 | 1171 |
|
1172 |
self activityNotification:'generating diffSet...'. |
|
1173 |
||
1174 |
extensionMethods := OrderedCollection new. |
|
1175 |
Smalltalk allClassesDo:[:aClass | |owner classPackage| |
|
1176 |
"/ individual methods ... |
|
1177 |
aClass isMeta ifFalse:[ |
|
1178 |
(aClass package ~= packageToCheckOut) ifTrue:[ |
|
1179 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
1180 |
"/ methods in this project ... |
|
1181 |
(mthd package = packageToCheckOut) ifTrue:[ |
|
1182 |
"/ ... whose class is not in the ckechIn-set |
|
1183 |
extensionMethods add:mthd |
|
1184 |
] |
|
1185 |
]. |
|
1186 |
]. |
|
1187 |
]. |
|
1188 |
]. |
|
1189 |
listHere := ChangeSet forExistingMethods:extensionMethods. |
|
1190 |
||
1191 |
inChangeSet := listRep contains:[:someChange | |
|
1192 |
|cClass cSel| |
|
1193 |
||
1194 |
someChange isMethodChange ifTrue:[ |
|
1195 |
cClass := someChange changeClass. |
|
1196 |
cSel := someChange selector. |
|
1197 |
ChangeSet current includesChangeForClass:cClass selector:cSel |
|
1198 |
] |
|
1199 |
]. |
|
1200 |
||
1201 |
diffSet := listHere diffSetsAgainst:listRep. |
|
1202 |
changed := diffSet changed. |
|
1203 |
onlyHere := diffSet onlyInReceiver. |
|
1204 |
onlyInRep := diffSet onlyInArg. |
|
1205 |
||
1206 |
labels := #('Cancel' 'Merge' 'Load'). |
|
1207 |
values := #(nil #merge #load). |
|
1208 |
default := askForRevision |
|
1209 |
ifTrue:[3. "i.e. load"] |
|
1210 |
ifFalse:[2. "i.e. merge"]. |
|
1211 |
||
1212 |
msg := 'About to load extensions for ''%5''.\\'. |
|
1213 |
onlyInRep size > 0 ifTrue:[ |
|
1214 |
msg := msg , 'The repositories version contains %1 extension method(s) which are not in your current image.\'. |
|
1215 |
]. |
|
1216 |
onlyHere size > 0 ifTrue:[ |
|
1217 |
onlyInRep size > 0 ifTrue:[ |
|
1218 |
msg := msg , 'And there '. |
|
1219 |
] ifFalse:[ |
|
1220 |
msg := msg , 'There '. |
|
1221 |
]. |
|
1222 |
msg := msg , 'are %2 extension methods in your current image, which are not in the repository.\'. |
|
1223 |
]. |
|
1224 |
changed size > 0 ifTrue:[ |
|
1225 |
changed size == 1 ifTrue:[ |
|
1226 |
msg := msg , 'The ''%5''-method is different (present in both).\\'. |
|
1227 |
singleChangeSelector := changed first first selector allBold |
|
1228 |
] ifFalse:[ |
|
1229 |
msg := msg , '%3 methods are different (present in both).\\'. |
|
1230 |
] |
|
1231 |
]. |
|
1232 |
||
1233 |
onlyHere isEmpty ifTrue:[ |
|
1234 |
onlyInRep isEmpty ifTrue:[ |
|
1235 |
(changed isEmpty) ifTrue:[ |
|
1236 |
listRep do:[:eachChange | |
|
1237 |
eachChange changeMethod setPackage:packageToCheckOut. |
|
1238 |
]. |
|
1239 |
^ self |
|
1240 |
]. |
|
1241 |
inChangeSet ifTrue:[ |
|
1242 |
msg := msg , '\Attention:\Load may undo any changes made to on of the extension methods (if any were made).'. |
|
1243 |
]. |
|
1244 |
labels := #('Cancel' 'Load'). |
|
1245 |
values := #(nil #load). |
|
1246 |
default := askForRevision |
|
1247 |
ifTrue:[2. "i.e. load"] |
|
1248 |
ifFalse:[1. "i.e. cancel"]. |
|
1249 |
] ifFalse:[ |
|
1250 |
changed isEmpty ifTrue:[ |
|
1251 |
msg := msg , '\Attention:\Load will load methods which are not present in the image.'. |
|
1252 |
labels := #('Cancel' 'Load'). |
|
1253 |
values := #(nil #load). |
|
1254 |
default := askForRevision |
|
1255 |
ifTrue:[2. "i.e. load"] |
|
1256 |
ifFalse:[1. "i.e. cancel"]. |
|
1257 |
] ifFalse:[ |
|
1258 |
inChangeSet ifTrue:[ |
|
1259 |
msg := msg , '\Attention:\Load will undo your changes made to the image (if any were made);'. |
|
1260 |
]. |
|
1261 |
msg := msg , '\Merge will only load methods which are not present in the image (i.e. undo removals but preserve changes).'. |
|
1262 |
]. |
|
1263 |
] |
|
1264 |
] ifFalse:[ |
|
1265 |
onlyInRep isEmpty ifTrue:[ |
|
1266 |
inChangeSet ifTrue:[ |
|
1267 |
msg := msg , '\Attention:\Load will undo your changes made to the image (if any were made),'. |
|
1268 |
msg := msg , '\and remove added methods which are not present in the repository version.'. |
|
1269 |
]. |
|
1270 |
labels := #('Cancel' 'Load'). |
|
1271 |
values := #(nil #load). |
|
1272 |
default := askForRevision |
|
1273 |
ifTrue:[2. "i.e. load"] |
|
1274 |
ifFalse:[1. "i.e. cancel"]. |
|
1275 |
] ifFalse:[ |
|
1276 |
inChangeSet ifTrue:[ |
|
1277 |
msg := msg , '\Attention:\Load will undo your changes made to the image (if any were made);'. |
|
1278 |
msg := msg , '\Merge will only load methods which are not present in the image (i.e. undo removals but preserve changes).'. |
|
1279 |
] |
|
1280 |
] |
|
1281 |
]. |
|
1282 |
||
1283 |
msg := msg bindWith:onlyInRep size printString |
|
1284 |
with:onlyHere size printString |
|
1285 |
with:changed size printString |
|
1286 |
with:singleChangeSelector |
|
1287 |
with:packageToCheckOut allBold. |
|
1288 |
||
1289 |
answer := (Dialog confirmWithCancel:msg withCRs |
|
1290 |
labels:(resources array:labels) |
|
1291 |
values:values |
|
1292 |
default:default). |
|
1293 |
answer isNil ifTrue:[^ self]. |
|
1294 |
||
1295 |
self activityNotification:'updating...'. |
|
1296 |
changedClasses := IdentitySet new. |
|
1297 |
||
1298 |
"/ Class withoutUpdatingChangesDo:[ |
|
1299 |
onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)" |
|
1300 |
Class withoutUpdatingChangeSetDo:[ eachChange apply ]. |
|
1301 |
||
1302 |
eachChange changeMethod setPackage:packageToCheckOut. |
|
1303 |
changedClasses add:eachChange changeClass. |
|
1304 |
]. |
|
1305 |
answer == #load ifTrue:[ |
|
1306 |
onlyHere do:[:eachChange | "remove this change (method not present in rep-version)" |
|
1307 |
|cClass cSel| |
|
1308 |
||
1309 |
cClass := eachChange changeClass. |
|
1310 |
cSel := eachChange selector. |
|
1311 |
Class withoutUpdatingChangeSetDo:[ cClass removeSelector:cSel ]. |
|
1312 |
]. |
|
1313 |
changed do:[:eachChangeArr | "apply this change (go to rep-version)" |
|
1314 |
|cHere cRep| |
|
1315 |
cHere := eachChangeArr at:1. |
|
1316 |
cRep := eachChangeArr at:2. |
|
1317 |
Class withoutUpdatingChangeSetDo:[ cRep apply ]. |
|
1318 |
||
1319 |
cRep changeMethod setPackage:packageToCheckOut. |
|
1320 |
changedClasses add:cRep changeClass. |
|
1321 |
]. |
|
1322 |
]. |
|
1323 |
"/ ]. |
|
1324 |
changedClasses do:[:eachClass | |
|
1325 |
eachClass changed:#projectOrganization. |
|
1326 |
]. |
|
1327 |
Smalltalk changed:#projectOrganization. |
|
1328 |
||
1329 |
"Modified: / 07-02-2001 / 18:18:32 / ps" |
|
1330 |
"Created: / 10-08-2006 / 18:57:30 / cg" |
|
1841
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
1331 |
"Modified: / 09-10-2006 / 13:06:43 / cg" |
1522 | 1332 |
! |
1333 |
||
957 | 1334 |
compareClassWithRepository:aClass |
1335 |
"open a diff-textView comparing the current (in-image) version |
|
1336 |
against its orgiginal version found in the repository." |
|
1337 |
||
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1338 |
self compareClassWithRepository:aClass askForRevision:true |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1339 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1340 |
" |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1341 |
self compareClassWithRepository:Array |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1342 |
" |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1343 |
! |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1344 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1345 |
compareClassWithRepository:aClass askForRevision:askForRevision |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1346 |
"open a diff-textView comparing the current (in-image) version |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1347 |
against its orgiginal version found in the repository." |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1348 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1349 |
|classToCompare resources brwsr |
1194 | 1350 |
aStream comparedSource currentSource rev revString thisRevString mgr |
1483 | 1351 |
nm msg revisionInClass newestRev versionsAreTheSame| |
957 | 1352 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1353 |
resources := self classResources. |
957 | 1354 |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1355 |
classToCompare := aClass theNonMetaclass. |
957 | 1356 |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1357 |
nm := classToCompare name. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1358 |
mgr := self sourceCodeManagerFor:classToCompare. |
957 | 1359 |
mgr isNil ifTrue:[ |
1360 |
^ self |
|
1361 |
]. |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1362 |
rev := classToCompare binaryRevision. |
1483 | 1363 |
revisionInClass := classToCompare revision. |
957 | 1364 |
rev isNil ifTrue:[ |
1483 | 1365 |
rev := revisionInClass |
957 | 1366 |
]. |
1367 |
rev isNil ifTrue:[ |
|
1483 | 1368 |
(Dialog confirm:'Class seems to be not yet in the repository (or classes revision info is corrupted)\\Proceed ?' withCRs) |
1369 |
ifFalse:[ |
|
1370 |
^ self |
|
1371 |
] |
|
957 | 1372 |
]. |
1373 |
||
1374 |
"/ |
|
1375 |
"/ class in repository - ask for revision |
|
1376 |
"/ |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1377 |
newestRev := mgr newestRevisionOf:classToCompare. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1378 |
askForRevision ifTrue:[ |
1466 | 1379 |
msg := resources string:'Compare to revision: (empty for newest)'. |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1380 |
rev notNil ifTrue:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1381 |
msg := msg , '\\' , (resources string:'Current %1 is based upon rev %2.' |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1382 |
with:nm allBold with:rev). |
1483 | 1383 |
(revisionInClass notNil and:[revisionInClass ~= rev]) ifTrue:[ |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1384 |
msg := msg , '\' , (resources string:'And has been checked into the repository as %1.' |
1483 | 1385 |
with:revisionInClass) |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1386 |
] |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1387 |
]. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1388 |
newestRev notNil ifTrue:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1389 |
msg := msg , '\' , (resources string:'Newest in reporitory is %1.' |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1390 |
with:newestRev) |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1391 |
]. |
957 | 1392 |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1393 |
rev := SourceCodeManagerUtilities |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1394 |
askForExistingRevision:msg |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1395 |
title:'Compare with repository' |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1396 |
class:classToCompare. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1397 |
] ifFalse:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1398 |
rev := newestRev. |
957 | 1399 |
]. |
1400 |
||
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1401 |
rev notNil ifTrue:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1402 |
rev withoutSpaces isEmpty ifTrue:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1403 |
msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1404 |
"/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1405 |
aStream := mgr getSourceStreamFor:classToCompare revision:newestRev. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1406 |
revString := '(newest: ' , (newestRev ? '???') , ')'. |
957 | 1407 |
] ifFalse:[ |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1408 |
msg := 'extracting previous %1'. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1409 |
aStream := mgr getSourceStreamFor:classToCompare revision:rev. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1410 |
revString := rev |
957 | 1411 |
]. |
1412 |
||
1413 |
aStream isNil ifTrue:[ |
|
1414 |
self warn:'could not extract source from repository'. |
|
1415 |
^ self |
|
1416 |
]. |
|
1417 |
aStream class readErrorSignal handle:[:ex | |
|
1245 | 1418 |
self warn:('read error while reading extracted source\\' , ex description) withCRs. |
957 | 1419 |
aStream close. |
1420 |
^ self |
|
1421 |
] do:[ |
|
1422 |
comparedSource := aStream contents asString. |
|
1423 |
]. |
|
1424 |
aStream close. |
|
1425 |
||
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1426 |
self activityNotification:'generating current source...'. |
957 | 1427 |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1428 |
currentSource := self sourceCodeOfClass:classToCompare. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1429 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1430 |
self activityNotification:'comparing...'. |
957 | 1431 |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1432 |
versionsAreTheSame := false. |
957 | 1433 |
comparedSource = currentSource ifTrue:[ |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1434 |
versionsAreTheSame := true. |
957 | 1435 |
] ifFalse:[ |
1483 | 1436 |
thisRevString := revisionInClass ? 'no revision'. |
957 | 1437 |
|
1438 |
revString = '(newest)' ifTrue:[ |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1439 |
(rev := mgr newestRevisionOf:classToCompare) notNil ifTrue:[ |
957 | 1440 |
revString := '(newest is ' , rev , ')' |
1441 |
] |
|
1442 |
]. |
|
1443 |
||
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1444 |
self activityNotification:'comparing...'. |
957 | 1445 |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1446 |
brwsr := (UserPreferences versionDiffViewerClass) |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1447 |
openOnClass:classToCompare |
1877 | 1448 |
labelA:('Repository: ' , revString) |
957 | 1449 |
sourceA:comparedSource |
1877 | 1450 |
labelB:('Current: (based on: ' , thisRevString , ')') |
957 | 1451 |
sourceB:currentSource |
1877 | 1452 |
title:('Comparing ' , classToCompare name) |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1453 |
ifSame:[versionsAreTheSame := true]. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1454 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1455 |
versionsAreTheSame ifFalse:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1456 |
brwsr classChangeSet |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1457 |
classBeingCompared:classToCompare; |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1458 |
versionA:rev; |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1459 |
versionB:rev , 'mod'. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1460 |
]. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1461 |
]. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1462 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1463 |
versionsAreTheSame ifTrue:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1464 |
(ChangeSet current includesChangeForClassOrMetaclassOrPrivateClassOf:classToCompare) ifTrue:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1465 |
(self confirm:(resources |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1466 |
stringWithCRs:'Versions of %1 are identical.\\Remove entries from changeSet ?' |
1864 | 1467 |
with:classToCompare name allBold)) ifTrue:[ |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1468 |
ChangeSet current condenseChangesForClass:classToCompare. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1469 |
]. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1470 |
] ifFalse:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1471 |
self information:'Versions are identical.'. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1472 |
ChangeSet current unrememberChangedClasses. |
1483 | 1473 |
]. |
1474 |
revisionInClass isNil ifTrue:[ |
|
1475 |
(Dialog confirm:'Update (Fix) the classes Revision Info ?' withCRs) |
|
1476 |
ifTrue:[ |
|
1497 | 1477 |
|newString root| |
1483 | 1478 |
|
1479 |
newString := mgr updatedRevisionStringOf:aClass forRevision:rev with:aClass revisionString. |
|
1497 | 1480 |
newString isNil ifTrue:[ |
1481 |
root := mgr getCVSROOTForModule:(aClass package upTo:$:). |
|
1482 |
root := mgr repositoryTopDirectoryFromCVSRoot:root. |
|
1500 | 1483 |
newString := '$', 'Header: ',(root copyReplaceAll: $: with:$/ ),'/' |
1911 | 1484 |
,(Smalltalk fileNameForClass:aClass),'.st,v ',rev,' ' |
1497 | 1485 |
,(Date today printStringFormat:'%y/%m/%d'),' ' |
1486 |
,(Time now printStringFormat:'%h/%m/%s'),' ' |
|
1487 |
,(OperatingSystem getLoginName),' Exp $'. |
|
1488 |
]. |
|
1483 | 1489 |
aClass updateVersionMethodFor:newString. |
1490 |
] |
|
1491 |
]. |
|
957 | 1492 |
]. |
1493 |
]. |
|
1494 |
||
1495 |
" |
|
997 | 1496 |
self compareClassWithRepository:Array |
957 | 1497 |
" |
1497 | 1498 |
|
1911 | 1499 |
"Modified: / 20-11-2006 / 22:26:54 / cg" |
957 | 1500 |
! |
1501 |
||
1875
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1502 |
compareProjectWithRepository:aProject |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1503 |
|classesInImage filesInImage module directory perProjectInfo |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1504 |
classesNotInRepository filesNotInImage classesDeletedInRepository |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1505 |
classesModifiedInImage classesNotReallyModified classesReallyModified classesModifiedInRepository |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1506 |
classesDeletedInImage classesAddedInImage |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1507 |
extensionsInImage extensionsInRepository extensionDiffs |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1508 |
anyDifference box doRemove doCleanup classDefs changeSets filePerClassDefintion |
1955 | 1509 |
classesToCheckIn resources diffSet def autoloadedFilesNotInImage |
1510 |
autoloadedClassesInImage autoloadedFilesInImage| |
|
1875
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1511 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1512 |
resources := self classResources. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1513 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1514 |
module := aProject asPackageId module. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1515 |
directory := aProject asPackageId directory. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1516 |
perProjectInfo := SourceCodeManager newestRevisionsInModule:module directory:directory. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1517 |
perProjectInfo := perProjectInfo ? #(). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1518 |
perProjectInfo := perProjectInfo select:[:info | info key asFilename hasSuffix:'st']. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1519 |
perProjectInfo := Dictionary withAssociations:perProjectInfo. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1520 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1521 |
classesInImage := Smalltalk allClassesInPackage:aProject. |
1955 | 1522 |
autoloadedClassesInImage := classesInImage reject:[:cls | cls isLoaded]. |
1523 |
classesInImage := classesInImage select:[:cls | cls isLoaded]. |
|
1875
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1524 |
classesInImage := classesInImage reject:[:cls | cls isPrivate]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1525 |
filesInImage := (classesInImage collect:[:cls | cls classBaseFilename]) asSet. |
1955 | 1526 |
autoloadedFilesInImage := (autoloadedClassesInImage collect:[:cls | cls classBaseFilename]) asSet. |
1875
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1527 |
"/ any differences ? |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1528 |
classesNotInRepository := classesInImage reject:[:cls | (perProjectInfo includesKey:cls classBaseFilename)]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1529 |
classesDeletedInRepository := classesInImage select:[:cls | (perProjectInfo at:cls classBaseFilename ifAbsent:nil) == #deleted]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1530 |
perProjectInfo := perProjectInfo reject:[:v | v == #deleted]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1531 |
filesNotInImage := perProjectInfo keys reject:[:file | (filesInImage includes:file)]. |
1955 | 1532 |
filesNotInImage := filesNotInImage reject:[:file | (autoloadedFilesInImage includes:file)]. |
1875
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1533 |
filesNotInImage remove:'extensions.st' ifAbsent:[]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1534 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1535 |
classesModifiedInImage := classesInImage select:[:cls |ChangeSet current includesChangeForClassOrMetaclass:cls]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1536 |
classesModifiedInImage := classesModifiedInImage \ classesNotInRepository. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1537 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1538 |
classesModifiedInRepository := classesInImage select:[:cls | |v| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1539 |
v := (perProjectInfo at:cls classBaseFilename ifAbsent:nil). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1540 |
v notNil and:[ cls isLoaded and:[ v > cls revision ]]]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1541 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1542 |
"/ stupid: as we do not have any revision information for extensions (sigh); |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1543 |
"/ we must checkout and look at the extension.st contents, to see if it has changed. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1544 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1545 |
extensionsInImage := OrderedCollection new. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1546 |
Smalltalk allClasses do:[:eachClass | |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1547 |
extensionsInImage addAll:(eachClass extensionsFrom:aProject) |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1548 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1549 |
extensionsInImage := ChangeSet forExistingMethods:extensionsInImage. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1550 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1551 |
[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1552 |
|s| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1553 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1554 |
s := SourceCodeManager |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1555 |
streamForClass:nil fileName:'extensions.st' revision:#newest directory:directory module:module cache:true. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1556 |
s isNil ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1557 |
extensionsInRepository := ChangeSet new. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1558 |
] ifFalse:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1559 |
extensionsInRepository := ChangeSet fromStream:s. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1560 |
s close. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1561 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1562 |
] value. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1563 |
extensionDiffs := extensionsInRepository diffSetsAgainst:extensionsInImage. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1564 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1565 |
diffSet := extensionDiffs copy. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1566 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1567 |
"/ we could do the same as above for each class. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1568 |
"/ however - as we do have change-info and revision info, we can avoid checking out |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1569 |
"/ for all classes which are not changed and which have the same version info. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1570 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1571 |
classesModifiedInImage notEmpty ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1572 |
classesReallyModified := |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1573 |
classesModifiedInImage select:[:eachChangedClass | |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1574 |
|currentVersion repositoryVersion s stFile diffs| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1575 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1576 |
stFile := eachChangedClass classBaseFilename. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1577 |
s := SourceCodeManager |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1578 |
streamForClass:nil fileName:stFile revision:#newest directory:directory module:module cache:true. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1579 |
repositoryVersion := ChangeSet fromStream:s. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1580 |
s close. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1581 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1582 |
currentVersion := ChangeSet forExistingClass:eachChangedClass. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1583 |
diffs := repositoryVersion diffSetsAgainst:currentVersion . |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1584 |
diffSet addDiffSet:diffs. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1585 |
diffs notEmpty |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1586 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1587 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1588 |
classesNotReallyModified := classesModifiedInImage \ classesReallyModified. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1589 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1590 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1591 |
filesNotInImage notEmpty ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1592 |
"/ first, check if these are autoloaded classes which have NOT been installed |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1593 |
"/ (for example, due to a --quick argument during startup) |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1594 |
autoloadedFilesNotInImage := OrderedCollection new. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1595 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1596 |
def := ProjectDefinition definitionClassForPackage:aProject createIfAbsent:false projectType:nil. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1597 |
def notNil ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1598 |
def classNamesAndAttributesDo:[:eachClassname :eachAttributes | |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1599 |
|cls eachFileName isAutoload| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1600 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1601 |
cls := Smalltalk classNamed:eachClassname. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1602 |
cls isNil ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1603 |
isAutoload := eachAttributes includes:#autoload. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1604 |
isAutoload ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1605 |
eachFileName := Smalltalk fileNameForClass:eachClassname. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1606 |
autoloadedFilesNotInImage add:(eachFileName , '.st') |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1607 |
] |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1608 |
] |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1609 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1610 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1611 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1612 |
(filesNotInImage \ autoloadedFilesNotInImage) do:[:eachSTFile | |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1613 |
|s chgSet classDefinitions| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1614 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1615 |
s := SourceCodeManager |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1616 |
streamForClass:nil fileName:eachSTFile revision:#newest directory:directory module:module cache:true. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1617 |
chgSet := ChangeSet fromStream:s. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1618 |
s close. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1619 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1620 |
diffSet onlyInReceiver addAll:chgSet |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1621 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1622 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1623 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1624 |
classesModifiedInRepository notEmpty ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1625 |
classesModifiedInRepository do:[:eachClass| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1626 |
|s diffs repositoryVersion currentVersion| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1627 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1628 |
s := SourceCodeManager |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1629 |
streamForClass:eachClass fileName:nil revision:#newest directory:directory module:module cache:true. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1630 |
repositoryVersion := ChangeSet fromStream:s. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1631 |
s close. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1632 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1633 |
currentVersion := ChangeSet forExistingClass:eachClass. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1634 |
diffs := repositoryVersion diffSetsAgainst:currentVersion . |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1635 |
diffSet addDiffSet:diffs. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1636 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1637 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1638 |
classesDeletedInRepository notEmpty ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1639 |
self halt. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1640 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1641 |
classesNotInRepository notEmpty ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1642 |
"/ if there are no changeSet entries for those classes, they seem to be |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1643 |
"/ no longer in the repository (possibly moved ?) |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1644 |
"/ If there are entries, these might have been added in the image and need a check-in |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1645 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1646 |
classesAddedInImage := classesNotInRepository \ classesDeletedInRepository. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1647 |
classesAddedInImage do:[:eachAddedClass | |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1648 |
|currentVersion| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1649 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1650 |
currentVersion := ChangeSet forExistingClass:eachAddedClass. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1651 |
diffSet onlyInArg addAll:currentVersion. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1652 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1653 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1654 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1655 |
diffSet isEmpty ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1656 |
"/ Dialog information:(resources string:'%1 is up-to-date.' with:eachProject allBold). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1657 |
Transcript showCR:('%1 is up-to-date.' bindWith:aProject allBold). |
1886 | 1658 |
(ChangeSet current includesChangeForPackage:aProject) ifTrue:[ |
1659 |
(Dialog confirm:('%1 is up-to-date.\\Cleanup ChangeSet ?' bindWith:aProject allBold) withCRs) ifTrue:[ |
|
1660 |
ChangeSet current condenseChangesForPackage:aProject. |
|
1661 |
]. |
|
1875
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1662 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1663 |
^ self. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1664 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1665 |
|
1886 | 1666 |
classesNotReallyModified notEmptyOrNil ifTrue:[ |
1875
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1667 |
self halt. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1668 |
doCleanup := false. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1669 |
box := Dialog |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1670 |
forRequestText:(resources |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1671 |
stringWithCRs:'The following classes from %1 are equal to the repository version.\\Remove entries from the changeSet ?' |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1672 |
with:aProject allBold) |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1673 |
editViewClass:ListView |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1674 |
lines:10 columns:20 |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1675 |
initialAnswer:nil model:nil |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1676 |
setupWith: |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1677 |
[:v :d | |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1678 |
|removeButton| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1679 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1680 |
v list:classesNotReallyModified. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1681 |
removeButton := Button label:(resources string:'Cleanup ChangeSet'). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1682 |
removeButton action:[ doCleanup := true. box okPressed. ]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1683 |
d addButton:removeButton after:(d okButton). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1684 |
d okButton label:(resources string:'Continue'). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1685 |
d okButton isReturnButton:false. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1686 |
removeButton isReturnButton:true. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1687 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1688 |
box open. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1689 |
box accepted ifFalse:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1690 |
^ self |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1691 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1692 |
doCleanup ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1693 |
classesNotReallyModified do:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1694 |
ChangeSet current condenseChangesForClass:classesNotReallyModified. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1695 |
] |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1696 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1697 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1698 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1699 |
VersionDiffBrowser |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1700 |
openOnDiffSet:diffSet |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1701 |
labelA:'Repository' |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1702 |
labelB:'Image' |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1703 |
title:('Differences of %1' bindWith:aProject). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1704 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1705 |
"Created: / 12-10-2006 / 21:44:54 / cg" |
1955 | 1706 |
"Modified: / 01-03-2007 / 17:59:20 / cg" |
1875
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1707 |
! |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1708 |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1709 |
createSourceContainerForClass:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1710 |
"let user specify the source-repository values for aClass" |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1711 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1712 |
|resources| |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1713 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1714 |
resources := self classResources. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1715 |
^ self |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1716 |
defineSourceContainerForClass:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1717 |
title:(resources string:'Repository information for %1' with:aClass name) |
1030 | 1718 |
text:(resources string:'Create new repository container for ''%1''' with:aClass name allBold) |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1719 |
createDirectories:true |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1720 |
createContainer:true. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1721 |
! |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1722 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1723 |
defineSourceContainerForClass:aClass title:title text:boxText createDirectories:createDirs createContainer:createContainer |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1724 |
"let user specify the source-repository values for aClass" |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1725 |
|
1158 | 1726 |
| className |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1727 |
oldModule oldPackage oldFileName |
1533 | 1728 |
module directory fileName nameSpace nameSpacePrefix |
1158 | 1729 |
info project nm mgr creatingNew msg |
952
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1730 |
answer doCheckinWithoutAsking forceCheckIn resources rslt note |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1731 |
requiredPackage| |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1732 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1733 |
resources := self classResources. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1734 |
aClass isLoaded ifFalse:[ |
1076 | 1735 |
self warn:(resources string:'Please load the %1-class first' with:aClass name). |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1736 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1737 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1738 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1739 |
className := aClass name. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1740 |
|
1533 | 1741 |
aClass isProjectDefinition ifTrue:[ |
1742 |
"/ no way - their package is already known and fix. |
|
1743 |
module := aClass module. |
|
1744 |
directory := aClass moduleDirectory. |
|
1745 |
] ifFalse:[ |
|
1746 |
"/ |
|
1747 |
"/ defaults, if nothing at all is known |
|
1748 |
"/ |
|
1749 |
(module := LastModule) isNil ifTrue:[ |
|
1750 |
module := (OperatingSystem getLoginName). |
|
1751 |
]. |
|
1752 |
(directory := LastPackage) isNil ifTrue:[ |
|
1753 |
directory := 'private'. |
|
1754 |
]. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1755 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1756 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1757 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1758 |
"/ try to extract some useful defaults from the current project |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1759 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1760 |
(Project notNil and:[(project := Project current) notNil]) ifTrue:[ |
1533 | 1761 |
directory isNil ifTrue:[ |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1762 |
(nm := project repositoryDirectory) isNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1763 |
nm := project name |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1764 |
]. |
1533 | 1765 |
directory := nm. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1766 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1767 |
module isNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1768 |
(nm := project repositoryModule) notNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1769 |
module := nm |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1770 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1771 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1772 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1773 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1774 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1775 |
"/ ask the sourceCodeManager if it knows anything about that class |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1776 |
"/ if so, take that as a default. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1777 |
"/ |
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1778 |
mgr := self sourceCodeManagerFor:aClass. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1779 |
mgr isNil ifTrue:[ |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1780 |
^ false |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1781 |
]. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1782 |
|
1368 | 1783 |
|
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1784 |
info := mgr sourceInfoOfClass:aClass. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1785 |
info notNil ifTrue:[ |
1368 | 1786 |
true "module ~= LastModule" ifTrue:[ |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1787 |
(info includesKey:#module) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1788 |
module := (info at:#module). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1789 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1790 |
]. |
1401 | 1791 |
"/ true "package ~= LastPackage" ifTrue:[ |
1792 |
"/ (info includesKey:#directory) ifTrue:[ |
|
1793 |
"/ package := (info at:#directory). |
|
1794 |
"/ ]. |
|
1795 |
"/ ]. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1796 |
fileName := mgr containerFromSourceInfo:info. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1797 |
(nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1798 |
nameSpacePrefix := nameSpace name , '::'. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1799 |
(fileName startsWith:nameSpacePrefix) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1800 |
fileName := fileName copyFrom:(nameSpacePrefix size + 1). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1801 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1802 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1803 |
"/ (info includesKey:#fileName) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1804 |
"/ fileName := (info at:#fileName). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1805 |
"/ ] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1806 |
"/ (info includesKey:#expectedFileName) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1807 |
"/ fileName := (info at:#expectedFileName). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1808 |
"/ ] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1809 |
"/ (info includesKey:#classFileNameBase) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1810 |
"/ fileName := (info at:#classFileNameBase) , '.st'. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1811 |
"/ ] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1812 |
"/ ] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1813 |
"/ ] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1814 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1815 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1816 |
fileName isNil ifTrue:[ |
1338 | 1817 |
fileName := (Smalltalk fileNameForClass:aClass) , '.st'. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1818 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1819 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1820 |
OperatingSystem isMSDOSlike ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1821 |
module replaceAll:$\ with:$/. |
1533 | 1822 |
directory replaceAll:$\ with:$/. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1823 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1824 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1825 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1826 |
"/ check for conflicts (i.e. if such a container already exists) ... |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1827 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1828 |
doCheckinWithoutAsking := false. |
1831
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1829 |
"/false ifTrue:[ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1830 |
"/ (mgr checkForExistingContainer:fileName inModule:module directory:directory) ifTrue:[ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1831 |
"/ answer := Dialog confirmWithCancel:(resources |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1832 |
"/ string:'About to change the source container. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1833 |
"/ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1834 |
"/Notice: there is a container for %1 in: |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1835 |
"/ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1836 |
"/ %2 / %3 / %4 |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1837 |
"/ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1838 |
"/Do you want to change it or check right into that container ?' |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1839 |
"/ with:className |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1840 |
"/ with:module |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1841 |
"/ with:directory |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1842 |
"/ with:fileName) |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1843 |
"/ labels:(resources array:#('Cancel' 'Check in' 'Change')). |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1844 |
"/ answer isNil ifTrue:[AbortSignal raise]. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1845 |
"/ answer ifTrue:[ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1846 |
"/ doCheckinWithoutAsking := false. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1847 |
"/ oldModule := module. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1848 |
"/ oldPackage := directory. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1849 |
"/ oldFileName := fileName |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1850 |
"/ ] ifFalse:[ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1851 |
"/ doCheckinWithoutAsking := true. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1852 |
"/ creatingNew := false. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1853 |
"/ ]. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1854 |
"/ ]. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1855 |
"/]. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1856 |
doCheckinWithoutAsking ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1857 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1858 |
"/ open a dialog for this |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1859 |
"/ |
1787 | 1860 |
(mgr checkForExistingContainer:fileName inModule:module directory:directory) ifFalse:[ |
893 | 1861 |
note := 'Notice: class seems to have no container yet.'. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1862 |
creatingNew := true. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1863 |
] ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1864 |
creatingNew := false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1865 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1866 |
|
893 | 1867 |
rslt := self |
1868 |
askForContainer:boxText title:title note:note |
|
1533 | 1869 |
initialModule:module initialPackage:directory initialFileName:fileName |
1030 | 1870 |
forNewContainer:true. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1871 |
|
893 | 1872 |
rslt isNil ifTrue:[ |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1873 |
^ false |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1874 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1875 |
|
893 | 1876 |
module := rslt at:#module. |
1533 | 1877 |
directory := rslt at:#package. |
893 | 1878 |
fileName := rslt at:#fileName. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1879 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1880 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1881 |
(fileName endsWith:',v') ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1882 |
fileName := fileName copyWithoutLast:2 |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1883 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1884 |
(fileName endsWith:'.st') ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1885 |
fileName := fileName , '.st' |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1886 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1887 |
|
952
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1888 |
"/ we require the packageID to be <module>:<container-dir> |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1889 |
"/ check for this ... |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1890 |
|
1533 | 1891 |
requiredPackage := ((module ? '') , ':' , (directory ? '')) asSymbol. |
952
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1892 |
requiredPackage ~= aClass package ifTrue:[ |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1893 |
"/ doCheckinWithoutAsking ifFalse:[ |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1894 |
"/ (self confirm:'Change the classes packageID to: ''', requiredPackage , ''' ?') |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1895 |
"/ ifFalse:[ |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1896 |
"/ ^ false |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1897 |
"/ ] |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1898 |
"/ ]. |
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1076
diff
changeset
|
1899 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:requiredPackage]. |
952
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1900 |
aClass package:requiredPackage. |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1901 |
]. |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1902 |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1903 |
info := aClass revisionInfo. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1904 |
info notNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1905 |
(info includesKey:#repositoryPathName) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1906 |
info := nil |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1907 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1908 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1909 |
info isNil ifTrue:[ |
1004
1bd564960810
dont ask if a version method should be created - just do it.
Claus Gittinger <cg@exept.de>
parents:
1000
diff
changeset
|
1910 |
true "doCheckinWithoutAsking" ifFalse:[ |
979 | 1911 |
answer := Dialog |
1912 |
confirmWithCancel:(resources string:'%1 does not have any (usable) revision info (#version method)\\Shall I create one ?' with:className) withCRs |
|
1076 | 1913 |
labels:(resources array:#( 'Cancel' 'No' 'Yes')). |
979 | 1914 |
answer isNil ifTrue:[^ false]. |
1915 |
] ifTrue:[ |
|
1916 |
answer := true. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1917 |
]. |
979 | 1918 |
answer ifTrue:[ |
1919 |
aClass updateVersionMethodFor:(mgr initialRevisionStringFor:aClass |
|
1920 |
inModule:module |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
1921 |
directory:directory |
979 | 1922 |
container:fileName). |
1923 |
]. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1924 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1925 |
|
1158 | 1926 |
(self checkForExistingModule:module using:mgr allowCreate:(createDirs or:[creatingNew])) |
1927 |
ifFalse:[^ false]. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1928 |
LastModule := module. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1929 |
|
1704 | 1930 |
(self checkForExistingModule:module directory:directory using:mgr allowCreate:(createDirs or:[creatingNew])) |
1158 | 1931 |
ifFalse:[^ false]. |
1533 | 1932 |
LastPackage := directory. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1933 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1934 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1935 |
"/ check for the container itself |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1936 |
"/ |
1787 | 1937 |
(mgr checkForExistingContainer:fileName inModule:module directory:directory) ifTrue:[ |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1938 |
creatingNew ifTrue:[ |
1533 | 1939 |
self warn:(resources string:'Container for %1 already exists in %2/%3.' with:fileName with:module with:directory) withCRs. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1940 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1941 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1942 |
"/ (oldModule notNil |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1943 |
"/ and:[(oldModule ~= module) |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1944 |
"/ or:[oldPackage ~= package |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1945 |
"/ or:[oldFileName ~= fileName]]]) |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1946 |
"/ ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1947 |
"/ self warn:(resources string:'no change'). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1948 |
"/ ^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1949 |
"/ ]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1950 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1951 |
doCheckinWithoutAsking ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1952 |
(Dialog |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1953 |
confirm:(resources string:'check %1 into the existing container |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1954 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1955 |
%2 / %3 / %4 ?' |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1956 |
with:className |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1957 |
with:module |
1533 | 1958 |
with:directory |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1959 |
with:fileName) withCRs |
1076 | 1960 |
noLabel:'Cancel') |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1961 |
ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1962 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1963 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1964 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1965 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1966 |
aClass updateVersionMethodFor:'$' , 'Header' , '$'. "/ concatenated to avoid RCS-expansion |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1967 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1968 |
oldFileName notNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1969 |
msg := ('forced checkin / source container change from ' , oldFileName). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1970 |
] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1971 |
msg := 'defined source container' |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1972 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1973 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1974 |
(forceCheckIn := doCheckinWithoutAsking) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1975 |
(mgr |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1976 |
checkinClass:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1977 |
fileName:fileName |
1533 | 1978 |
directory:directory |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1979 |
module:module |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1980 |
logMessage:msg) |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1981 |
ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1982 |
doCheckinWithoutAsking ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1983 |
(Dialog |
1076 | 1984 |
confirm:'No easy merge seems possible; force checkin (no merge) ?' |
1985 |
noLabel:'Cancel') |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1986 |
ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1987 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1988 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1989 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1990 |
forceCheckIn := true. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1991 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1992 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1993 |
forceCheckIn ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1994 |
(mgr |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1995 |
checkinClass:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1996 |
fileName:fileName |
1533 | 1997 |
directory:directory |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1998 |
module:module |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1999 |
logMessage:msg |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2000 |
force:true) |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2001 |
ifFalse:[ |
1076 | 2002 |
self warn:(resources string:'Failed to check into existing container.'). |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2003 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2004 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2005 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2006 |
^ true |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2007 |
] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2008 |
(createContainer or:[creatingNew]) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2009 |
(Dialog |
1076 | 2010 |
confirm:(resources string:'No container exists for %1 in %2/%3\\create ?' |
1533 | 2011 |
with:fileName with:module with:directory) withCRs |
1076 | 2012 |
noLabel:'Cancel') ifFalse:[ |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2013 |
^ false |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2014 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2015 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2016 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2017 |
|
1882
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
2018 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:requiredPackage]. |
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
2019 |
aClass package:requiredPackage. |
1913 | 2020 |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2021 |
(mgr |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2022 |
createContainerFor:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2023 |
inModule:module |
1533 | 2024 |
package:directory |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2025 |
container:fileName) ifFalse:[ |
1076 | 2026 |
self warn:(resources string:'Failed to create container.'). |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2027 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2028 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2029 |
^ true |
1533 | 2030 |
|
1913 | 2031 |
"Modified: / 21-11-2006 / 17:35:02 / cg" |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2032 |
! |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2033 |
|
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2034 |
removeSourceContainerForClass:aClass |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2035 |
"show container & let user confirm twice." |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2036 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2037 |
^ self removeSourceContainerForClass:aClass confirm:true warn:true |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2038 |
! |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2039 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2040 |
removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2041 |
"show container & optionally let user confirm twice." |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2042 |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2043 |
|module directory fileName info mgr resources| |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2044 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2045 |
resources := self classResources. |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2046 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2047 |
aClass isLoaded ifFalse:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2048 |
doWarn ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2049 |
self warn:(resources string:'Please load the class first.'). |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2050 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2051 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2052 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2053 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2054 |
"/ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2055 |
"/ ask the sourceCodeManager if it knows anything about that class |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2056 |
"/ if so, take that as a default. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2057 |
"/ |
1782 | 2058 |
mgr := self sourceCodeManagerFor:aClass. |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2059 |
mgr isNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2060 |
^ false |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2061 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2062 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2063 |
info := mgr sourceInfoOfClass:aClass. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2064 |
info notNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2065 |
(info includesKey:#module) ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2066 |
module := (info at:#module). |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2067 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2068 |
(info includesKey:#directory) ifTrue:[ |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2069 |
directory := (info at:#directory). |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2070 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2071 |
fileName := mgr containerFromSourceInfo:info. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2072 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2073 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2074 |
module isNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2075 |
doWarn ifTrue:[ |
1423 | 2076 |
self warn:(resources stringWithCRs:'classes module is unknown.\\It seems to not have a container.') . |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2077 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2078 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2079 |
]. |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2080 |
directory isNil ifTrue:[ |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2081 |
doWarn ifTrue:[ |
1423 | 2082 |
self warn:(resources stringWithCRs:'classes package is unknown.\\It seems to not have a container.') . |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2083 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2084 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2085 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2086 |
fileName isNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2087 |
doWarn ifTrue:[ |
1423 | 2088 |
self warn:(resources stringWithCRs:'classes container fileName is unknown.\\It seems to not have a container.') . |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2089 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2090 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2091 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2092 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2093 |
OperatingSystem isMSDOSlike ifTrue:[ |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2094 |
"cvs expects unix-filenames" |
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2095 |
module := module copy replaceAll:$\ with:$/. |
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2096 |
directory := directory copy replaceAll:$\ with:$/. |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2097 |
]. |
1787 | 2098 |
(mgr checkForExistingContainer:fileName inModule:module directory:directory) ifFalse:[ |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2099 |
doWarn ifTrue:[ |
1423 | 2100 |
self warn:(resources stringWithCRs:'Class has no source container.') . |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2101 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2102 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2103 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2104 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2105 |
doConfirm ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2106 |
(Dialog |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2107 |
choose:(resources |
1423 | 2108 |
stringWithCRs:'Please confirm removal of the container for %1: |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2109 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2110 |
container: %2 / %3 / %4 |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2111 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2112 |
Really remove ?' |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2113 |
with:aClass name |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2114 |
with:module |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2115 |
with:directory |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2116 |
with:fileName) |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2117 |
labels:(Array |
1129 | 2118 |
with:(resources string:'No') |
2119 |
with:(resources string:'Remove')) |
|
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2120 |
values:#(false true) |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2121 |
default:false) ifFalse:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2122 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2123 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2124 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2125 |
|
1921
ab2e300fbc9c
oops - removeContainer for class got corrupted
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
2126 |
(mgr removeContainer:fileName |
ab2e300fbc9c
oops - removeContainer for class got corrupted
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
2127 |
inModule:module |
ab2e300fbc9c
oops - removeContainer for class got corrupted
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
2128 |
directory:directory) ifFalse:[ |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2129 |
doWarn ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2130 |
self warn:(resources string:'failed to remove container.'). |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2131 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2132 |
^ true. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2133 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2134 |
^ false |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2135 |
|
1921
ab2e300fbc9c
oops - removeContainer for class got corrupted
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
2136 |
"Modified: / 05-12-2006 / 18:40:16 / cg" |
1000 | 2137 |
! |
2138 |
||
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2139 |
repositoryLogOf:aClass onto:aStream |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2140 |
|info rv mgr info2 module fn msg s| |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2141 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2142 |
info := aClass revisionInfo. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2143 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2144 |
rv := aClass binaryRevision. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2145 |
rv notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2146 |
aStream nextPutLine:'**** Loaded classes binary information ****'; cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2147 |
aStream nextPutLine:' Binary based upon : ' , rv. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2148 |
aStream cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2149 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2150 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2151 |
info notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2152 |
(info includesKey:#revision) ifFalse:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2153 |
aStream nextPutLine:'WARNING:'; cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2154 |
aStream nextPutLine:' The class seems not to be loaded from the repository.'. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2155 |
aStream nextPutLine:' Check carefully before checking anything in.'. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2156 |
aStream nextPutLine:' (i.e. compare with repository for renamed class(es), same-name but unrelated etc.)'. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2157 |
aStream cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2158 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2159 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2160 |
aStream nextPutLine:'**** Classes source information ****'; cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2161 |
s := info at:#repositoryPath ifAbsent:nil. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2162 |
s notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2163 |
aStream nextPutLine:' Source repository : ' , s |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2164 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2165 |
aStream nextPutLine:' Filename ........ : ' , (info at:#fileName ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2166 |
aStream nextPutLine:' Revision ........ : ' , (info at:#revision ifAbsent:'?'). |
1462
2b2c6acdb53f
Take care of timezone information in header strings
Stefan Vogel <sv@exept.de>
parents:
1460
diff
changeset
|
2167 |
aStream nextPutLine:' Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , |
2b2c6acdb53f
Take care of timezone information in header strings
Stefan Vogel <sv@exept.de>
parents:
1460
diff
changeset
|
2168 |
(info at:#time ifAbsent:'?'), ' ', |
2b2c6acdb53f
Take care of timezone information in header strings
Stefan Vogel <sv@exept.de>
parents:
1460
diff
changeset
|
2169 |
(info at:#timezone ifAbsent:''). |
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2170 |
aStream nextPutLine:' Checkin user .... : ' , (info at:#user ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2171 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2172 |
(info2 := aClass packageSourceCodeInfo) notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2173 |
aStream nextPutLine:' Repository: ..... : ' , (info2 at:#module ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2174 |
aStream nextPutLine:' Directory: ...... : ' , (info2 at:#directory ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2175 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2176 |
aStream nextPutLine:' Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2177 |
aStream cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2178 |
|
1782 | 2179 |
mgr := self sourceCodeManagerFor:aClass. |
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2180 |
mgr notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2181 |
aStream nextPutLine:'**** Repository information ****'; cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2182 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2183 |
module := info2 at:#module ifAbsent:nil. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2184 |
module notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2185 |
aStream nextPutLine:(' CVS Root ......: ' , |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2186 |
((mgr repositoryNameForModule:module) ifNil:[mgr repositoryName , ' (default)'])). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2187 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2188 |
mgr writeRevisionLogOf:aClass to:aStream. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2189 |
] |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2190 |
] ifFalse:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2191 |
aStream nextPutLine:'No revision info found'. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2192 |
aClass isLoaded ifFalse:[ |
1835 | 2193 |
aStream cr; nextPutAll:'This is an autoloaded class - you may see more after it is loaded.' |
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2194 |
] ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2195 |
fn := aClass classFilename. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2196 |
aClass wasAutoloaded ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2197 |
msg := 'This class was autoloaded.'. |
1514 | 2198 |
msg := msg , ' (from ''' , fn , ''')'. |
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2199 |
] ifFalse:[ |
1514 | 2200 |
msg := 'This class was loaded from ''' , fn , '''.' |
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2201 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2202 |
msg notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2203 |
aStream cr; nextPutAll:msg. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2204 |
] |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2205 |
] |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2206 |
] |
1782 | 2207 |
|
1835 | 2208 |
"Modified: / 06-10-2006 / 13:25:22 / cg" |
1726 | 2209 |
! |
2210 |
||
2211 |
tagClass:aClass as:tag |
|
2212 |
|mgr| |
|
2213 |
||
2214 |
mgr := self sourceCodeManagerFor:aClass. |
|
1782 | 2215 |
mgr |
2216 |
setSymbolicName:tag |
|
2217 |
revision:nil |
|
2218 |
overWrite:true |
|
2219 |
class:aClass. |
|
2220 |
||
2221 |
"Modified: / 12-09-2006 / 13:03:59 / cg" |
|
2222 |
! |
|
2223 |
||
2224 |
tagClasses:aCollectionOfClasses as:tag |
|
2225 |
|classesPerManager| |
|
2226 |
||
2227 |
classesPerManager := Dictionary new. |
|
2228 |
aCollectionOfClasses |
|
2229 |
do:[:eachClass | |
|
2230 |
|manager| |
|
2231 |
||
2232 |
manager := self sourceCodeManagerFor:eachClass. |
|
2233 |
(classesPerManager at:manager ifAbsentPut:[Set new]) add:eachClass |
|
2234 |
]. |
|
2235 |
||
2236 |
classesPerManager keysAndValuesDo:[:manager :classesPerManager| |
|
2237 |
manager |
|
2238 |
setSymbolicName:tag |
|
2239 |
revision:nil |
|
2240 |
overWrite:true |
|
2241 |
classes:classesPerManager. |
|
2242 |
]. |
|
1726 | 2243 |
^ true |
1782 | 2244 |
|
2245 |
"Created: / 12-09-2006 / 13:04:29 / cg" |
|
1726 | 2246 |
! |
2247 |
||
2248 |
tagPath:aPath as:tag using:aManager |
|
1782 | 2249 |
aManager |
2250 |
setSymbolicName:tag |
|
1726 | 2251 |
revision:nil |
2252 |
overWrite:true |
|
2253 |
path:aPath. |
|
1782 | 2254 |
|
2255 |
"Modified: / 12-09-2006 / 12:04:44 / cg" |
|
1375 | 2256 |
! ! |
2257 |
||
2258 |
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-helpers'! |
|
2259 |
||
2260 |
getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil |
|
2261 |
"check-out all previous versions of aClass and retrieve the history of selector. |
|
2262 |
Return a dictionary associating revision with a changeList entries for that method. |
|
2263 |
Unfinished - need a GUI for that." |
|
2264 |
||
2265 |
|mgr theClass revisionLog revisions items s entriesPerRevision previousVersion| |
|
2266 |
||
2267 |
theClass := aClass theNonMetaclass. |
|
2268 |
||
2269 |
mgr := self sourceCodeManagerFor:theClass. |
|
2270 |
mgr isNil ifTrue:[ |
|
2271 |
self error:'no sourceCodeManager'. |
|
2272 |
]. |
|
2273 |
||
2274 |
revisionLog := mgr |
|
2275 |
revisionLogOf:theClass |
|
2276 |
numberOfRevisions:numberOfRevisionsOrNil. |
|
2277 |
||
2278 |
revisions := revisionLog at:#revisions. |
|
2279 |
items := revisions collect:[:each | |rev date who| |
|
2280 |
rev := each at:#revision. |
|
2281 |
date := each at:#date. |
|
2282 |
who := each at:#author. |
|
2283 |
rev allBold , ' [' , date , ' by ' , who , ']' |
|
2284 |
]. |
|
2285 |
||
2286 |
revisions := revisions collect:[:each | each at:#revision]. |
|
2287 |
revisions addFirst:#current. |
|
2288 |
entriesPerRevision := Dictionary new. |
|
2289 |
||
2290 |
previousVersion := nil. |
|
2291 |
revisions reverseDo:[:eachRevision | |
|
2292 |
|srcStream entries thisVersion| |
|
2293 |
||
2294 |
eachRevision == #current ifTrue:[ |
|
2295 |
s := '' writeStream. |
|
2296 |
theClass fileOutOn:s withTimeStamp:false. |
|
2297 |
srcStream := s contents readStream. |
|
2298 |
] ifFalse:[ |
|
2299 |
self activityNotification:('checking out revision ' , eachRevision , '...'). |
|
2300 |
srcStream := mgr getSourceStreamFor:theClass revision:eachRevision. |
|
2301 |
]. |
|
2302 |
||
2303 |
entries := ChangeSet fromStream:srcStream. |
|
2304 |
srcStream close. |
|
2305 |
||
2306 |
"/ remove all definitions |
|
2307 |
entries := entries select:[:each | each isMethodChange]. |
|
2308 |
"/ remove all methods which are for other selectors |
|
2309 |
entries := entries select:[:each | each selector == selector]. |
|
2310 |
"/ remove all methods which are for private subclasses |
|
2311 |
entries := entries select:[:each | each className = aClass name]. |
|
2312 |
||
2313 |
entries size == 1 ifTrue:[ |
|
2314 |
"/ the method is there |
|
2315 |
thisVersion := entries first. |
|
2316 |
(previousVersion notNil and:[previousVersion sameAs:thisVersion]) ifTrue:[ |
|
2317 |
"/ no change |
|
2318 |
] ifFalse:[ |
|
2319 |
entriesPerRevision at:eachRevision put:thisVersion. |
|
2320 |
]. |
|
2321 |
] ifFalse:[ |
|
2322 |
"/ the method is not there |
|
2323 |
]. |
|
2324 |
previousVersion := thisVersion. |
|
2325 |
]. |
|
2326 |
self error:'unfinished code'. |
|
2327 |
||
2328 |
" |
|
2329 |
self getMethodVersionsOfClass:MenuPanel selector:#'helpTextForItem:' numberOfRevisions:20 |
|
2330 |
self getMethodVersionsOfClass:NewLauncher class selector:#'menu' numberOfRevisions:20 |
|
2331 |
" |
|
2332 |
! ! |
|
2333 |
||
2334 |
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-user interaction'! |
|
2335 |
||
2336 |
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName |
|
2337 |
"open a dialog asking for a source container; |
|
2338 |
return a dictionary containing module, package and filename, |
|
2339 |
or nil if canceled." |
|
2340 |
||
2341 |
^ self |
|
2342 |
askForContainer:boxText title:title note:notice |
|
2343 |
initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName |
|
2344 |
forNewContainer:true |
|
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2345 |
! |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2346 |
|
1375 | 2347 |
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName forNewContainer:forNewContainer |
2348 |
"open a dialog asking for a source container; |
|
2349 |
return a dictionary containing module, package and filename, |
|
2350 |
or nil if canceled." |
|
2351 |
||
2352 |
|box y component resources answer |
|
2353 |
moduleHolder packageHolder fileNameHolder |
|
2354 |
module package fileName |
|
2355 |
knownContainers knownPackages packageUpdater |
|
2356 |
packageBoxComponent fileNameBoxComponent fileNameUpdater| |
|
2357 |
||
2358 |
knownContainers := Set new. |
|
2359 |
Smalltalk allClassesDo:[:cls | |pckg| |
|
2360 |
pckg := cls package. |
|
2361 |
pckg size > 0 ifTrue:[ |
|
2362 |
knownContainers add:(pckg upTo:$:) |
|
2363 |
] |
|
2364 |
]. |
|
2365 |
knownContainers := knownContainers asOrderedCollection. |
|
2366 |
knownContainers := knownContainers select:[:module | module isBlank not]. |
|
2367 |
knownContainers sort. |
|
2368 |
||
2369 |
packageUpdater := [ |
|
2370 |
|theModulePrefix| |
|
2371 |
||
2372 |
theModulePrefix := moduleHolder value , ':'. |
|
2373 |
||
2374 |
Cursor wait showWhile:[ |
|
2375 |
knownPackages := Set new. |
|
2376 |
Smalltalk allClassesDo:[:cls | |pckg idx| |
|
2377 |
pckg := cls package. |
|
2378 |
pckg size > 0 ifTrue:[ |
|
2379 |
(pckg startsWith:theModulePrefix) ifTrue:[ |
|
2380 |
idx := pckg indexOf:$:. |
|
2381 |
knownPackages add:(pckg copyFrom:idx + 1) |
|
2382 |
] |
|
2383 |
] |
|
2384 |
]. |
|
2385 |
knownPackages := knownPackages asOrderedCollection. |
|
2386 |
knownPackages := knownPackages select:[:package | package isBlank not]. |
|
2387 |
knownPackages sort. |
|
2388 |
packageBoxComponent list:knownPackages. |
|
2389 |
]. |
|
2390 |
]. |
|
2391 |
||
2392 |
fileNameUpdater := [ |
|
2393 |
|module package files| |
|
2394 |
||
2395 |
Cursor read showWhile:[ |
|
1671 | 2396 |
module := moduleHolder value ? (Project noProjectID). |
2397 |
package := packageHolder value ? (Project noProjectID). |
|
1375 | 2398 |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2399 |
files := SourceCodeManager getExistingContainersInModule:module directory:package. |
1375 | 2400 |
files := files asOrderedCollection. |
2401 |
files := files select:[:eachFile | eachFile asFilename hasSuffix:'st']. |
|
2402 |
files sort. |
|
2403 |
fileNameBoxComponent list:files. |
|
2404 |
]. |
|
2405 |
]. |
|
2406 |
||
2407 |
moduleHolder := initialModule asValue. |
|
2408 |
packageHolder := initialPackage asValue. |
|
2409 |
fileNameHolder := initialFileName asValue. |
|
2410 |
||
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2411 |
resources := self classResources. |
1375 | 2412 |
|
2413 |
"/ |
|
2414 |
"/ open a dialog for this |
|
2415 |
"/ |
|
2416 |
box := DialogBox new. |
|
2417 |
box label:title. |
|
2418 |
||
2419 |
component := box addTextLabel:boxText withCRs. |
|
2420 |
component adjust:#left; borderWidth:0. |
|
2421 |
box addVerticalSpace. |
|
2422 |
box addVerticalSpace. |
|
1000 | 2423 |
|
1375 | 2424 |
y := box yPosition. |
2425 |
component := box addTextLabel:(resources string:'Module:'). |
|
2426 |
component width:0.4; adjust:#right. |
|
2427 |
box yPosition:y. |
|
2428 |
component := box addComboBoxOn:moduleHolder tabable:true. |
|
2429 |
component list:knownContainers. |
|
2430 |
||
2431 |
"/ component := box addInputFieldOn:moduleHolder tabable:true. |
|
2432 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
2433 |
||
2434 |
box addVerticalSpace. |
|
2435 |
y := box yPosition. |
|
2436 |
component := box addTextLabel:(resources string:'Package:'). |
|
2437 |
component width:0.4; adjust:#right. |
|
2438 |
box yPosition:y. |
|
2439 |
packageBoxComponent := component := box addComboBoxOn:packageHolder tabable:true. |
|
2440 |
"/ component := box addInputFieldOn:packageHolder tabable:true. |
|
2441 |
component width:0.6; left:0.4; "immediateAccept:true; "acceptOnLeave:true; cursorMovementWhenUpdating:#beginOfLine. |
|
2442 |
packageUpdater value. |
|
2443 |
moduleHolder onChangeEvaluate:packageUpdater. |
|
2444 |
||
2445 |
box addVerticalSpace. |
|
2446 |
y := box yPosition. |
|
2447 |
component := box addTextLabel:(resources string:'Filename:'). |
|
2448 |
component width:0.4; adjust:#right. |
|
2449 |
box yPosition:y. |
|
2450 |
||
2451 |
forNewContainer ifTrue:[ |
|
2452 |
component := box addInputFieldOn:fileNameHolder tabable:true. |
|
2453 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
2454 |
] ifFalse:[ |
|
2455 |
fileNameBoxComponent := component := box addComboBoxOn:fileNameHolder tabable:true. |
|
2456 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
2457 |
fileNameUpdater value. |
|
2458 |
packageHolder onChangeEvaluate:fileNameUpdater. |
|
2459 |
]. |
|
2460 |
||
2461 |
box addVerticalSpace. |
|
2462 |
||
2463 |
notice notNil ifTrue:[ |
|
2464 |
component := box addTextLabel:notice. |
|
2465 |
component adjust:#left; borderWidth:0. |
|
2466 |
]. |
|
2467 |
||
2468 |
box addVerticalSpace. |
|
2469 |
box addAbortAndOkButtons. |
|
2470 |
||
2471 |
(YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[ |
|
2472 |
component := Button label:'Yes to all'. |
|
2473 |
component action:[ |
|
2474 |
YesToAllNotification queryWith:true. |
|
2475 |
box doAccept. |
|
2476 |
]. |
|
2477 |
(DialogBox defaultOKButtonAtLeft) ifTrue:[ |
|
2478 |
box addButton:component after:nil. |
|
2479 |
] ifFalse:[ |
|
2480 |
box addButton:component before:nil. |
|
2481 |
]. |
|
2482 |
]. |
|
2483 |
(AbortAllSignal isHandled) ifTrue:[ |
|
2484 |
component := Button label:'Cancel all'. |
|
2485 |
component action:[ |
|
2486 |
box hide. |
|
2487 |
AbortAllSignal raiseSignal. |
|
2488 |
]. |
|
2489 |
(DialogBox defaultOKButtonAtLeft) ifTrue:[ |
|
2490 |
box addButton:component before:nil. |
|
2491 |
] ifFalse:[ |
|
2492 |
box addButton:component after:nil. |
|
2493 |
]. |
|
2494 |
]. |
|
2495 |
||
2496 |
(YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[ |
|
2497 |
answer := YesToAllQuery query. |
|
2498 |
]. |
|
2499 |
||
2500 |
answer isNil ifTrue:[ |
|
2501 |
box showAtPointer. |
|
2502 |
answer := box accepted |
|
2503 |
]. |
|
2504 |
||
2505 |
box destroy. |
|
2506 |
answer ifFalse:[ |
|
2507 |
^ nil |
|
2508 |
]. |
|
1000 | 2509 |
|
1375 | 2510 |
module := moduleHolder value withoutSpaces. |
2511 |
package := packageHolder value withoutSpaces. |
|
2512 |
fileName := fileNameHolder value withoutSpaces. |
|
2513 |
^ Dictionary new |
|
2514 |
at:#module put:module; |
|
2515 |
at:#package put:package; |
|
2516 |
at:#fileName put:fileName; |
|
2517 |
yourself |
|
2518 |
||
2519 |
" |
|
2520 |
self |
|
2521 |
askForContainer:'enter container' title:'container' note:'some note' |
|
2522 |
initialModule:'foo' initialPackage:'bar' initialFileName:'baz' |
|
2523 |
" |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2524 |
|
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2525 |
"Modified: / 23-08-2006 / 14:13:04 / cg" |
1375 | 2526 |
! |
2527 |
||
2528 |
askForExistingRevision:boxText title:title class:aClass |
|
2529 |
"open a dialog asking for a containers revision; |
|
2530 |
return a revision number, or nil if canceled." |
|
2531 |
||
2532 |
|mgr sourceInfo module package fileName| |
|
2533 |
||
1782 | 2534 |
mgr := self sourceCodeManagerFor:aClass. |
1375 | 2535 |
sourceInfo := mgr sourceInfoOfClass:aClass. |
2536 |
sourceInfo isNil ifTrue:[^ nil]. |
|
2537 |
||
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2538 |
package := mgr directoryFromSourceInfo:sourceInfo. |
1375 | 2539 |
module := mgr moduleFromSourceInfo:sourceInfo. |
2540 |
fileName := mgr containerFromSourceInfo:sourceInfo. |
|
2541 |
^ self |
|
2542 |
askForExistingRevision:boxText |
|
2543 |
title:title |
|
2544 |
class:aClass |
|
2545 |
manager:mgr |
|
2546 |
module:module package:package fileName:fileName |
|
2547 |
||
2548 |
" |
|
2549 |
SourceCodeManagerUtilities |
|
2550 |
askForRevisionToCompare:'enter revision' |
|
2551 |
title:'revision' |
|
2552 |
class:Array |
|
2553 |
" |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2554 |
|
1782 | 2555 |
"Modified: / 12-09-2006 / 14:17:04 / cg" |
1375 | 2556 |
! |
2557 |
||
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2558 |
askForExistingRevision:boxText title:title class:clsOrNil manager:aSourceCodeManager module:module package:directory fileName:fileName |
1375 | 2559 |
"open a dialog asking for a containers revision; |
2560 |
return a revision number, or nil if canceled." |
|
2561 |
||
2562 |
|partialLog revisions items newestRev |
|
2563 |
box y component resources |
|
1456
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2564 |
revisionHolder symbolicNames stableRevision releasedRevision| |
1375 | 2565 |
|
2566 |
partialLog := aSourceCodeManager |
|
2567 |
revisionLogOf:clsOrNil |
|
2568 |
numberOfRevisions:20 |
|
2569 |
fileName:fileName |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2570 |
directory:directory |
1375 | 2571 |
module:module. |
1522 | 2572 |
|
1375 | 2573 |
partialLog notNil ifTrue:[ |
2574 |
newestRev := partialLog at:#newestRevision. |
|
2575 |
revisions := partialLog at:#revisions. |
|
1456
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2576 |
symbolicNames := partialLog at:#symbolicNames ifAbsent:[]. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2577 |
symbolicNames notNil ifTrue:[ |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2578 |
stableRevision := symbolicNames at:'stable' ifAbsent:[]. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2579 |
releasedRevision := symbolicNames at:'released' ifAbsent:[]. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2580 |
]. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2581 |
|
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2582 |
items := revisions collect:[:each | |rev date who flag| |
1375 | 2583 |
rev := each at:#revision. |
2584 |
date := each at:#date. |
|
2585 |
who := each at:#author. |
|
1456
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2586 |
rev = stableRevision ifTrue:[ |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2587 |
flag := ' Stable' allBold. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2588 |
] ifFalse:[rev = releasedRevision ifTrue:[ |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2589 |
flag := ' Released' allBold. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2590 |
] ifFalse:[ |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2591 |
flag := ' ' |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2592 |
]]. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2593 |
rev allBold , flag, ' [' , date , ' by ' , who , ']' |
1375 | 2594 |
]. |
2595 |
revisions := revisions collect:[:each | each at:#revision]. |
|
2596 |
] ifFalse:[ |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2597 |
newestRev := aSourceCodeManager newestRevisionInFile:fileName directory:directory module:module. |
1375 | 2598 |
revisions := items := nil. |
2599 |
||
2600 |
newestRev isNil ifTrue:[ |
|
1787 | 2601 |
(aSourceCodeManager checkForExistingContainer:fileName inModule:module directory:directory) |
1375 | 2602 |
ifFalse:[ |
2603 |
self warn:'Could not find/access the container for ',fileName,' in the repository. |
|
2604 |
This could be due to: |
|
2605 |
- invalid/wrong CVS-Root setting |
|
2606 |
- missing CVS access rights |
|
2607 |
(no access / not logged in) |
|
2608 |
- changed CVSRoot after compilation |
|
2609 |
(i.e. wrong CVS-path in classes version method) |
|
2610 |
'. |
|
2611 |
^ nil |
|
2612 |
] |
|
2613 |
] |
|
2614 |
]. |
|
2615 |
revisionHolder := newestRev asValue. |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2616 |
resources := self classResources. |
1375 | 2617 |
|
2618 |
revisionHolder onChangeEvaluate:[ |
|
2619 |
"/ cut off everything after revision |
|
2620 |
|s first words| |
|
2621 |
||
2622 |
s := revisionHolder value. |
|
2623 |
words := s asCollectionOfWords. |
|
2624 |
words size > 0 ifTrue:[ |
|
2625 |
first := words first string. |
|
2626 |
first ~= s ifTrue:[ |
|
2627 |
revisionHolder value:first |
|
2628 |
] |
|
2629 |
] |
|
2630 |
]. |
|
2631 |
||
2632 |
"/ |
|
2633 |
"/ open a dialog for this |
|
2634 |
"/ |
|
2635 |
box := DialogBox new. |
|
2636 |
box label:title. |
|
2637 |
||
2638 |
component := box addTextLabel:boxText withCRs. |
|
2639 |
component adjust:#left; borderWidth:0. |
|
2640 |
box addVerticalSpace. |
|
2641 |
box addVerticalSpace. |
|
2642 |
||
2643 |
y := box yPosition. |
|
2644 |
component := box addTextLabel:(resources string:'Revision:'). |
|
2645 |
component width:0.4; adjust:#right. |
|
2646 |
box yPosition:y. |
|
2647 |
component := box addComboBoxOn:revisionHolder tabable:true. |
|
2648 |
component list:items. |
|
2649 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
2650 |
||
2651 |
box addVerticalSpace. |
|
2652 |
||
2653 |
box addAbortAndOkButtons. |
|
2654 |
||
1964
8137bfb6a7ea
AbortSignal->AbortOperationRequest
Stefan Vogel <sv@exept.de>
parents:
1955
diff
changeset
|
2655 |
AbortAllOperationRequest isHandled ifTrue:[ |
1375 | 2656 |
(box addAbortButtonLabelled:'Cancel all') action:[AbortAllSignal raise]. |
2657 |
]. |
|
2658 |
||
2659 |
box showAtPointer. |
|
2660 |
||
2661 |
box accepted ifFalse:[ |
|
2662 |
box destroy. |
|
2663 |
^ nil |
|
2664 |
]. |
|
2665 |
box destroy. |
|
2666 |
||
2667 |
^ revisionHolder value withoutSpaces. |
|
2668 |
||
2669 |
" |
|
2670 |
SourceCodeManagerUtilities |
|
2671 |
askForRevisionToCompare:'enter revision' |
|
2672 |
title:'revision' |
|
2673 |
class:nil |
|
2674 |
manager:SourceCodeManager |
|
2675 |
module:'stx' |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2676 |
directory:'libbasic' |
1375 | 2677 |
fileName:'Array.st' |
2678 |
" |
|
1522 | 2679 |
|
1787 | 2680 |
"Modified: / 13-09-2006 / 18:24:46 / cg" |
1375 | 2681 |
! |
2682 |
||
1426 | 2683 |
checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder |
1375 | 2684 |
"check if a class contains message-sends to: |
2685 |
#halt |
|
2686 |
#halt: |
|
2687 |
#error |
|
2688 |
(and maybe more in the future)" |
|
2689 |
||
1426 | 2690 |
|badStuff whatIsBad msg answer labels values defaultAnswer dontShowAgain| |
1375 | 2691 |
|
2692 |
badStuff := #( |
|
1456
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2693 |
( halt 'sent of #halt (use for debugging only) - better use #error:''some message''' ) |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2694 |
( halt: 'sent of #halt: (use for debugging only) - better use #error:' ) |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2695 |
( error 'sent of #error without descriptive message - better use #error:''some message''' ) |
1375 | 2696 |
). |
2697 |
||
2698 |
whatIsBad := Set new. |
|
2699 |
aClass theNonMetaclass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
2700 |
|setOfLiterals setOfSentMessages| |
|
2701 |
||
2702 |
setOfLiterals := mthd literals. "/ try without parsing first. |
|
2703 |
(badStuff contains:[:eachEntry | setOfLiterals includes:eachEntry first]) ifTrue:[ |
|
2704 |
setOfSentMessages := mthd messagesSent. |
|
2705 |
badStuff do:[:eachEntry | |
|
2706 |
(setOfSentMessages includes:eachEntry first) ifTrue:[ |
|
2707 |
whatIsBad add:eachEntry second |
|
2708 |
] |
|
1000 | 2709 |
]. |
2710 |
]. |
|
1375 | 2711 |
]. |
2712 |
whatIsBad notEmpty ifTrue:[ |
|
2713 |
(YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[ |
|
2714 |
answer := YesToAllQuery query. |
|
2715 |
answer notNil ifTrue:[ ^ answer ]. |
|
2716 |
]. |
|
2717 |
||
2718 |
msg := '%1 contains the following (considered bad style) message sends:\\'. |
|
2719 |
whatIsBad do:[:each | |
|
2720 |
msg := msg , ' ' , each , '\' |
|
1000 | 2721 |
]. |
1375 | 2722 |
msg := msg , '\\' , 'Do you really want to checkIn the %1 class ?'. |
2723 |
msg := msg bindWith:aClass name. |
|
1426 | 2724 |
|
1375 | 2725 |
(YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[ |
1426 | 2726 |
labels := #('Cancel All' 'Cancel' 'No to All' 'No' 'Yes to All' 'Yes') "#('Yes' 'Yes to All' 'No' 'No to All' 'Cancel')". |
2727 |
values := #(#cancelAll nil #noToAll false #yesToAll true) "#(true #yesToAll false #noToAll nil)". |
|
2728 |
defaultAnswer := #yesToAll. |
|
2729 |
] ifFalse:[ |
|
2730 |
labels := #('No' 'Yes'). |
|
2731 |
values := #(false true). |
|
2732 |
defaultAnswer := true. |
|
2733 |
]. |
|
2734 |
||
1456
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2735 |
"/ AbortAllOperationRequest isHandled ifTrue:[ |
1426 | 2736 |
"/ labels := #('Cancel All') , labels. |
2737 |
"/ values := #(#cancelAll) , values. |
|
2738 |
"/ ]. |
|
2739 |
||
2740 |
DialogBox aboutToOpenBoxNotificationSignal handle:[:ex | |
|
2741 |
|box| |
|
2742 |
||
2743 |
checkAgainHolder isValueModel ifTrue:[ |
|
2744 |
dontShowAgain := checkAgainHolder value not asValue. |
|
2745 |
box := ex parameter. |
|
2746 |
box verticalPanel |
|
1429 | 2747 |
add:(CheckBox label:'Do not show this Dialog again.' |
1426 | 2748 |
model:dontShowAgain). |
1375 | 2749 |
]. |
1426 | 2750 |
ex proceed. |
2751 |
] do:[ |
|
1375 | 2752 |
answer := OptionBox |
2753 |
request:msg withCRs |
|
2754 |
label:'Really checkIn ?' |
|
1391
68432469745f
dont send obsolete message (OptionBox request:..form:..)
Claus Gittinger <cg@exept.de>
parents:
1381
diff
changeset
|
2755 |
image:(InfoBox iconBitmap) |
1375 | 2756 |
buttonLabels:labels |
2757 |
values:values |
|
1426 | 2758 |
default:defaultAnswer |
1375 | 2759 |
onCancel:nil. |
1426 | 2760 |
]. |
2761 |
answer isNil ifTrue:[ |
|
2762 |
AbortSignal raise. |
|
2763 |
]. |
|
2764 |
||
2765 |
dontShowAgain notNil ifTrue:[ |
|
2766 |
checkAgainHolder value:dontShowAgain value not |
|
2767 |
]. |
|
1375 | 2768 |
|
1426 | 2769 |
answer == #cancelAll ifTrue:[ |
2770 |
AbortAllSignal raise. |
|
2771 |
]. |
|
2772 |
||
2773 |
answer == #yesToAll ifTrue:[ |
|
2774 |
YesToAllNotification queryWith:true. |
|
2775 |
^ true |
|
2776 |
]. |
|
2777 |
answer == #noToAll ifTrue:[ |
|
2778 |
YesToAllNotification queryWith:false. |
|
2779 |
^ false |
|
2780 |
]. |
|
2781 |
^ answer |
|
1000 | 2782 |
]. |
1375 | 2783 |
^ true. |
2784 |
||
2785 |
" |
|
2786 |
self checkAndWarnAboutBadMessagesInClass:(SourceCodeManagerUtilities) |
|
2787 |
" |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2788 |
! |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2789 |
|
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2790 |
getCheckinInfoFor:aString initialAnswer:initialAnswerOrNil |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2791 |
"get a log message for checking in a class. |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2792 |
Return the message or nil if aborted." |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2793 |
|
1704 | 2794 |
^ self |
2795 |
getCheckinInfoFor:aString |
|
2796 |
initialAnswer:initialAnswerOrNil |
|
2797 |
withQuickOption:false |
|
2798 |
||
2799 |
" |
|
2800 |
SourceCodeManagerUtilities getCheckinInfoFor:'hello' initialAnswer:'bla' |
|
2801 |
" |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2802 |
|
1704 | 2803 |
"Modified: / 22-06-2006 / 12:49:30 / cg" |
2804 |
! |
|
2805 |
||
2806 |
getCheckinInfoFor:aString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption |
|
2807 |
"get a log message for checking in a class. |
|
2808 |
Return the message or nil if aborted." |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2809 |
|
1704 | 2810 |
|logMsg info| |
2811 |
||
2812 |
info := Tools::CheckinInfoDialog |
|
2813 |
getCheckinInfoFor:aString |
|
2814 |
initialAnswer:(initialAnswerOrNil ? LastSourceLogMessage) |
|
2815 |
withQuickOption:withQuickOption. |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2816 |
info notNil ifTrue:[ |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2817 |
logMsg := info logMessage. |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2818 |
logMsg notNil ifTrue:[ |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2819 |
LastSourceLogMessage := logMsg |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2820 |
]. |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2821 |
]. |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2822 |
^ info |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2823 |
|
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2824 |
" |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2825 |
SourceCodeManagerUtilities getCheckinInfoFor:'hello' initialAnswer:'bla' |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2826 |
" |
1501 | 2827 |
|
2828 |
"Modified: / 22-06-2006 / 12:49:30 / cg" |
|
1375 | 2829 |
! ! |
2830 |
||
2831 |
!SourceCodeManagerUtilities class methodsFor:'utilities-encoding'! |
|
2832 |
||
2833 |
guessEncodingOfBuffer:buffer |
|
2834 |
"look for a string of the form |
|
2835 |
encoding #name |
|
2836 |
or: |
|
2837 |
encoding: name |
|
2838 |
within the given buffer |
|
2839 |
(which is usually the first few bytes of a textFile)." |
|
2840 |
||
1433
c3696ad0922b
mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents:
1429
diff
changeset
|
2841 |
<resource: #obsolete> |
c3696ad0922b
mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents:
1429
diff
changeset
|
2842 |
|
1414
f67d4b166606
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
1403
diff
changeset
|
2843 |
self obsoleteMethodWarning:'ask CharacterEncoder'. |
f67d4b166606
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
1403
diff
changeset
|
2844 |
^ CharacterEncoder guessEncodingOfBuffer:buffer |
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2845 |
! |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2846 |
|
1375 | 2847 |
guessEncodingOfFile:aFilename |
2848 |
"look for a string |
|
2849 |
encoding #name |
|
2850 |
or: |
|
2851 |
encoding: name |
|
2852 |
within the given buffer |
|
2853 |
(which is usually the first few bytes of a textFile). |
|
2854 |
If thats not found, use heuristics (in CharacterArray) to guess." |
|
2855 |
||
1433
c3696ad0922b
mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents:
1429
diff
changeset
|
2856 |
<resource: #obsolete> |
c3696ad0922b
mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents:
1429
diff
changeset
|
2857 |
|
1414
f67d4b166606
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
1403
diff
changeset
|
2858 |
self obsoleteMethodWarning:'ask CharacterEncoder'. |
f67d4b166606
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
1403
diff
changeset
|
2859 |
^ CharacterEncoder guessEncodingOfFile:aFilename |
1375 | 2860 |
|
2861 |
" |
|
2862 |
SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_de.rs' asFilename |
|
2863 |
SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_ru.rs' asFilename |
|
2864 |
" |
|
2865 |
! |
|
2866 |
||
2867 |
guessEncodingOfStream:aStream |
|
2868 |
"look for a string of the form |
|
2869 |
encoding #name |
|
2870 |
or: |
|
2871 |
encoding: name |
|
2872 |
in the first few bytes of aStream." |
|
2873 |
||
1433
c3696ad0922b
mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents:
1429
diff
changeset
|
2874 |
<resource: #obsolete> |
c3696ad0922b
mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents:
1429
diff
changeset
|
2875 |
|
1414
f67d4b166606
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
1403
diff
changeset
|
2876 |
self obsoleteMethodWarning:'ask CharacterEncoder'. |
f67d4b166606
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
1403
diff
changeset
|
2877 |
^ CharacterEncoder guessEncodingOfStream:aStream |
873 | 2878 |
! ! |
2879 |
||
2880 |
!SourceCodeManagerUtilities class methodsFor:'documentation'! |
|
2881 |
||
2882 |
version |
|
1972
32853d3cb43a
care for errors during fileOut ofr local source
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
2883 |
^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.161 2007-10-15 14:27:14 cg Exp $' |
873 | 2884 |
! ! |