author | Claus Gittinger <cg@exept.de> |
Mon, 20 Nov 2006 22:26:51 +0100 | |
changeset 1911 | d4088b5ba0ac |
parent 1907 | 30ca5aea5a7a |
child 1913 | d87c1ed5bf1f |
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 |
|
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
825 |
"/ |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
826 |
"/ 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
|
827 |
"/ |
1084 | 828 |
"/ newestRev := mgr newestRevisionOf:currentClass. |
829 |
newestRev := mgr newestRevisionInFile:containerFile directory:containerPackage module:containerModule. |
|
1006 | 830 |
askForRevision ifFalse:[ |
831 |
rev := newestRev ? '' |
|
832 |
] ifTrue:[ |
|
1019 | 833 |
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
|
834 |
rev notNil ifTrue:[ |
1006 | 835 |
msg := msg , '\\' , (resources string:'Current ''%1'' is based upon rev %2.' |
1019 | 836 |
with:nm allBold with:rev). |
1006 | 837 |
(rev2 notNil and:[rev2 ~= rev]) ifTrue:[ |
838 |
msg := msg , '\' , (resources string:'And has been checked into the repository as %1.' |
|
839 |
with:rev2) |
|
840 |
] |
|
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
841 |
]. |
1006 | 842 |
newestRev notNil ifTrue:[ |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
843 |
msg := msg , '\' , (resources string:'Newest in repository is %1.' |
1006 | 844 |
with:newestRev) |
989
bb70a0f30e98
care for autoloaded classes when checking out
Claus Gittinger <cg@exept.de>
parents:
987
diff
changeset
|
845 |
]. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
846 |
|
1006 | 847 |
rev := SourceCodeManagerUtilities |
848 |
askForExistingRevision:msg |
|
849 |
title:'CheckOut from repository' |
|
850 |
class:currentClass. |
|
851 |
rev isNil ifTrue:[ |
|
1339 | 852 |
^ self "/ canceled |
987 | 853 |
]. |
1006 | 854 |
]. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
855 |
|
1006 | 856 |
rev withoutSpaces isEmpty ifTrue:[ |
857 |
msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'. |
|
858 |
"/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm. |
|
859 |
aStream := mgr getSourceStreamFor:currentClass revision:newestRev. |
|
860 |
revString := '(newest: ' , (newestRev ? '???') , ')'. |
|
861 |
] ifFalse:[ |
|
862 |
msg := 'extracting previous %1'. |
|
1084 | 863 |
"/ aStream := mgr getSourceStreamFor:currentClass revision:rev. |
864 |
"/ revString := rev |
|
865 |
aStream := mgr |
|
866 |
streamForClass:currentClass |
|
867 |
fileName:containerFile |
|
868 |
revision:rev |
|
869 |
directory:containerPackage |
|
870 |
module:containerModule |
|
871 |
cache:true. |
|
1006 | 872 |
]. |
996 | 873 |
|
1006 | 874 |
aStream isNil ifTrue:[ |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
875 |
self warn:(resources string:'Could not extract source of %1 from repository' with:aClass name allBold). |
1006 | 876 |
^ self |
877 |
]. |
|
878 |
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
|
879 |
self warn:('Read error while reading extracted source\\' , ex description) withCRs. |
1006 | 880 |
aStream close. |
881 |
^ self |
|
882 |
] do:[ |
|
883 |
sourceToLoad := aStream contents asString. |
|
884 |
]. |
|
885 |
aStream close. |
|
987 | 886 |
|
1879
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
887 |
wasInChangeSetBefore := ChangeSet current includesChangeForClass:currentClass. |
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
888 |
|
1006 | 889 |
currentClass isLoaded ifFalse:[ |
890 |
rev = newestRev ifTrue:[ |
|
891 |
currentClass autoload. |
|
996 | 892 |
] ifFalse:[ |
1006 | 893 |
sourceToLoad readStream fileIn. |
996 | 894 |
]. |
1879
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
895 |
wasInChangeSetBefore ifFalse:[ |
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
896 |
ChangeSet current condenseChangesForClass:currentClass. |
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
897 |
]. |
1006 | 898 |
^ self. |
899 |
]. |
|
900 |
||
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
901 |
inChangeSet := ChangeSet current includesChangeForClassOrMetaclassOrPrivateClassOf:aClass. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
902 |
|
1006 | 903 |
self activityNotification:'generating current source...'. |
904 |
||
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
905 |
currentSource := self sourceCodeOfClass:currentClass. |
1006 | 906 |
|
907 |
self activityNotification:'comparing...'. |
|
908 |
||
909 |
sourceToLoad = currentSource ifTrue:[ |
|
910 |
"/ make all methods belong to the classes project |
|
911 |
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
|
912 |
inChangeSet ifTrue:[ |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
913 |
rev = newestRev ifTrue:[ |
1879
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
914 |
(wasInChangeSetBefore not |
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
915 |
or:[ self confirm:(resources |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
916 |
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
|
917 |
with:aClass name)]) |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
918 |
ifTrue:[ |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
919 |
ChangeSet current condenseChangesForClass:aClass. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
920 |
]. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
921 |
]. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
922 |
]. |
1006 | 923 |
^ self. |
924 |
]. |
|
925 |
||
926 |
self activityNotification:'generating diffSet...'. |
|
927 |
listHere := ChangeSet fromStream:(currentSource readStream). |
|
928 |
listRep := ChangeSet fromStream:(sourceToLoad readStream). |
|
1051 | 929 |
|
930 |
versionMethodsHere := listHere select:[:change | (change isMethodChange |
|
931 |
and:[change selector == #version |
|
932 |
and:[change changeClass isMeta]])]. |
|
933 |
||
934 |
versionMethodsRep := listRep select:[:change | (change isMethodChange |
|
935 |
and:[change selector == #version |
|
936 |
and:[change changeClass isMeta]])]. |
|
937 |
||
1044 | 938 |
"/ compare all but the version methods |
939 |
listHere := listHere select:[:change | (change isMethodChange |
|
940 |
and:[change selector == #version |
|
941 |
and:[change changeClass isMeta]]) not]. |
|
942 |
listRep := listRep select:[:change | (change isMethodChange |
|
943 |
and:[change selector == #version |
|
944 |
and:[change changeClass isMeta]]) not]. |
|
945 |
||
1006 | 946 |
diffSet := listHere diffSetsAgainst:listRep. |
1157 | 947 |
changed := diffSet changed. |
948 |
onlyHere := diffSet onlyInReceiver. |
|
949 |
onlyInRep := diffSet onlyInArg. |
|
1006 | 950 |
|
1050 | 951 |
changedClassDefinitions := changed select:[:eachChangePair | eachChangePair first isClassDefinitionChange]. |
952 |
changed := changed reject:[:eachChangePair | eachChangePair first isClassDefinitionChange]. |
|
953 |
||
1121 | 954 |
labels := #('Cancel' 'Merge' 'Load'). |
1006 | 955 |
values := #(nil #merge #load). |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
956 |
default := askForRevision |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
957 |
ifTrue:[3. "i.e. load"] |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
958 |
ifFalse:[2. "i.e. merge"]. |
1006 | 959 |
|
1339 | 960 |
msg := 'About to load ''%4''.\\'. |
1006 | 961 |
onlyInRep size > 0 ifTrue:[ |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
962 |
msg := msg , 'The repositories version contains %1 method(s) which are not in your current class.\'. |
1006 | 963 |
]. |
964 |
onlyHere size > 0 ifTrue:[ |
|
965 |
onlyInRep size > 0 ifTrue:[ |
|
966 |
msg := msg , 'And there '. |
|
967 |
] ifFalse:[ |
|
968 |
msg := msg , 'There '. |
|
996 | 969 |
]. |
1006 | 970 |
msg := msg , 'are %2 methods in your current class, which are not in the repository.\'. |
971 |
]. |
|
972 |
changed size > 0 ifTrue:[ |
|
1054 | 973 |
changed size == 1 ifTrue:[ |
1339 | 974 |
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
|
975 |
singleChangeSelector := changed first first selector allBold |
1054 | 976 |
] ifFalse:[ |
977 |
msg := msg , '%3 methods are different (present in both).\\'. |
|
978 |
] |
|
1006 | 979 |
]. |
1050 | 980 |
changedClassDefinitions size > 0 ifTrue:[ |
981 |
changedClassDefinitions size == 1 ifTrue:[ |
|
1339 | 982 |
msg := msg , 'The class definition is different.\\'. |
1050 | 983 |
] ifFalse:[ |
984 |
msg := msg , '%5 class definitions are different.\\'. |
|
985 |
] |
|
986 |
]. |
|
996 | 987 |
|
1006 | 988 |
onlyHere isEmpty ifTrue:[ |
989 |
onlyInRep isEmpty ifTrue:[ |
|
1050 | 990 |
(changed isEmpty and:[changedClassDefinitions isEmpty]) ifTrue:[ |
1006 | 991 |
"/ 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
|
992 |
versionMethodsRep size == 1 ifTrue:[ |
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
993 |
"/ (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
|
994 |
versionMethodsRep first apply. |
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
995 |
"/ ] |
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
996 |
]. |
1006 | 997 |
self setPackageOfAllMethodsIn:aClass to:aClass package. |
998 |
^ self |
|
999 |
]. |
|
1339 | 1000 |
inChangeSet ifTrue:[ |
1001 |
msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made).'. |
|
1002 |
]. |
|
1121 | 1003 |
labels := #('Cancel' 'Load'). |
1006 | 1004 |
values := #(nil #load). |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1005 |
default := askForRevision |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1006 |
ifTrue:[2. "i.e. load"] |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1007 |
ifFalse:[1. "i.e. cancel"]. |
1907 | 1008 |
default := 2. |
1006 | 1009 |
] ifFalse:[ |
1010 |
changed isEmpty ifTrue:[ |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1011 |
msg := msg , '\Attention:\Load will load methods which are not present in ''%4''.'. |
1121 | 1012 |
labels := #('Cancel' 'Load'). |
987 | 1013 |
values := #(nil #load). |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1014 |
default := askForRevision |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1015 |
ifTrue:[2. "i.e. load"] |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1016 |
ifFalse:[1. "i.e. cancel"]. |
1907 | 1017 |
default := 2. |
987 | 1018 |
] ifFalse:[ |
1339 | 1019 |
inChangeSet ifTrue:[ |
1020 |
msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'. |
|
1021 |
]. |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1022 |
msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'. |
1006 | 1023 |
]. |
1024 |
] |
|
1025 |
] ifFalse:[ |
|
1026 |
onlyInRep isEmpty ifTrue:[ |
|
1339 | 1027 |
inChangeSet ifTrue:[ |
1028 |
msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made),'. |
|
1029 |
msg := msg , '\and remove added methods which are not present in the repository version.'. |
|
1030 |
]. |
|
1121 | 1031 |
labels := #('Cancel' 'Load'). |
1006 | 1032 |
values := #(nil #load). |
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1033 |
default := askForRevision |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1034 |
ifTrue:[2. "i.e. load"] |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1035 |
ifFalse:[1. "i.e. cancel"]. |
1907 | 1036 |
default := 2. |
1006 | 1037 |
] ifFalse:[ |
1339 | 1038 |
inChangeSet ifTrue:[ |
1039 |
msg := msg , '\Attention:\Load will undo your changes made to ''%4'' (if any were made);'. |
|
1040 |
msg := msg , '\Merge will only load methods which are not present in ''%4'' (i.e. undo removals but preserve changes).'. |
|
1041 |
] |
|
1006 | 1042 |
] |
1043 |
]. |
|
1050 | 1044 |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1045 |
msg := msg bindWith:onlyInRep size printString |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1046 |
with:onlyHere size printString |
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1047 |
with:changed size printString |
1050 | 1048 |
with:aClass name allBold |
1054 | 1049 |
with:changedClassDefinitions size printString |
1050 |
with:singleChangeSelector. |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1051 |
|
1006 | 1052 |
answer := (Dialog confirmWithCancel:msg withCRs |
1053 |
labels:(resources array:labels) |
|
1054 |
values:values |
|
1007
44c0229bcb43
better dialog message text and load/cancel default.
Claus Gittinger <cg@exept.de>
parents:
1006
diff
changeset
|
1055 |
default:default). |
1006 | 1056 |
answer isNil ifTrue:[^ self]. |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1057 |
|
1006 | 1058 |
self activityNotification:'updating...'. |
1059 |
changedClasses := IdentitySet new. |
|
1000 | 1060 |
|
1058
90807c795eb5
do update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1057
diff
changeset
|
1061 |
"/ Class withoutUpdatingChangesDo:[ |
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1062 |
answer == #load ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1063 |
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
|
1064 |
|cHere cRep| |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1065 |
cHere := eachChangeArr at:1. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1066 |
cRep := eachChangeArr at:2. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1067 |
cRep apply. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1068 |
cRep isMethodChange ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1069 |
cRep changeMethod setPackage:(cRep changeClass package). |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1070 |
changedClasses add:cRep changeClass. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1071 |
] |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1072 |
]. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1073 |
]. |
1006 | 1074 |
onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)" |
1075 |
eachChange apply. |
|
1076 |
eachChange isMethodChange ifTrue:[ |
|
1011
647a8c2fabc1
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
1077 |
eachChange changeMethod setPackage:(eachChange changeClass package). |
1006 | 1078 |
changedClasses add:eachChange changeClass. |
1079 |
] |
|
1080 |
]. |
|
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1081 |
answer == #load ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1082 |
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
|
1083 |
|cClass cSel| |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1084 |
eachChange isMethodChange ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1085 |
cClass := eachChange changeClass. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1086 |
cSel := eachChange selector. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1087 |
cClass removeSelector:cSel. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1088 |
] |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1089 |
]. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1090 |
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
|
1091 |
|cHere cRep| |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1092 |
cHere := eachChangeArr at:1. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1093 |
cRep := eachChangeArr at:2. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1094 |
cRep apply. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1095 |
cRep isMethodChange ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1096 |
cRep changeMethod setPackage:(cRep changeClass package). |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1097 |
changedClasses add:cRep changeClass. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1098 |
] |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1099 |
]. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1100 |
"/ 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
|
1101 |
self setPackageOfAllMethodsIn:aClass to:aClass package. |
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1102 |
versionMethodsRep size == 1 ifTrue:[ |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1103 |
versionMethodsRep first apply. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1104 |
self setPackageOfAllMethodsIn:aClass to:aClass package. |
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1105 |
] ifFalse:[ |
1194 | 1106 |
self error:'too many version methods'. |
1057
6903d4d5097d
do not update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1056
diff
changeset
|
1107 |
]. |
1055
f44b12442c58
version update after load from rep.
Claus Gittinger <cg@exept.de>
parents:
1054
diff
changeset
|
1108 |
]. |
1058
90807c795eb5
do update the changesFile, when checkingOut
Claus Gittinger <cg@exept.de>
parents:
1057
diff
changeset
|
1109 |
"/ ]. |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1110 |
|
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1111 |
answer == #load ifTrue:[ |
1811 | 1112 |
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
|
1113 |
inChangeSet ifTrue:[ |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1114 |
rev = newestRev ifTrue:[ |
1879
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
1115 |
(wasInChangeSetBefore not |
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
1116 |
or:[ self confirm:(resources |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1117 |
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
|
1118 |
with:aClass name)]) |
1800
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1119 |
ifTrue:[ |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1120 |
ChangeSet current condenseChangesForClass:aClass. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1121 |
]. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1122 |
]. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1123 |
]. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1124 |
]. |
560e29381f52
ask for condense changeSet when loading the newest revision
Claus Gittinger <cg@exept.de>
parents:
1787
diff
changeset
|
1125 |
|
1006 | 1126 |
changedClasses do:[:eachClass | |
1127 |
eachClass changed:#projectOrganization. |
|
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1128 |
]. |
1011
647a8c2fabc1
method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
1129 |
Smalltalk changed:#projectOrganization. |
1044 | 1130 |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
1131 |
"Modified: / 07-02-2001 / 18:18:32 / ps" |
1879
3ca8838014ee
dont ask for changeSet-compression if the loaded
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
1132 |
"Modified: / 23-10-2006 / 10:35:07 / cg" |
986
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1133 |
! |
78d2a098bc81
support to checkout/merge a class from the repository
Claus Gittinger <cg@exept.de>
parents:
984
diff
changeset
|
1134 |
|
1522 | 1135 |
checkoutExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision askForMerge:askForMerge using:aSourceCodeManager |
1136 |
"check-out a class from the source repository. |
|
1137 |
If askForRevision is false, check-out the newest version." |
|
1138 |
||
1841
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
1139 |
|resources |
1704 | 1140 |
inChangeSet extensionMethods |
1841
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
1141 |
rev msg |
1704 | 1142 |
listHere listRep diffSet |
1522 | 1143 |
changed onlyHere onlyInRep answer labels values singleChangeSelector |
1144 |
changedClasses default | |
|
1145 |
||
1841
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
1146 |
listRep := self changeSetForExtensionMethodsForPackage:packageToCheckOut askForRevision:askForRevision using:aSourceCodeManager. |
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
1147 |
listRep isNil ifTrue:[ ^self ]. |
1522 | 1148 |
|
1841
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
1149 |
resources := self classResources. |
1522 | 1150 |
|
1151 |
self activityNotification:'generating diffSet...'. |
|
1152 |
||
1153 |
extensionMethods := OrderedCollection new. |
|
1154 |
Smalltalk allClassesDo:[:aClass | |owner classPackage| |
|
1155 |
"/ individual methods ... |
|
1156 |
aClass isMeta ifFalse:[ |
|
1157 |
(aClass package ~= packageToCheckOut) ifTrue:[ |
|
1158 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
1159 |
"/ methods in this project ... |
|
1160 |
(mthd package = packageToCheckOut) ifTrue:[ |
|
1161 |
"/ ... whose class is not in the ckechIn-set |
|
1162 |
extensionMethods add:mthd |
|
1163 |
] |
|
1164 |
]. |
|
1165 |
]. |
|
1166 |
]. |
|
1167 |
]. |
|
1168 |
listHere := ChangeSet forExistingMethods:extensionMethods. |
|
1169 |
||
1170 |
inChangeSet := listRep contains:[:someChange | |
|
1171 |
|cClass cSel| |
|
1172 |
||
1173 |
someChange isMethodChange ifTrue:[ |
|
1174 |
cClass := someChange changeClass. |
|
1175 |
cSel := someChange selector. |
|
1176 |
ChangeSet current includesChangeForClass:cClass selector:cSel |
|
1177 |
] |
|
1178 |
]. |
|
1179 |
||
1180 |
diffSet := listHere diffSetsAgainst:listRep. |
|
1181 |
changed := diffSet changed. |
|
1182 |
onlyHere := diffSet onlyInReceiver. |
|
1183 |
onlyInRep := diffSet onlyInArg. |
|
1184 |
||
1185 |
labels := #('Cancel' 'Merge' 'Load'). |
|
1186 |
values := #(nil #merge #load). |
|
1187 |
default := askForRevision |
|
1188 |
ifTrue:[3. "i.e. load"] |
|
1189 |
ifFalse:[2. "i.e. merge"]. |
|
1190 |
||
1191 |
msg := 'About to load extensions for ''%5''.\\'. |
|
1192 |
onlyInRep size > 0 ifTrue:[ |
|
1193 |
msg := msg , 'The repositories version contains %1 extension method(s) which are not in your current image.\'. |
|
1194 |
]. |
|
1195 |
onlyHere size > 0 ifTrue:[ |
|
1196 |
onlyInRep size > 0 ifTrue:[ |
|
1197 |
msg := msg , 'And there '. |
|
1198 |
] ifFalse:[ |
|
1199 |
msg := msg , 'There '. |
|
1200 |
]. |
|
1201 |
msg := msg , 'are %2 extension methods in your current image, which are not in the repository.\'. |
|
1202 |
]. |
|
1203 |
changed size > 0 ifTrue:[ |
|
1204 |
changed size == 1 ifTrue:[ |
|
1205 |
msg := msg , 'The ''%5''-method is different (present in both).\\'. |
|
1206 |
singleChangeSelector := changed first first selector allBold |
|
1207 |
] ifFalse:[ |
|
1208 |
msg := msg , '%3 methods are different (present in both).\\'. |
|
1209 |
] |
|
1210 |
]. |
|
1211 |
||
1212 |
onlyHere isEmpty ifTrue:[ |
|
1213 |
onlyInRep isEmpty ifTrue:[ |
|
1214 |
(changed isEmpty) ifTrue:[ |
|
1215 |
listRep do:[:eachChange | |
|
1216 |
eachChange changeMethod setPackage:packageToCheckOut. |
|
1217 |
]. |
|
1218 |
^ self |
|
1219 |
]. |
|
1220 |
inChangeSet ifTrue:[ |
|
1221 |
msg := msg , '\Attention:\Load may undo any changes made to on of the extension methods (if any were made).'. |
|
1222 |
]. |
|
1223 |
labels := #('Cancel' 'Load'). |
|
1224 |
values := #(nil #load). |
|
1225 |
default := askForRevision |
|
1226 |
ifTrue:[2. "i.e. load"] |
|
1227 |
ifFalse:[1. "i.e. cancel"]. |
|
1228 |
] ifFalse:[ |
|
1229 |
changed isEmpty ifTrue:[ |
|
1230 |
msg := msg , '\Attention:\Load will load methods which are not present in the image.'. |
|
1231 |
labels := #('Cancel' 'Load'). |
|
1232 |
values := #(nil #load). |
|
1233 |
default := askForRevision |
|
1234 |
ifTrue:[2. "i.e. load"] |
|
1235 |
ifFalse:[1. "i.e. cancel"]. |
|
1236 |
] ifFalse:[ |
|
1237 |
inChangeSet ifTrue:[ |
|
1238 |
msg := msg , '\Attention:\Load will undo your changes made to the image (if any were made);'. |
|
1239 |
]. |
|
1240 |
msg := msg , '\Merge will only load methods which are not present in the image (i.e. undo removals but preserve changes).'. |
|
1241 |
]. |
|
1242 |
] |
|
1243 |
] ifFalse:[ |
|
1244 |
onlyInRep isEmpty ifTrue:[ |
|
1245 |
inChangeSet ifTrue:[ |
|
1246 |
msg := msg , '\Attention:\Load will undo your changes made to the image (if any were made),'. |
|
1247 |
msg := msg , '\and remove added methods which are not present in the repository version.'. |
|
1248 |
]. |
|
1249 |
labels := #('Cancel' 'Load'). |
|
1250 |
values := #(nil #load). |
|
1251 |
default := askForRevision |
|
1252 |
ifTrue:[2. "i.e. load"] |
|
1253 |
ifFalse:[1. "i.e. cancel"]. |
|
1254 |
] ifFalse:[ |
|
1255 |
inChangeSet ifTrue:[ |
|
1256 |
msg := msg , '\Attention:\Load will undo your changes made to the image (if any were made);'. |
|
1257 |
msg := msg , '\Merge will only load methods which are not present in the image (i.e. undo removals but preserve changes).'. |
|
1258 |
] |
|
1259 |
] |
|
1260 |
]. |
|
1261 |
||
1262 |
msg := msg bindWith:onlyInRep size printString |
|
1263 |
with:onlyHere size printString |
|
1264 |
with:changed size printString |
|
1265 |
with:singleChangeSelector |
|
1266 |
with:packageToCheckOut allBold. |
|
1267 |
||
1268 |
answer := (Dialog confirmWithCancel:msg withCRs |
|
1269 |
labels:(resources array:labels) |
|
1270 |
values:values |
|
1271 |
default:default). |
|
1272 |
answer isNil ifTrue:[^ self]. |
|
1273 |
||
1274 |
self activityNotification:'updating...'. |
|
1275 |
changedClasses := IdentitySet new. |
|
1276 |
||
1277 |
"/ Class withoutUpdatingChangesDo:[ |
|
1278 |
onlyInRep do:[:eachChange | "apply this change (method only present in rep-version)" |
|
1279 |
Class withoutUpdatingChangeSetDo:[ eachChange apply ]. |
|
1280 |
||
1281 |
eachChange changeMethod setPackage:packageToCheckOut. |
|
1282 |
changedClasses add:eachChange changeClass. |
|
1283 |
]. |
|
1284 |
answer == #load ifTrue:[ |
|
1285 |
onlyHere do:[:eachChange | "remove this change (method not present in rep-version)" |
|
1286 |
|cClass cSel| |
|
1287 |
||
1288 |
cClass := eachChange changeClass. |
|
1289 |
cSel := eachChange selector. |
|
1290 |
Class withoutUpdatingChangeSetDo:[ cClass removeSelector:cSel ]. |
|
1291 |
]. |
|
1292 |
changed do:[:eachChangeArr | "apply this change (go to rep-version)" |
|
1293 |
|cHere cRep| |
|
1294 |
cHere := eachChangeArr at:1. |
|
1295 |
cRep := eachChangeArr at:2. |
|
1296 |
Class withoutUpdatingChangeSetDo:[ cRep apply ]. |
|
1297 |
||
1298 |
cRep changeMethod setPackage:packageToCheckOut. |
|
1299 |
changedClasses add:cRep changeClass. |
|
1300 |
]. |
|
1301 |
]. |
|
1302 |
"/ ]. |
|
1303 |
changedClasses do:[:eachClass | |
|
1304 |
eachClass changed:#projectOrganization. |
|
1305 |
]. |
|
1306 |
Smalltalk changed:#projectOrganization. |
|
1307 |
||
1308 |
"Modified: / 07-02-2001 / 18:18:32 / ps" |
|
1309 |
"Created: / 10-08-2006 / 18:57:30 / cg" |
|
1841
00e5a67d1d9e
refactored & created changeSetForExtensions-utility
Claus Gittinger <cg@exept.de>
parents:
1840
diff
changeset
|
1310 |
"Modified: / 09-10-2006 / 13:06:43 / cg" |
1522 | 1311 |
! |
1312 |
||
957 | 1313 |
compareClassWithRepository:aClass |
1314 |
"open a diff-textView comparing the current (in-image) version |
|
1315 |
against its orgiginal version found in the repository." |
|
1316 |
||
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1317 |
self compareClassWithRepository:aClass askForRevision:true |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1318 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1319 |
" |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1320 |
self compareClassWithRepository:Array |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1321 |
" |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1322 |
! |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1323 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1324 |
compareClassWithRepository:aClass askForRevision:askForRevision |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1325 |
"open a diff-textView comparing the current (in-image) version |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1326 |
against its orgiginal version found in the repository." |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1327 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1328 |
|classToCompare resources brwsr |
1194 | 1329 |
aStream comparedSource currentSource rev revString thisRevString mgr |
1483 | 1330 |
nm msg revisionInClass newestRev versionsAreTheSame| |
957 | 1331 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1332 |
resources := self classResources. |
957 | 1333 |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1334 |
classToCompare := aClass theNonMetaclass. |
957 | 1335 |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1336 |
nm := classToCompare name. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1337 |
mgr := self sourceCodeManagerFor:classToCompare. |
957 | 1338 |
mgr isNil ifTrue:[ |
1339 |
^ self |
|
1340 |
]. |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1341 |
rev := classToCompare binaryRevision. |
1483 | 1342 |
revisionInClass := classToCompare revision. |
957 | 1343 |
rev isNil ifTrue:[ |
1483 | 1344 |
rev := revisionInClass |
957 | 1345 |
]. |
1346 |
rev isNil ifTrue:[ |
|
1483 | 1347 |
(Dialog confirm:'Class seems to be not yet in the repository (or classes revision info is corrupted)\\Proceed ?' withCRs) |
1348 |
ifFalse:[ |
|
1349 |
^ self |
|
1350 |
] |
|
957 | 1351 |
]. |
1352 |
||
1353 |
"/ |
|
1354 |
"/ class in repository - ask for revision |
|
1355 |
"/ |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1356 |
newestRev := mgr newestRevisionOf:classToCompare. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1357 |
askForRevision ifTrue:[ |
1466 | 1358 |
msg := resources string:'Compare to revision: (empty for newest)'. |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1359 |
rev notNil ifTrue:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1360 |
msg := msg , '\\' , (resources string:'Current %1 is based upon rev %2.' |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1361 |
with:nm allBold with:rev). |
1483 | 1362 |
(revisionInClass notNil and:[revisionInClass ~= rev]) ifTrue:[ |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1363 |
msg := msg , '\' , (resources string:'And has been checked into the repository as %1.' |
1483 | 1364 |
with:revisionInClass) |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1365 |
] |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1366 |
]. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1367 |
newestRev notNil ifTrue:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1368 |
msg := msg , '\' , (resources string:'Newest in reporitory is %1.' |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1369 |
with:newestRev) |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1370 |
]. |
957 | 1371 |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1372 |
rev := SourceCodeManagerUtilities |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1373 |
askForExistingRevision:msg |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1374 |
title:'Compare with repository' |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1375 |
class:classToCompare. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1376 |
] ifFalse:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1377 |
rev := newestRev. |
957 | 1378 |
]. |
1379 |
||
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 |
rev withoutSpaces isEmpty ifTrue:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1382 |
msg := 'extracting newest %1 (' , (newestRev ? '???') , ')'. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1383 |
"/ aStream := mgr getMostRecentSourceStreamForClassNamed:nm. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1384 |
aStream := mgr getSourceStreamFor:classToCompare revision:newestRev. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1385 |
revString := '(newest: ' , (newestRev ? '???') , ')'. |
957 | 1386 |
] ifFalse:[ |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1387 |
msg := 'extracting previous %1'. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1388 |
aStream := mgr getSourceStreamFor:classToCompare revision:rev. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1389 |
revString := rev |
957 | 1390 |
]. |
1391 |
||
1392 |
aStream isNil ifTrue:[ |
|
1393 |
self warn:'could not extract source from repository'. |
|
1394 |
^ self |
|
1395 |
]. |
|
1396 |
aStream class readErrorSignal handle:[:ex | |
|
1245 | 1397 |
self warn:('read error while reading extracted source\\' , ex description) withCRs. |
957 | 1398 |
aStream close. |
1399 |
^ self |
|
1400 |
] do:[ |
|
1401 |
comparedSource := aStream contents asString. |
|
1402 |
]. |
|
1403 |
aStream close. |
|
1404 |
||
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1405 |
self activityNotification:'generating current source...'. |
957 | 1406 |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1407 |
currentSource := self sourceCodeOfClass:classToCompare. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1408 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1409 |
self activityNotification:'comparing...'. |
957 | 1410 |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1411 |
versionsAreTheSame := false. |
957 | 1412 |
comparedSource = currentSource ifTrue:[ |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1413 |
versionsAreTheSame := true. |
957 | 1414 |
] ifFalse:[ |
1483 | 1415 |
thisRevString := revisionInClass ? 'no revision'. |
957 | 1416 |
|
1417 |
revString = '(newest)' ifTrue:[ |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1418 |
(rev := mgr newestRevisionOf:classToCompare) notNil ifTrue:[ |
957 | 1419 |
revString := '(newest is ' , rev , ')' |
1420 |
] |
|
1421 |
]. |
|
1422 |
||
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1423 |
self activityNotification:'comparing...'. |
957 | 1424 |
|
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1425 |
brwsr := (UserPreferences versionDiffViewerClass) |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1426 |
openOnClass:classToCompare |
1877 | 1427 |
labelA:('Repository: ' , revString) |
957 | 1428 |
sourceA:comparedSource |
1877 | 1429 |
labelB:('Current: (based on: ' , thisRevString , ')') |
957 | 1430 |
sourceB:currentSource |
1877 | 1431 |
title:('Comparing ' , classToCompare name) |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1432 |
ifSame:[versionsAreTheSame := true]. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1433 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1434 |
versionsAreTheSame ifFalse:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1435 |
brwsr classChangeSet |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1436 |
classBeingCompared:classToCompare; |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1437 |
versionA:rev; |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1438 |
versionB:rev , 'mod'. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1439 |
]. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1440 |
]. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1441 |
|
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1442 |
versionsAreTheSame ifTrue:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1443 |
(ChangeSet current includesChangeForClassOrMetaclassOrPrivateClassOf:classToCompare) ifTrue:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1444 |
(self confirm:(resources |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1445 |
stringWithCRs:'Versions of %1 are identical.\\Remove entries from changeSet ?' |
1864 | 1446 |
with:classToCompare name allBold)) ifTrue:[ |
1449
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1447 |
ChangeSet current condenseChangesForClass:classToCompare. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1448 |
]. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1449 |
] ifFalse:[ |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1450 |
self information:'Versions are identical.'. |
cfb2e98b9259
refactored (code duplication)
Claus Gittinger <cg@exept.de>
parents:
1433
diff
changeset
|
1451 |
ChangeSet current unrememberChangedClasses. |
1483 | 1452 |
]. |
1453 |
revisionInClass isNil ifTrue:[ |
|
1454 |
(Dialog confirm:'Update (Fix) the classes Revision Info ?' withCRs) |
|
1455 |
ifTrue:[ |
|
1497 | 1456 |
|newString root| |
1483 | 1457 |
|
1458 |
newString := mgr updatedRevisionStringOf:aClass forRevision:rev with:aClass revisionString. |
|
1497 | 1459 |
newString isNil ifTrue:[ |
1460 |
root := mgr getCVSROOTForModule:(aClass package upTo:$:). |
|
1461 |
root := mgr repositoryTopDirectoryFromCVSRoot:root. |
|
1500 | 1462 |
newString := '$', 'Header: ',(root copyReplaceAll: $: with:$/ ),'/' |
1911 | 1463 |
,(Smalltalk fileNameForClass:aClass),'.st,v ',rev,' ' |
1497 | 1464 |
,(Date today printStringFormat:'%y/%m/%d'),' ' |
1465 |
,(Time now printStringFormat:'%h/%m/%s'),' ' |
|
1466 |
,(OperatingSystem getLoginName),' Exp $'. |
|
1467 |
]. |
|
1483 | 1468 |
aClass updateVersionMethodFor:newString. |
1469 |
] |
|
1470 |
]. |
|
957 | 1471 |
]. |
1472 |
]. |
|
1473 |
||
1474 |
" |
|
997 | 1475 |
self compareClassWithRepository:Array |
957 | 1476 |
" |
1497 | 1477 |
|
1911 | 1478 |
"Modified: / 20-11-2006 / 22:26:54 / cg" |
957 | 1479 |
! |
1480 |
||
1875
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1481 |
compareProjectWithRepository:aProject |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1482 |
|classesInImage filesInImage module directory perProjectInfo |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1483 |
classesNotInRepository filesNotInImage classesDeletedInRepository |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1484 |
classesModifiedInImage classesNotReallyModified classesReallyModified classesModifiedInRepository |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1485 |
classesDeletedInImage classesAddedInImage |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1486 |
extensionsInImage extensionsInRepository extensionDiffs |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1487 |
anyDifference box doRemove doCleanup classDefs changeSets filePerClassDefintion |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1488 |
classesToCheckIn resources diffSet def autoloadedFilesNotInImage| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1489 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1490 |
resources := self classResources. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1491 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1492 |
module := aProject asPackageId module. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1493 |
directory := aProject asPackageId directory. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1494 |
perProjectInfo := SourceCodeManager newestRevisionsInModule:module directory:directory. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1495 |
perProjectInfo := perProjectInfo ? #(). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1496 |
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
|
1497 |
perProjectInfo := Dictionary withAssociations:perProjectInfo. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1498 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1499 |
classesInImage := Smalltalk allClassesInPackage:aProject. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1500 |
classesInImage := classesInImage reject:[:cls | cls isPrivate]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1501 |
filesInImage := (classesInImage collect:[:cls | cls classBaseFilename]) asSet. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1502 |
"/ any differences ? |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1503 |
classesNotInRepository := classesInImage reject:[:cls | (perProjectInfo includesKey:cls classBaseFilename)]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1504 |
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
|
1505 |
perProjectInfo := perProjectInfo reject:[:v | v == #deleted]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1506 |
filesNotInImage := perProjectInfo keys reject:[:file | (filesInImage includes:file)]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1507 |
filesNotInImage remove:'extensions.st' ifAbsent:[]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1508 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1509 |
classesModifiedInImage := classesInImage select:[:cls |ChangeSet current includesChangeForClassOrMetaclass:cls]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1510 |
classesModifiedInImage := classesModifiedInImage \ classesNotInRepository. |
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 |
classesModifiedInRepository := classesInImage select:[:cls | |v| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1513 |
v := (perProjectInfo at:cls classBaseFilename ifAbsent:nil). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1514 |
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
|
1515 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1516 |
"/ 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
|
1517 |
"/ 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
|
1518 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1519 |
extensionsInImage := OrderedCollection new. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1520 |
Smalltalk allClasses do:[:eachClass | |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1521 |
extensionsInImage addAll:(eachClass extensionsFrom:aProject) |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1522 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1523 |
extensionsInImage := ChangeSet forExistingMethods:extensionsInImage. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1524 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1525 |
[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1526 |
|s| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1527 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1528 |
s := SourceCodeManager |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1529 |
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
|
1530 |
s isNil ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1531 |
extensionsInRepository := ChangeSet new. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1532 |
] ifFalse:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1533 |
extensionsInRepository := ChangeSet fromStream:s. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1534 |
s close. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1535 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1536 |
] value. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1537 |
extensionDiffs := extensionsInRepository diffSetsAgainst:extensionsInImage. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1538 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1539 |
diffSet := extensionDiffs copy. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1540 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1541 |
"/ 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
|
1542 |
"/ 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
|
1543 |
"/ 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
|
1544 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1545 |
classesModifiedInImage notEmpty ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1546 |
classesReallyModified := |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1547 |
classesModifiedInImage select:[:eachChangedClass | |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1548 |
|currentVersion repositoryVersion s stFile diffs| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1549 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1550 |
stFile := eachChangedClass classBaseFilename. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1551 |
s := SourceCodeManager |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1552 |
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
|
1553 |
repositoryVersion := ChangeSet fromStream:s. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1554 |
s close. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1555 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1556 |
currentVersion := ChangeSet forExistingClass:eachChangedClass. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1557 |
diffs := repositoryVersion diffSetsAgainst:currentVersion . |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1558 |
diffSet addDiffSet:diffs. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1559 |
diffs notEmpty |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1560 |
]. |
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 |
classesNotReallyModified := classesModifiedInImage \ classesReallyModified. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1563 |
]. |
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 |
filesNotInImage notEmpty ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1566 |
"/ 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
|
1567 |
"/ (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
|
1568 |
autoloadedFilesNotInImage := OrderedCollection new. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1569 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1570 |
def := ProjectDefinition definitionClassForPackage:aProject createIfAbsent:false projectType:nil. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1571 |
def notNil ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1572 |
def classNamesAndAttributesDo:[:eachClassname :eachAttributes | |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1573 |
|cls eachFileName isAutoload| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1574 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1575 |
cls := Smalltalk classNamed:eachClassname. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1576 |
cls isNil ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1577 |
isAutoload := eachAttributes includes:#autoload. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1578 |
isAutoload ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1579 |
eachFileName := Smalltalk fileNameForClass:eachClassname. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1580 |
autoloadedFilesNotInImage add:(eachFileName , '.st') |
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 |
] |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1583 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1584 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1585 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1586 |
(filesNotInImage \ autoloadedFilesNotInImage) do:[:eachSTFile | |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1587 |
|s chgSet classDefinitions| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1588 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1589 |
s := SourceCodeManager |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1590 |
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
|
1591 |
chgSet := ChangeSet fromStream:s. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1592 |
s close. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1593 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1594 |
diffSet onlyInReceiver addAll:chgSet |
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 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1597 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1598 |
classesModifiedInRepository notEmpty ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1599 |
classesModifiedInRepository do:[:eachClass| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1600 |
|s diffs repositoryVersion currentVersion| |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1601 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1602 |
s := SourceCodeManager |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1603 |
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
|
1604 |
repositoryVersion := ChangeSet fromStream:s. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1605 |
s close. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1606 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1607 |
currentVersion := ChangeSet forExistingClass:eachClass. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1608 |
diffs := repositoryVersion diffSetsAgainst:currentVersion . |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1609 |
diffSet addDiffSet:diffs. |
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 |
classesDeletedInRepository notEmpty ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1613 |
self halt. |
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 |
classesNotInRepository notEmpty ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1616 |
"/ 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
|
1617 |
"/ no longer in the repository (possibly moved ?) |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1618 |
"/ 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
|
1619 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1620 |
classesAddedInImage := classesNotInRepository \ classesDeletedInRepository. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1621 |
classesAddedInImage do:[:eachAddedClass | |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1622 |
|currentVersion| |
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 |
currentVersion := ChangeSet forExistingClass:eachAddedClass. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1625 |
diffSet onlyInArg addAll:currentVersion. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1626 |
]. |
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 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1629 |
diffSet isEmpty ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1630 |
"/ 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
|
1631 |
Transcript showCR:('%1 is up-to-date.' bindWith:aProject allBold). |
1886 | 1632 |
(ChangeSet current includesChangeForPackage:aProject) ifTrue:[ |
1633 |
(Dialog confirm:('%1 is up-to-date.\\Cleanup ChangeSet ?' bindWith:aProject allBold) withCRs) ifTrue:[ |
|
1634 |
ChangeSet current condenseChangesForPackage:aProject. |
|
1635 |
]. |
|
1875
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 |
^ self. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1638 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1639 |
|
1886 | 1640 |
classesNotReallyModified notEmptyOrNil ifTrue:[ |
1875
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1641 |
self halt. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1642 |
doCleanup := false. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1643 |
box := Dialog |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1644 |
forRequestText:(resources |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1645 |
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
|
1646 |
with:aProject allBold) |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1647 |
editViewClass:ListView |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1648 |
lines:10 columns:20 |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1649 |
initialAnswer:nil model:nil |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1650 |
setupWith: |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1651 |
[:v :d | |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1652 |
|removeButton| |
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 |
v list:classesNotReallyModified. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1655 |
removeButton := Button label:(resources string:'Cleanup ChangeSet'). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1656 |
removeButton action:[ doCleanup := true. box okPressed. ]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1657 |
d addButton:removeButton after:(d okButton). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1658 |
d okButton label:(resources string:'Continue'). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1659 |
d okButton isReturnButton:false. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1660 |
removeButton isReturnButton:true. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1661 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1662 |
box open. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1663 |
box accepted ifFalse:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1664 |
^ self |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1665 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1666 |
doCleanup ifTrue:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1667 |
classesNotReallyModified do:[ |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1668 |
ChangeSet current condenseChangesForClass:classesNotReallyModified. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1669 |
] |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1670 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1671 |
]. |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1672 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1673 |
VersionDiffBrowser |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1674 |
openOnDiffSet:diffSet |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1675 |
labelA:'Repository' |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1676 |
labelB:'Image' |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1677 |
title:('Differences of %1' bindWith:aProject). |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1678 |
|
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1679 |
"Created: / 12-10-2006 / 21:44:54 / cg" |
1886 | 1680 |
"Modified: / 25-10-2006 / 18:08:21 / cg" |
1875
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1681 |
! |
f00eb53229ae
first attempt with compare-project functionality
Claus Gittinger <cg@exept.de>
parents:
1864
diff
changeset
|
1682 |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1683 |
createSourceContainerForClass:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1684 |
"let user specify the source-repository values for aClass" |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1685 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1686 |
|resources| |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1687 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1688 |
resources := self classResources. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1689 |
^ self |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1690 |
defineSourceContainerForClass:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1691 |
title:(resources string:'Repository information for %1' with:aClass name) |
1030 | 1692 |
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
|
1693 |
createDirectories:true |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1694 |
createContainer:true. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1695 |
! |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1696 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1697 |
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
|
1698 |
"let user specify the source-repository values for aClass" |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1699 |
|
1158 | 1700 |
| className |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1701 |
oldModule oldPackage oldFileName |
1533 | 1702 |
module directory fileName nameSpace nameSpacePrefix |
1158 | 1703 |
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
|
1704 |
answer doCheckinWithoutAsking forceCheckIn resources rslt note |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1705 |
requiredPackage| |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1706 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1707 |
resources := self classResources. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1708 |
aClass isLoaded ifFalse:[ |
1076 | 1709 |
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
|
1710 |
^ false. |
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 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1713 |
className := aClass name. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1714 |
|
1533 | 1715 |
aClass isProjectDefinition ifTrue:[ |
1716 |
"/ no way - their package is already known and fix. |
|
1717 |
module := aClass module. |
|
1718 |
directory := aClass moduleDirectory. |
|
1719 |
] ifFalse:[ |
|
1720 |
"/ |
|
1721 |
"/ defaults, if nothing at all is known |
|
1722 |
"/ |
|
1723 |
(module := LastModule) isNil ifTrue:[ |
|
1724 |
module := (OperatingSystem getLoginName). |
|
1725 |
]. |
|
1726 |
(directory := LastPackage) isNil ifTrue:[ |
|
1727 |
directory := 'private'. |
|
1728 |
]. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1729 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1730 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1731 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1732 |
"/ 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
|
1733 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1734 |
(Project notNil and:[(project := Project current) notNil]) ifTrue:[ |
1533 | 1735 |
directory isNil ifTrue:[ |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1736 |
(nm := project repositoryDirectory) isNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1737 |
nm := project name |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1738 |
]. |
1533 | 1739 |
directory := nm. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1740 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1741 |
module isNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1742 |
(nm := project repositoryModule) notNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1743 |
module := nm |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1744 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1745 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1746 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1747 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1748 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1749 |
"/ 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
|
1750 |
"/ if so, take that as a default. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1751 |
"/ |
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1752 |
mgr := self sourceCodeManagerFor:aClass. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1753 |
mgr isNil ifTrue:[ |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1754 |
^ false |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1755 |
]. |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1756 |
|
1368 | 1757 |
|
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
1758 |
info := mgr sourceInfoOfClass:aClass. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1759 |
info notNil ifTrue:[ |
1368 | 1760 |
true "module ~= LastModule" ifTrue:[ |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1761 |
(info includesKey:#module) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1762 |
module := (info at:#module). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1763 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1764 |
]. |
1401 | 1765 |
"/ true "package ~= LastPackage" ifTrue:[ |
1766 |
"/ (info includesKey:#directory) ifTrue:[ |
|
1767 |
"/ package := (info at:#directory). |
|
1768 |
"/ ]. |
|
1769 |
"/ ]. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1770 |
fileName := mgr containerFromSourceInfo:info. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1771 |
(nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1772 |
nameSpacePrefix := nameSpace name , '::'. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1773 |
(fileName startsWith:nameSpacePrefix) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1774 |
fileName := fileName copyFrom:(nameSpacePrefix size + 1). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1775 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1776 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1777 |
"/ (info includesKey:#fileName) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1778 |
"/ fileName := (info at:#fileName). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1779 |
"/ ] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1780 |
"/ (info includesKey:#expectedFileName) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1781 |
"/ fileName := (info at:#expectedFileName). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1782 |
"/ ] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1783 |
"/ (info includesKey:#classFileNameBase) ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1784 |
"/ fileName := (info at:#classFileNameBase) , '.st'. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1785 |
"/ ] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1786 |
"/ ] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1787 |
"/ ] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1788 |
]. |
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 |
fileName isNil ifTrue:[ |
1338 | 1791 |
fileName := (Smalltalk fileNameForClass:aClass) , '.st'. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1792 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1793 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1794 |
OperatingSystem isMSDOSlike ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1795 |
module replaceAll:$\ with:$/. |
1533 | 1796 |
directory replaceAll:$\ with:$/. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1797 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1798 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1799 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1800 |
"/ 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
|
1801 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1802 |
doCheckinWithoutAsking := false. |
1831
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1803 |
"/false ifTrue:[ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1804 |
"/ (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
|
1805 |
"/ answer := Dialog confirmWithCancel:(resources |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1806 |
"/ string:'About to change the source container. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1807 |
"/ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1808 |
"/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
|
1809 |
"/ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1810 |
"/ %2 / %3 / %4 |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1811 |
"/ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1812 |
"/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
|
1813 |
"/ with:className |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1814 |
"/ with:module |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1815 |
"/ with:directory |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1816 |
"/ with:fileName) |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1817 |
"/ labels:(resources array:#('Cancel' 'Check in' 'Change')). |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1818 |
"/ answer isNil ifTrue:[AbortSignal raise]. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1819 |
"/ answer ifTrue:[ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1820 |
"/ doCheckinWithoutAsking := false. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1821 |
"/ oldModule := module. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1822 |
"/ oldPackage := directory. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1823 |
"/ oldFileName := fileName |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1824 |
"/ ] ifFalse:[ |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1825 |
"/ doCheckinWithoutAsking := true. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1826 |
"/ creatingNew := false. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1827 |
"/ ]. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1828 |
"/ ]. |
cda120c93659
do not ask for changed source-container based on the default
sr
parents:
1828
diff
changeset
|
1829 |
"/]. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1830 |
doCheckinWithoutAsking ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1831 |
"/ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1832 |
"/ open a dialog for this |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1833 |
"/ |
1787 | 1834 |
(mgr checkForExistingContainer:fileName inModule:module directory:directory) ifFalse:[ |
893 | 1835 |
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
|
1836 |
creatingNew := true. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1837 |
] ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1838 |
creatingNew := false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1839 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1840 |
|
893 | 1841 |
rslt := self |
1842 |
askForContainer:boxText title:title note:note |
|
1533 | 1843 |
initialModule:module initialPackage:directory initialFileName:fileName |
1030 | 1844 |
forNewContainer:true. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1845 |
|
893 | 1846 |
rslt isNil ifTrue:[ |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1847 |
^ false |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1848 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1849 |
|
893 | 1850 |
module := rslt at:#module. |
1533 | 1851 |
directory := rslt at:#package. |
893 | 1852 |
fileName := rslt at:#fileName. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1853 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1854 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1855 |
(fileName endsWith:',v') ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1856 |
fileName := fileName copyWithoutLast:2 |
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 |
(fileName endsWith:'.st') ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1859 |
fileName := fileName , '.st' |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1860 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1861 |
|
952
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1862 |
"/ 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
|
1863 |
"/ check for this ... |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1864 |
|
1533 | 1865 |
requiredPackage := ((module ? '') , ':' , (directory ? '')) asSymbol. |
952
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1866 |
requiredPackage ~= aClass package ifTrue:[ |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1867 |
"/ doCheckinWithoutAsking ifFalse:[ |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1868 |
"/ (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
|
1869 |
"/ ifFalse:[ |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1870 |
"/ ^ false |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1871 |
"/ ] |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1872 |
"/ ]. |
1077
6b1bcfd27521
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
1076
diff
changeset
|
1873 |
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
|
1874 |
aClass package:requiredPackage. |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1875 |
]. |
c75976ac7b7f
when checking in initially, change packageID of class
Claus Gittinger <cg@exept.de>
parents:
937
diff
changeset
|
1876 |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1877 |
info := aClass revisionInfo. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1878 |
info notNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1879 |
(info includesKey:#repositoryPathName) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1880 |
info := nil |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1881 |
] |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1882 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1883 |
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
|
1884 |
true "doCheckinWithoutAsking" ifFalse:[ |
979 | 1885 |
answer := Dialog |
1886 |
confirmWithCancel:(resources string:'%1 does not have any (usable) revision info (#version method)\\Shall I create one ?' with:className) withCRs |
|
1076 | 1887 |
labels:(resources array:#( 'Cancel' 'No' 'Yes')). |
979 | 1888 |
answer isNil ifTrue:[^ false]. |
1889 |
] ifTrue:[ |
|
1890 |
answer := true. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1891 |
]. |
979 | 1892 |
answer ifTrue:[ |
1893 |
aClass updateVersionMethodFor:(mgr initialRevisionStringFor:aClass |
|
1894 |
inModule:module |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
1895 |
directory:directory |
979 | 1896 |
container:fileName). |
1897 |
]. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1898 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1899 |
|
1158 | 1900 |
(self checkForExistingModule:module using:mgr allowCreate:(createDirs or:[creatingNew])) |
1901 |
ifFalse:[^ false]. |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1902 |
LastModule := module. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1903 |
|
1704 | 1904 |
(self checkForExistingModule:module directory:directory using:mgr allowCreate:(createDirs or:[creatingNew])) |
1158 | 1905 |
ifFalse:[^ false]. |
1533 | 1906 |
LastPackage := directory. |
876
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 |
"/ check for the container itself |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1910 |
"/ |
1787 | 1911 |
(mgr checkForExistingContainer:fileName inModule:module directory:directory) ifTrue:[ |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1912 |
creatingNew ifTrue:[ |
1533 | 1913 |
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
|
1914 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1915 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1916 |
"/ (oldModule notNil |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1917 |
"/ and:[(oldModule ~= module) |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1918 |
"/ or:[oldPackage ~= package |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1919 |
"/ or:[oldFileName ~= fileName]]]) |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1920 |
"/ ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1921 |
"/ self warn:(resources string:'no change'). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1922 |
"/ ^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1923 |
"/ ]. |
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 |
doCheckinWithoutAsking ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1926 |
(Dialog |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1927 |
confirm:(resources string:'check %1 into the existing container |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1928 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1929 |
%2 / %3 / %4 ?' |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1930 |
with:className |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1931 |
with:module |
1533 | 1932 |
with:directory |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1933 |
with:fileName) withCRs |
1076 | 1934 |
noLabel:'Cancel') |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1935 |
ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1936 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1937 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1938 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1939 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1940 |
aClass updateVersionMethodFor:'$' , 'Header' , '$'. "/ concatenated to avoid RCS-expansion |
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 |
oldFileName notNil ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1943 |
msg := ('forced checkin / source container change from ' , oldFileName). |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1944 |
] ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1945 |
msg := 'defined source container' |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1946 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1947 |
|
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1948 |
(forceCheckIn := doCheckinWithoutAsking) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1949 |
(mgr |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1950 |
checkinClass:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1951 |
fileName:fileName |
1533 | 1952 |
directory:directory |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1953 |
module:module |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1954 |
logMessage:msg) |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1955 |
ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1956 |
doCheckinWithoutAsking ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1957 |
(Dialog |
1076 | 1958 |
confirm:'No easy merge seems possible; force checkin (no merge) ?' |
1959 |
noLabel:'Cancel') |
|
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1960 |
ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1961 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1962 |
]. |
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 |
forceCheckIn := true. |
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 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1967 |
forceCheckIn ifTrue:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1968 |
(mgr |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1969 |
checkinClass:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1970 |
fileName:fileName |
1533 | 1971 |
directory:directory |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1972 |
module:module |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1973 |
logMessage:msg |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1974 |
force:true) |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1975 |
ifFalse:[ |
1076 | 1976 |
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
|
1977 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1978 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1979 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1980 |
^ true |
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 |
(createContainer or:[creatingNew]) ifFalse:[ |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1983 |
(Dialog |
1076 | 1984 |
confirm:(resources string:'No container exists for %1 in %2/%3\\create ?' |
1533 | 1985 |
with:fileName with:module with:directory) withCRs |
1076 | 1986 |
noLabel:'Cancel') ifFalse:[ |
876
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 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1991 |
|
1882
8b3a4c2a2c2a
when creating a new container, set the package of all methods.
Claus Gittinger <cg@exept.de>
parents:
1879
diff
changeset
|
1992 |
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
|
1993 |
aClass package:requiredPackage. |
1911 | 1994 |
self halt. |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1995 |
(mgr |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1996 |
createContainerFor:aClass |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1997 |
inModule:module |
1533 | 1998 |
package:directory |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
1999 |
container:fileName) ifFalse:[ |
1076 | 2000 |
self warn:(resources string:'Failed to create container.'). |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2001 |
^ false. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2002 |
]. |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2003 |
^ true |
1533 | 2004 |
|
1911 | 2005 |
"Modified: / 20-11-2006 / 22:15:46 / cg" |
876
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2006 |
! |
461b86272f48
more functionality moved to SCMUtility
Claus Gittinger <cg@exept.de>
parents:
875
diff
changeset
|
2007 |
|
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2008 |
removeSourceContainerForClass:aClass |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2009 |
"show container & let user confirm twice." |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2010 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2011 |
^ self removeSourceContainerForClass:aClass confirm:true warn:true |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2012 |
! |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2013 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2014 |
removeSourceContainerForClass:aClass confirm:doConfirm warn:doWarn |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2015 |
"show container & optionally let user confirm twice." |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2016 |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2017 |
|module directory fileName info mgr resources| |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2018 |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2019 |
resources := self classResources. |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2020 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2021 |
aClass isLoaded ifFalse:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2022 |
doWarn ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2023 |
self warn:(resources string:'Please load the class first.'). |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2024 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2025 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2026 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2027 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2028 |
"/ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2029 |
"/ 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
|
2030 |
"/ if so, take that as a default. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2031 |
"/ |
1782 | 2032 |
mgr := self sourceCodeManagerFor:aClass. |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2033 |
mgr isNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2034 |
^ false |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2035 |
]. |
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 |
info := mgr sourceInfoOfClass:aClass. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2038 |
info notNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2039 |
(info includesKey:#module) ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2040 |
module := (info at:#module). |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2041 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2042 |
(info includesKey:#directory) ifTrue:[ |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2043 |
directory := (info at:#directory). |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2044 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2045 |
fileName := mgr containerFromSourceInfo:info. |
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 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2048 |
module isNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2049 |
doWarn ifTrue:[ |
1423 | 2050 |
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
|
2051 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2052 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2053 |
]. |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2054 |
directory isNil ifTrue:[ |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2055 |
doWarn ifTrue:[ |
1423 | 2056 |
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
|
2057 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2058 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2059 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2060 |
fileName isNil ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2061 |
doWarn ifTrue:[ |
1423 | 2062 |
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
|
2063 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2064 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2065 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2066 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2067 |
OperatingSystem isMSDOSlike ifTrue:[ |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2068 |
"cvs expects unix-filenames" |
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2069 |
module := module copy replaceAll:$\ with:$/. |
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2070 |
directory := directory copy replaceAll:$\ with:$/. |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2071 |
]. |
1787 | 2072 |
(mgr checkForExistingContainer:fileName inModule:module directory:directory) ifFalse:[ |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2073 |
doWarn ifTrue:[ |
1423 | 2074 |
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
|
2075 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2076 |
^ false. |
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 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2079 |
doConfirm ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2080 |
(Dialog |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2081 |
choose:(resources |
1423 | 2082 |
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
|
2083 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2084 |
container: %2 / %3 / %4 |
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 |
Really remove ?' |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2087 |
with:aClass name |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2088 |
with:module |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2089 |
with:directory |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2090 |
with:fileName) |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2091 |
labels:(Array |
1129 | 2092 |
with:(resources string:'No') |
2093 |
with:(resources string:'Remove')) |
|
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2094 |
values:#(false true) |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2095 |
default:false) ifFalse:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2096 |
^ false. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2097 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2098 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2099 |
|
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2100 |
(mgr removeContainerFor:aClass |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2101 |
inModule:module |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2102 |
package:directory |
976
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2103 |
container:fileName) ifFalse:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2104 |
doWarn ifTrue:[ |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2105 |
self warn:(resources string:'failed to remove container.'). |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2106 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2107 |
^ true. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2108 |
]. |
cedcdc7e405c
utitity to remove a container
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
2109 |
^ false |
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2110 |
|
1787 | 2111 |
"Modified: / 13-09-2006 / 18:25:48 / cg" |
1000 | 2112 |
! |
2113 |
||
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2114 |
repositoryLogOf:aClass onto:aStream |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2115 |
|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
|
2116 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2117 |
info := aClass revisionInfo. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2118 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2119 |
rv := aClass binaryRevision. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2120 |
rv notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2121 |
aStream nextPutLine:'**** Loaded classes binary information ****'; cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2122 |
aStream nextPutLine:' Binary based upon : ' , rv. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2123 |
aStream cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2124 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2125 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2126 |
info notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2127 |
(info includesKey:#revision) ifFalse:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2128 |
aStream nextPutLine:'WARNING:'; cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2129 |
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
|
2130 |
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
|
2131 |
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
|
2132 |
aStream cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2133 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2134 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2135 |
aStream nextPutLine:'**** Classes source information ****'; cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2136 |
s := info at:#repositoryPath ifAbsent:nil. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2137 |
s notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2138 |
aStream nextPutLine:' Source repository : ' , s |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2139 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2140 |
aStream nextPutLine:' Filename ........ : ' , (info at:#fileName ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2141 |
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
|
2142 |
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
|
2143 |
(info at:#time ifAbsent:'?'), ' ', |
2b2c6acdb53f
Take care of timezone information in header strings
Stefan Vogel <sv@exept.de>
parents:
1460
diff
changeset
|
2144 |
(info at:#timezone ifAbsent:''). |
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2145 |
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
|
2146 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2147 |
(info2 := aClass packageSourceCodeInfo) notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2148 |
aStream nextPutLine:' Repository: ..... : ' , (info2 at:#module ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2149 |
aStream nextPutLine:' Directory: ...... : ' , (info2 at:#directory ifAbsent:'?'). |
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 |
aStream nextPutLine:' Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?'). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2152 |
aStream cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2153 |
|
1782 | 2154 |
mgr := self sourceCodeManagerFor:aClass. |
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2155 |
mgr notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2156 |
aStream nextPutLine:'**** Repository information ****'; cr. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2157 |
|
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2158 |
module := info2 at:#module ifAbsent:nil. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2159 |
module notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2160 |
aStream nextPutLine:(' CVS Root ......: ' , |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2161 |
((mgr repositoryNameForModule:module) ifNil:[mgr repositoryName , ' (default)'])). |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2162 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2163 |
mgr writeRevisionLogOf:aClass to:aStream. |
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 |
] ifFalse:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2166 |
aStream nextPutLine:'No revision info found'. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2167 |
aClass isLoaded ifFalse:[ |
1835 | 2168 |
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
|
2169 |
] ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2170 |
fn := aClass classFilename. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2171 |
aClass wasAutoloaded ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2172 |
msg := 'This class was autoloaded.'. |
1514 | 2173 |
msg := msg , ' (from ''' , fn , ''')'. |
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2174 |
] ifFalse:[ |
1514 | 2175 |
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
|
2176 |
]. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2177 |
msg notNil ifTrue:[ |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2178 |
aStream cr; nextPutAll:msg. |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2179 |
] |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2180 |
] |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2181 |
] |
1782 | 2182 |
|
1835 | 2183 |
"Modified: / 06-10-2006 / 13:25:22 / cg" |
1726 | 2184 |
! |
2185 |
||
2186 |
tagClass:aClass as:tag |
|
2187 |
|mgr| |
|
2188 |
||
2189 |
mgr := self sourceCodeManagerFor:aClass. |
|
1782 | 2190 |
mgr |
2191 |
setSymbolicName:tag |
|
2192 |
revision:nil |
|
2193 |
overWrite:true |
|
2194 |
class:aClass. |
|
2195 |
||
2196 |
"Modified: / 12-09-2006 / 13:03:59 / cg" |
|
2197 |
! |
|
2198 |
||
2199 |
tagClasses:aCollectionOfClasses as:tag |
|
2200 |
|classesPerManager| |
|
2201 |
||
2202 |
classesPerManager := Dictionary new. |
|
2203 |
aCollectionOfClasses |
|
2204 |
do:[:eachClass | |
|
2205 |
|manager| |
|
2206 |
||
2207 |
manager := self sourceCodeManagerFor:eachClass. |
|
2208 |
(classesPerManager at:manager ifAbsentPut:[Set new]) add:eachClass |
|
2209 |
]. |
|
2210 |
||
2211 |
classesPerManager keysAndValuesDo:[:manager :classesPerManager| |
|
2212 |
manager |
|
2213 |
setSymbolicName:tag |
|
2214 |
revision:nil |
|
2215 |
overWrite:true |
|
2216 |
classes:classesPerManager. |
|
2217 |
]. |
|
1726 | 2218 |
^ true |
1782 | 2219 |
|
2220 |
"Created: / 12-09-2006 / 13:04:29 / cg" |
|
1726 | 2221 |
! |
2222 |
||
2223 |
tagPath:aPath as:tag using:aManager |
|
1782 | 2224 |
aManager |
2225 |
setSymbolicName:tag |
|
1726 | 2226 |
revision:nil |
2227 |
overWrite:true |
|
2228 |
path:aPath. |
|
1782 | 2229 |
|
2230 |
"Modified: / 12-09-2006 / 12:04:44 / cg" |
|
1375 | 2231 |
! ! |
2232 |
||
2233 |
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-helpers'! |
|
2234 |
||
2235 |
getMethodVersionsOfClass:aClass selector:selector numberOfRevisions:numberOfRevisionsOrNil |
|
2236 |
"check-out all previous versions of aClass and retrieve the history of selector. |
|
2237 |
Return a dictionary associating revision with a changeList entries for that method. |
|
2238 |
Unfinished - need a GUI for that." |
|
2239 |
||
2240 |
|mgr theClass revisionLog revisions items s entriesPerRevision previousVersion| |
|
2241 |
||
2242 |
theClass := aClass theNonMetaclass. |
|
2243 |
||
2244 |
mgr := self sourceCodeManagerFor:theClass. |
|
2245 |
mgr isNil ifTrue:[ |
|
2246 |
self error:'no sourceCodeManager'. |
|
2247 |
]. |
|
2248 |
||
2249 |
revisionLog := mgr |
|
2250 |
revisionLogOf:theClass |
|
2251 |
numberOfRevisions:numberOfRevisionsOrNil. |
|
2252 |
||
2253 |
revisions := revisionLog at:#revisions. |
|
2254 |
items := revisions collect:[:each | |rev date who| |
|
2255 |
rev := each at:#revision. |
|
2256 |
date := each at:#date. |
|
2257 |
who := each at:#author. |
|
2258 |
rev allBold , ' [' , date , ' by ' , who , ']' |
|
2259 |
]. |
|
2260 |
||
2261 |
revisions := revisions collect:[:each | each at:#revision]. |
|
2262 |
revisions addFirst:#current. |
|
2263 |
entriesPerRevision := Dictionary new. |
|
2264 |
||
2265 |
previousVersion := nil. |
|
2266 |
revisions reverseDo:[:eachRevision | |
|
2267 |
|srcStream entries thisVersion| |
|
2268 |
||
2269 |
eachRevision == #current ifTrue:[ |
|
2270 |
s := '' writeStream. |
|
2271 |
theClass fileOutOn:s withTimeStamp:false. |
|
2272 |
srcStream := s contents readStream. |
|
2273 |
] ifFalse:[ |
|
2274 |
self activityNotification:('checking out revision ' , eachRevision , '...'). |
|
2275 |
srcStream := mgr getSourceStreamFor:theClass revision:eachRevision. |
|
2276 |
]. |
|
2277 |
||
2278 |
entries := ChangeSet fromStream:srcStream. |
|
2279 |
srcStream close. |
|
2280 |
||
2281 |
"/ remove all definitions |
|
2282 |
entries := entries select:[:each | each isMethodChange]. |
|
2283 |
"/ remove all methods which are for other selectors |
|
2284 |
entries := entries select:[:each | each selector == selector]. |
|
2285 |
"/ remove all methods which are for private subclasses |
|
2286 |
entries := entries select:[:each | each className = aClass name]. |
|
2287 |
||
2288 |
entries size == 1 ifTrue:[ |
|
2289 |
"/ the method is there |
|
2290 |
thisVersion := entries first. |
|
2291 |
(previousVersion notNil and:[previousVersion sameAs:thisVersion]) ifTrue:[ |
|
2292 |
"/ no change |
|
2293 |
] ifFalse:[ |
|
2294 |
entriesPerRevision at:eachRevision put:thisVersion. |
|
2295 |
]. |
|
2296 |
] ifFalse:[ |
|
2297 |
"/ the method is not there |
|
2298 |
]. |
|
2299 |
previousVersion := thisVersion. |
|
2300 |
]. |
|
2301 |
self error:'unfinished code'. |
|
2302 |
||
2303 |
" |
|
2304 |
self getMethodVersionsOfClass:MenuPanel selector:#'helpTextForItem:' numberOfRevisions:20 |
|
2305 |
self getMethodVersionsOfClass:NewLauncher class selector:#'menu' numberOfRevisions:20 |
|
2306 |
" |
|
2307 |
! ! |
|
2308 |
||
2309 |
!SourceCodeManagerUtilities class methodsFor:'utilities-cvs-user interaction'! |
|
2310 |
||
2311 |
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName |
|
2312 |
"open a dialog asking for a source container; |
|
2313 |
return a dictionary containing module, package and filename, |
|
2314 |
or nil if canceled." |
|
2315 |
||
2316 |
^ self |
|
2317 |
askForContainer:boxText title:title note:notice |
|
2318 |
initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName |
|
2319 |
forNewContainer:true |
|
1026
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2320 |
! |
1f193eb5f877
common code (in Browser, NewBrowser) for revisionLogOf
Claus Gittinger <cg@exept.de>
parents:
1022
diff
changeset
|
2321 |
|
1375 | 2322 |
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName forNewContainer:forNewContainer |
2323 |
"open a dialog asking for a source container; |
|
2324 |
return a dictionary containing module, package and filename, |
|
2325 |
or nil if canceled." |
|
2326 |
||
2327 |
|box y component resources answer |
|
2328 |
moduleHolder packageHolder fileNameHolder |
|
2329 |
module package fileName |
|
2330 |
knownContainers knownPackages packageUpdater |
|
2331 |
packageBoxComponent fileNameBoxComponent fileNameUpdater| |
|
2332 |
||
2333 |
knownContainers := Set new. |
|
2334 |
Smalltalk allClassesDo:[:cls | |pckg| |
|
2335 |
pckg := cls package. |
|
2336 |
pckg size > 0 ifTrue:[ |
|
2337 |
knownContainers add:(pckg upTo:$:) |
|
2338 |
] |
|
2339 |
]. |
|
2340 |
knownContainers := knownContainers asOrderedCollection. |
|
2341 |
knownContainers := knownContainers select:[:module | module isBlank not]. |
|
2342 |
knownContainers sort. |
|
2343 |
||
2344 |
packageUpdater := [ |
|
2345 |
|theModulePrefix| |
|
2346 |
||
2347 |
theModulePrefix := moduleHolder value , ':'. |
|
2348 |
||
2349 |
Cursor wait showWhile:[ |
|
2350 |
knownPackages := Set new. |
|
2351 |
Smalltalk allClassesDo:[:cls | |pckg idx| |
|
2352 |
pckg := cls package. |
|
2353 |
pckg size > 0 ifTrue:[ |
|
2354 |
(pckg startsWith:theModulePrefix) ifTrue:[ |
|
2355 |
idx := pckg indexOf:$:. |
|
2356 |
knownPackages add:(pckg copyFrom:idx + 1) |
|
2357 |
] |
|
2358 |
] |
|
2359 |
]. |
|
2360 |
knownPackages := knownPackages asOrderedCollection. |
|
2361 |
knownPackages := knownPackages select:[:package | package isBlank not]. |
|
2362 |
knownPackages sort. |
|
2363 |
packageBoxComponent list:knownPackages. |
|
2364 |
]. |
|
2365 |
]. |
|
2366 |
||
2367 |
fileNameUpdater := [ |
|
2368 |
|module package files| |
|
2369 |
||
2370 |
Cursor read showWhile:[ |
|
1671 | 2371 |
module := moduleHolder value ? (Project noProjectID). |
2372 |
package := packageHolder value ? (Project noProjectID). |
|
1375 | 2373 |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2374 |
files := SourceCodeManager getExistingContainersInModule:module directory:package. |
1375 | 2375 |
files := files asOrderedCollection. |
2376 |
files := files select:[:eachFile | eachFile asFilename hasSuffix:'st']. |
|
2377 |
files sort. |
|
2378 |
fileNameBoxComponent list:files. |
|
2379 |
]. |
|
2380 |
]. |
|
2381 |
||
2382 |
moduleHolder := initialModule asValue. |
|
2383 |
packageHolder := initialPackage asValue. |
|
2384 |
fileNameHolder := initialFileName asValue. |
|
2385 |
||
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2386 |
resources := self classResources. |
1375 | 2387 |
|
2388 |
"/ |
|
2389 |
"/ open a dialog for this |
|
2390 |
"/ |
|
2391 |
box := DialogBox new. |
|
2392 |
box label:title. |
|
2393 |
||
2394 |
component := box addTextLabel:boxText withCRs. |
|
2395 |
component adjust:#left; borderWidth:0. |
|
2396 |
box addVerticalSpace. |
|
2397 |
box addVerticalSpace. |
|
1000 | 2398 |
|
1375 | 2399 |
y := box yPosition. |
2400 |
component := box addTextLabel:(resources string:'Module:'). |
|
2401 |
component width:0.4; adjust:#right. |
|
2402 |
box yPosition:y. |
|
2403 |
component := box addComboBoxOn:moduleHolder tabable:true. |
|
2404 |
component list:knownContainers. |
|
2405 |
||
2406 |
"/ component := box addInputFieldOn:moduleHolder tabable:true. |
|
2407 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
2408 |
||
2409 |
box addVerticalSpace. |
|
2410 |
y := box yPosition. |
|
2411 |
component := box addTextLabel:(resources string:'Package:'). |
|
2412 |
component width:0.4; adjust:#right. |
|
2413 |
box yPosition:y. |
|
2414 |
packageBoxComponent := component := box addComboBoxOn:packageHolder tabable:true. |
|
2415 |
"/ component := box addInputFieldOn:packageHolder tabable:true. |
|
2416 |
component width:0.6; left:0.4; "immediateAccept:true; "acceptOnLeave:true; cursorMovementWhenUpdating:#beginOfLine. |
|
2417 |
packageUpdater value. |
|
2418 |
moduleHolder onChangeEvaluate:packageUpdater. |
|
2419 |
||
2420 |
box addVerticalSpace. |
|
2421 |
y := box yPosition. |
|
2422 |
component := box addTextLabel:(resources string:'Filename:'). |
|
2423 |
component width:0.4; adjust:#right. |
|
2424 |
box yPosition:y. |
|
2425 |
||
2426 |
forNewContainer ifTrue:[ |
|
2427 |
component := box addInputFieldOn:fileNameHolder tabable:true. |
|
2428 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
2429 |
] ifFalse:[ |
|
2430 |
fileNameBoxComponent := component := box addComboBoxOn:fileNameHolder tabable:true. |
|
2431 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
2432 |
fileNameUpdater value. |
|
2433 |
packageHolder onChangeEvaluate:fileNameUpdater. |
|
2434 |
]. |
|
2435 |
||
2436 |
box addVerticalSpace. |
|
2437 |
||
2438 |
notice notNil ifTrue:[ |
|
2439 |
component := box addTextLabel:notice. |
|
2440 |
component adjust:#left; borderWidth:0. |
|
2441 |
]. |
|
2442 |
||
2443 |
box addVerticalSpace. |
|
2444 |
box addAbortAndOkButtons. |
|
2445 |
||
2446 |
(YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[ |
|
2447 |
component := Button label:'Yes to all'. |
|
2448 |
component action:[ |
|
2449 |
YesToAllNotification queryWith:true. |
|
2450 |
box doAccept. |
|
2451 |
]. |
|
2452 |
(DialogBox defaultOKButtonAtLeft) ifTrue:[ |
|
2453 |
box addButton:component after:nil. |
|
2454 |
] ifFalse:[ |
|
2455 |
box addButton:component before:nil. |
|
2456 |
]. |
|
2457 |
]. |
|
2458 |
(AbortAllSignal isHandled) ifTrue:[ |
|
2459 |
component := Button label:'Cancel all'. |
|
2460 |
component action:[ |
|
2461 |
box hide. |
|
2462 |
AbortAllSignal raiseSignal. |
|
2463 |
]. |
|
2464 |
(DialogBox defaultOKButtonAtLeft) ifTrue:[ |
|
2465 |
box addButton:component before:nil. |
|
2466 |
] ifFalse:[ |
|
2467 |
box addButton:component after:nil. |
|
2468 |
]. |
|
2469 |
]. |
|
2470 |
||
2471 |
(YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[ |
|
2472 |
answer := YesToAllQuery query. |
|
2473 |
]. |
|
2474 |
||
2475 |
answer isNil ifTrue:[ |
|
2476 |
box showAtPointer. |
|
2477 |
answer := box accepted |
|
2478 |
]. |
|
2479 |
||
2480 |
box destroy. |
|
2481 |
answer ifFalse:[ |
|
2482 |
^ nil |
|
2483 |
]. |
|
1000 | 2484 |
|
1375 | 2485 |
module := moduleHolder value withoutSpaces. |
2486 |
package := packageHolder value withoutSpaces. |
|
2487 |
fileName := fileNameHolder value withoutSpaces. |
|
2488 |
^ Dictionary new |
|
2489 |
at:#module put:module; |
|
2490 |
at:#package put:package; |
|
2491 |
at:#fileName put:fileName; |
|
2492 |
yourself |
|
2493 |
||
2494 |
" |
|
2495 |
self |
|
2496 |
askForContainer:'enter container' title:'container' note:'some note' |
|
2497 |
initialModule:'foo' initialPackage:'bar' initialFileName:'baz' |
|
2498 |
" |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2499 |
|
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2500 |
"Modified: / 23-08-2006 / 14:13:04 / cg" |
1375 | 2501 |
! |
2502 |
||
2503 |
askForExistingRevision:boxText title:title class:aClass |
|
2504 |
"open a dialog asking for a containers revision; |
|
2505 |
return a revision number, or nil if canceled." |
|
2506 |
||
2507 |
|mgr sourceInfo module package fileName| |
|
2508 |
||
1782 | 2509 |
mgr := self sourceCodeManagerFor:aClass. |
1375 | 2510 |
sourceInfo := mgr sourceInfoOfClass:aClass. |
2511 |
sourceInfo isNil ifTrue:[^ nil]. |
|
2512 |
||
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2513 |
package := mgr directoryFromSourceInfo:sourceInfo. |
1375 | 2514 |
module := mgr moduleFromSourceInfo:sourceInfo. |
2515 |
fileName := mgr containerFromSourceInfo:sourceInfo. |
|
2516 |
^ self |
|
2517 |
askForExistingRevision:boxText |
|
2518 |
title:title |
|
2519 |
class:aClass |
|
2520 |
manager:mgr |
|
2521 |
module:module package:package fileName:fileName |
|
2522 |
||
2523 |
" |
|
2524 |
SourceCodeManagerUtilities |
|
2525 |
askForRevisionToCompare:'enter revision' |
|
2526 |
title:'revision' |
|
2527 |
class:Array |
|
2528 |
" |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2529 |
|
1782 | 2530 |
"Modified: / 12-09-2006 / 14:17:04 / cg" |
1375 | 2531 |
! |
2532 |
||
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2533 |
askForExistingRevision:boxText title:title class:clsOrNil manager:aSourceCodeManager module:module package:directory fileName:fileName |
1375 | 2534 |
"open a dialog asking for a containers revision; |
2535 |
return a revision number, or nil if canceled." |
|
2536 |
||
2537 |
|partialLog revisions items newestRev |
|
2538 |
box y component resources |
|
1456
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2539 |
revisionHolder symbolicNames stableRevision releasedRevision| |
1375 | 2540 |
|
2541 |
partialLog := aSourceCodeManager |
|
2542 |
revisionLogOf:clsOrNil |
|
2543 |
numberOfRevisions:20 |
|
2544 |
fileName:fileName |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2545 |
directory:directory |
1375 | 2546 |
module:module. |
1522 | 2547 |
|
1375 | 2548 |
partialLog notNil ifTrue:[ |
2549 |
newestRev := partialLog at:#newestRevision. |
|
2550 |
revisions := partialLog at:#revisions. |
|
1456
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2551 |
symbolicNames := partialLog at:#symbolicNames ifAbsent:[]. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2552 |
symbolicNames notNil ifTrue:[ |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2553 |
stableRevision := symbolicNames at:'stable' ifAbsent:[]. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2554 |
releasedRevision := symbolicNames at:'released' ifAbsent:[]. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2555 |
]. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2556 |
|
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2557 |
items := revisions collect:[:each | |rev date who flag| |
1375 | 2558 |
rev := each at:#revision. |
2559 |
date := each at:#date. |
|
2560 |
who := each at:#author. |
|
1456
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2561 |
rev = stableRevision ifTrue:[ |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2562 |
flag := ' Stable' allBold. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2563 |
] ifFalse:[rev = releasedRevision ifTrue:[ |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2564 |
flag := ' Released' allBold. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2565 |
] ifFalse:[ |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2566 |
flag := ' ' |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2567 |
]]. |
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2568 |
rev allBold , flag, ' [' , date , ' by ' , who , ']' |
1375 | 2569 |
]. |
2570 |
revisions := revisions collect:[:each | each at:#revision]. |
|
2571 |
] ifFalse:[ |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2572 |
newestRev := aSourceCodeManager newestRevisionInFile:fileName directory:directory module:module. |
1375 | 2573 |
revisions := items := nil. |
2574 |
||
2575 |
newestRev isNil ifTrue:[ |
|
1787 | 2576 |
(aSourceCodeManager checkForExistingContainer:fileName inModule:module directory:directory) |
1375 | 2577 |
ifFalse:[ |
2578 |
self warn:'Could not find/access the container for ',fileName,' in the repository. |
|
2579 |
This could be due to: |
|
2580 |
- invalid/wrong CVS-Root setting |
|
2581 |
- missing CVS access rights |
|
2582 |
(no access / not logged in) |
|
2583 |
- changed CVSRoot after compilation |
|
2584 |
(i.e. wrong CVS-path in classes version method) |
|
2585 |
'. |
|
2586 |
^ nil |
|
2587 |
] |
|
2588 |
] |
|
2589 |
]. |
|
2590 |
revisionHolder := newestRev asValue. |
|
1377
0fd99dd003f6
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2591 |
resources := self classResources. |
1375 | 2592 |
|
2593 |
revisionHolder onChangeEvaluate:[ |
|
2594 |
"/ cut off everything after revision |
|
2595 |
|s first words| |
|
2596 |
||
2597 |
s := revisionHolder value. |
|
2598 |
words := s asCollectionOfWords. |
|
2599 |
words size > 0 ifTrue:[ |
|
2600 |
first := words first string. |
|
2601 |
first ~= s ifTrue:[ |
|
2602 |
revisionHolder value:first |
|
2603 |
] |
|
2604 |
] |
|
2605 |
]. |
|
2606 |
||
2607 |
"/ |
|
2608 |
"/ open a dialog for this |
|
2609 |
"/ |
|
2610 |
box := DialogBox new. |
|
2611 |
box label:title. |
|
2612 |
||
2613 |
component := box addTextLabel:boxText withCRs. |
|
2614 |
component adjust:#left; borderWidth:0. |
|
2615 |
box addVerticalSpace. |
|
2616 |
box addVerticalSpace. |
|
2617 |
||
2618 |
y := box yPosition. |
|
2619 |
component := box addTextLabel:(resources string:'Revision:'). |
|
2620 |
component width:0.4; adjust:#right. |
|
2621 |
box yPosition:y. |
|
2622 |
component := box addComboBoxOn:revisionHolder tabable:true. |
|
2623 |
component list:items. |
|
2624 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
2625 |
||
2626 |
box addVerticalSpace. |
|
2627 |
||
2628 |
box addAbortAndOkButtons. |
|
2629 |
||
2630 |
Object abortAllSignal isHandled ifTrue:[ |
|
2631 |
(box addAbortButtonLabelled:'Cancel all') action:[AbortAllSignal raise]. |
|
2632 |
]. |
|
2633 |
||
2634 |
box showAtPointer. |
|
2635 |
||
2636 |
box accepted ifFalse:[ |
|
2637 |
box destroy. |
|
2638 |
^ nil |
|
2639 |
]. |
|
2640 |
box destroy. |
|
2641 |
||
2642 |
^ revisionHolder value withoutSpaces. |
|
2643 |
||
2644 |
" |
|
2645 |
SourceCodeManagerUtilities |
|
2646 |
askForRevisionToCompare:'enter revision' |
|
2647 |
title:'revision' |
|
2648 |
class:nil |
|
2649 |
manager:SourceCodeManager |
|
2650 |
module:'stx' |
|
1666
40429b90ebb6
renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents:
1533
diff
changeset
|
2651 |
directory:'libbasic' |
1375 | 2652 |
fileName:'Array.st' |
2653 |
" |
|
1522 | 2654 |
|
1787 | 2655 |
"Modified: / 13-09-2006 / 18:24:46 / cg" |
1375 | 2656 |
! |
2657 |
||
1426 | 2658 |
checkAndWarnAboutBadMessagesInClass:aClass checkAgainHolder:checkAgainHolder |
1375 | 2659 |
"check if a class contains message-sends to: |
2660 |
#halt |
|
2661 |
#halt: |
|
2662 |
#error |
|
2663 |
(and maybe more in the future)" |
|
2664 |
||
1426 | 2665 |
|badStuff whatIsBad msg answer labels values defaultAnswer dontShowAgain| |
1375 | 2666 |
|
2667 |
badStuff := #( |
|
1456
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2668 |
( 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
|
2669 |
( 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
|
2670 |
( error 'sent of #error without descriptive message - better use #error:''some message''' ) |
1375 | 2671 |
). |
2672 |
||
2673 |
whatIsBad := Set new. |
|
2674 |
aClass theNonMetaclass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
2675 |
|setOfLiterals setOfSentMessages| |
|
2676 |
||
2677 |
setOfLiterals := mthd literals. "/ try without parsing first. |
|
2678 |
(badStuff contains:[:eachEntry | setOfLiterals includes:eachEntry first]) ifTrue:[ |
|
2679 |
setOfSentMessages := mthd messagesSent. |
|
2680 |
badStuff do:[:eachEntry | |
|
2681 |
(setOfSentMessages includes:eachEntry first) ifTrue:[ |
|
2682 |
whatIsBad add:eachEntry second |
|
2683 |
] |
|
1000 | 2684 |
]. |
2685 |
]. |
|
1375 | 2686 |
]. |
2687 |
whatIsBad notEmpty ifTrue:[ |
|
2688 |
(YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[ |
|
2689 |
answer := YesToAllQuery query. |
|
2690 |
answer notNil ifTrue:[ ^ answer ]. |
|
2691 |
]. |
|
2692 |
||
2693 |
msg := '%1 contains the following (considered bad style) message sends:\\'. |
|
2694 |
whatIsBad do:[:each | |
|
2695 |
msg := msg , ' ' , each , '\' |
|
1000 | 2696 |
]. |
1375 | 2697 |
msg := msg , '\\' , 'Do you really want to checkIn the %1 class ?'. |
2698 |
msg := msg bindWith:aClass name. |
|
1426 | 2699 |
|
1375 | 2700 |
(YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[ |
1426 | 2701 |
labels := #('Cancel All' 'Cancel' 'No to All' 'No' 'Yes to All' 'Yes') "#('Yes' 'Yes to All' 'No' 'No to All' 'Cancel')". |
2702 |
values := #(#cancelAll nil #noToAll false #yesToAll true) "#(true #yesToAll false #noToAll nil)". |
|
2703 |
defaultAnswer := #yesToAll. |
|
2704 |
] ifFalse:[ |
|
2705 |
labels := #('No' 'Yes'). |
|
2706 |
values := #(false true). |
|
2707 |
defaultAnswer := true. |
|
2708 |
]. |
|
2709 |
||
1456
673e4fc61c36
Tell about stable and released revisions
Stefan Vogel <sv@exept.de>
parents:
1449
diff
changeset
|
2710 |
"/ AbortAllOperationRequest isHandled ifTrue:[ |
1426 | 2711 |
"/ labels := #('Cancel All') , labels. |
2712 |
"/ values := #(#cancelAll) , values. |
|
2713 |
"/ ]. |
|
2714 |
||
2715 |
DialogBox aboutToOpenBoxNotificationSignal handle:[:ex | |
|
2716 |
|box| |
|
2717 |
||
2718 |
checkAgainHolder isValueModel ifTrue:[ |
|
2719 |
dontShowAgain := checkAgainHolder value not asValue. |
|
2720 |
box := ex parameter. |
|
2721 |
box verticalPanel |
|
1429 | 2722 |
add:(CheckBox label:'Do not show this Dialog again.' |
1426 | 2723 |
model:dontShowAgain). |
1375 | 2724 |
]. |
1426 | 2725 |
ex proceed. |
2726 |
] do:[ |
|
1375 | 2727 |
answer := OptionBox |
2728 |
request:msg withCRs |
|
2729 |
label:'Really checkIn ?' |
|
1391
68432469745f
dont send obsolete message (OptionBox request:..form:..)
Claus Gittinger <cg@exept.de>
parents:
1381
diff
changeset
|
2730 |
image:(InfoBox iconBitmap) |
1375 | 2731 |
buttonLabels:labels |
2732 |
values:values |
|
1426 | 2733 |
default:defaultAnswer |
1375 | 2734 |
onCancel:nil. |
1426 | 2735 |
]. |
2736 |
answer isNil ifTrue:[ |
|
2737 |
AbortSignal raise. |
|
2738 |
]. |
|
2739 |
||
2740 |
dontShowAgain notNil ifTrue:[ |
|
2741 |
checkAgainHolder value:dontShowAgain value not |
|
2742 |
]. |
|
1375 | 2743 |
|
1426 | 2744 |
answer == #cancelAll ifTrue:[ |
2745 |
AbortAllSignal raise. |
|
2746 |
]. |
|
2747 |
||
2748 |
answer == #yesToAll ifTrue:[ |
|
2749 |
YesToAllNotification queryWith:true. |
|
2750 |
^ true |
|
2751 |
]. |
|
2752 |
answer == #noToAll ifTrue:[ |
|
2753 |
YesToAllNotification queryWith:false. |
|
2754 |
^ false |
|
2755 |
]. |
|
2756 |
^ answer |
|
1000 | 2757 |
]. |
1375 | 2758 |
^ true. |
2759 |
||
2760 |
" |
|
2761 |
self checkAndWarnAboutBadMessagesInClass:(SourceCodeManagerUtilities) |
|
2762 |
" |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2763 |
! |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2764 |
|
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2765 |
getCheckinInfoFor:aString initialAnswer:initialAnswerOrNil |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2766 |
"get a log message for checking in a class. |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2767 |
Return the message or nil if aborted." |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2768 |
|
1704 | 2769 |
^ self |
2770 |
getCheckinInfoFor:aString |
|
2771 |
initialAnswer:initialAnswerOrNil |
|
2772 |
withQuickOption:false |
|
2773 |
||
2774 |
" |
|
2775 |
SourceCodeManagerUtilities getCheckinInfoFor:'hello' initialAnswer:'bla' |
|
2776 |
" |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2777 |
|
1704 | 2778 |
"Modified: / 22-06-2006 / 12:49:30 / cg" |
2779 |
! |
|
2780 |
||
2781 |
getCheckinInfoFor:aString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption |
|
2782 |
"get a log message for checking in a class. |
|
2783 |
Return the message or nil if aborted." |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2784 |
|
1704 | 2785 |
|logMsg info| |
2786 |
||
2787 |
info := Tools::CheckinInfoDialog |
|
2788 |
getCheckinInfoFor:aString |
|
2789 |
initialAnswer:(initialAnswerOrNil ? LastSourceLogMessage) |
|
2790 |
withQuickOption:withQuickOption. |
|
1460
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2791 |
info notNil ifTrue:[ |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2792 |
logMsg := info logMessage. |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2793 |
logMsg notNil ifTrue:[ |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2794 |
LastSourceLogMessage := logMsg |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2795 |
]. |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2796 |
]. |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2797 |
^ info |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2798 |
|
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2799 |
" |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2800 |
SourceCodeManagerUtilities getCheckinInfoFor:'hello' initialAnswer:'bla' |
2e1c304e5b52
Setting/deleting symbolic names
Stefan Vogel <sv@exept.de>
parents:
1456
diff
changeset
|
2801 |
" |
1501 | 2802 |
|
2803 |
"Modified: / 22-06-2006 / 12:49:30 / cg" |
|
1375 | 2804 |
! ! |
2805 |
||
2806 |
!SourceCodeManagerUtilities class methodsFor:'utilities-encoding'! |
|
2807 |
||
2808 |
guessEncodingOfBuffer:buffer |
|
2809 |
"look for a string of the form |
|
2810 |
encoding #name |
|
2811 |
or: |
|
2812 |
encoding: name |
|
2813 |
within the given buffer |
|
2814 |
(which is usually the first few bytes of a textFile)." |
|
2815 |
||
1433
c3696ad0922b
mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents:
1429
diff
changeset
|
2816 |
<resource: #obsolete> |
c3696ad0922b
mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents:
1429
diff
changeset
|
2817 |
|
1414
f67d4b166606
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
1403
diff
changeset
|
2818 |
self obsoleteMethodWarning:'ask CharacterEncoder'. |
f67d4b166606
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
1403
diff
changeset
|
2819 |
^ CharacterEncoder guessEncodingOfBuffer:buffer |
1189
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2820 |
! |
fdc5e747c184
refactored check for a valid sourceCodeManager into one place
Claus Gittinger <cg@exept.de>
parents:
1185
diff
changeset
|
2821 |
|
1375 | 2822 |
guessEncodingOfFile:aFilename |
2823 |
"look for a string |
|
2824 |
encoding #name |
|
2825 |
or: |
|
2826 |
encoding: name |
|
2827 |
within the given buffer |
|
2828 |
(which is usually the first few bytes of a textFile). |
|
2829 |
If thats not found, use heuristics (in CharacterArray) to guess." |
|
2830 |
||
1433
c3696ad0922b
mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents:
1429
diff
changeset
|
2831 |
<resource: #obsolete> |
c3696ad0922b
mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents:
1429
diff
changeset
|
2832 |
|
1414
f67d4b166606
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
1403
diff
changeset
|
2833 |
self obsoleteMethodWarning:'ask CharacterEncoder'. |
f67d4b166606
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
1403
diff
changeset
|
2834 |
^ CharacterEncoder guessEncodingOfFile:aFilename |
1375 | 2835 |
|
2836 |
" |
|
2837 |
SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_de.rs' asFilename |
|
2838 |
SourceCodeManagerUtilities guessEncodingOfFile:'../../libview2/resources/ApplicationModel_ru.rs' asFilename |
|
2839 |
" |
|
2840 |
! |
|
2841 |
||
2842 |
guessEncodingOfStream:aStream |
|
2843 |
"look for a string of the form |
|
2844 |
encoding #name |
|
2845 |
or: |
|
2846 |
encoding: name |
|
2847 |
in the first few bytes of aStream." |
|
2848 |
||
1433
c3696ad0922b
mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents:
1429
diff
changeset
|
2849 |
<resource: #obsolete> |
c3696ad0922b
mark obsolete messages as obsolete
Stefan Vogel <sv@exept.de>
parents:
1429
diff
changeset
|
2850 |
|
1414
f67d4b166606
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
1403
diff
changeset
|
2851 |
self obsoleteMethodWarning:'ask CharacterEncoder'. |
f67d4b166606
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
1403
diff
changeset
|
2852 |
^ CharacterEncoder guessEncodingOfStream:aStream |
873 | 2853 |
! ! |
2854 |
||
2855 |
!SourceCodeManagerUtilities class methodsFor:'documentation'! |
|
2856 |
||
2857 |
version |
|
1911 | 2858 |
^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.153 2006-11-20 21:26:51 cg Exp $' |
873 | 2859 |
! ! |