author | Claus Gittinger <cg@exept.de> |
Tue, 21 Apr 2020 13:54:09 +0200 | |
changeset 19580 | ce40b5d1e941 |
parent 19396 | a2c4039f68cf |
permissions | -rw-r--r-- |
13823 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by 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 |
" |
|
11532 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
16059 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
11532 | 16 |
SourceCodeManagerUtilities subclass:#PerforceSourceCodeManagerUtilities |
17 |
instanceVariableNames:'' |
|
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'System-SourceCodeManagement' |
|
21 |
! |
|
22 |
||
23 |
SimpleDialog subclass:#P4CheckinInfoDialog |
|
24 |
instanceVariableNames:'descriptionHolder logMessageHolder isStableHolder tagHolder |
|
25 |
quickCheckInHolder quickCheckInVisibleHolder allowEmptyLogMessage |
|
26 |
warningMessageHolder logHistory logHistoryHeadLineSelectionHolder |
|
27 |
submitHolder' |
|
28 |
classVariableNames:'' |
|
29 |
poolDictionaries:'' |
|
30 |
privateIn:PerforceSourceCodeManagerUtilities |
|
31 |
! |
|
32 |
||
33 |
SimpleDialog subclass:#SubmitInfoDialog |
|
34 |
instanceVariableNames:'descriptionHolder logMessageHolder isStableHolder tagHolder |
|
35 |
quickCheckInHolder quickCheckInVisibleHolder allowEmptyLogMessage |
|
36 |
warningMessageHolder filesHolder tagItInHolder' |
|
37 |
classVariableNames:'LastSourceLogMessage' |
|
38 |
poolDictionaries:'' |
|
39 |
privateIn:PerforceSourceCodeManagerUtilities |
|
40 |
! |
|
41 |
||
42 |
Object subclass:#WorkSpace |
|
43 |
instanceVariableNames:'client host owner root views perforceSettings temporaryWorkSpace |
|
44 |
tempDirectory' |
|
45 |
classVariableNames:'PerforceCommandSemaphore' |
|
46 |
poolDictionaries:'' |
|
47 |
privateIn:PerforceSourceCodeManagerUtilities |
|
48 |
! |
|
49 |
||
50 |
Object subclass:#View |
|
51 |
instanceVariableNames:'depot local workspace type' |
|
52 |
classVariableNames:'' |
|
53 |
poolDictionaries:'' |
|
54 |
privateIn:PerforceSourceCodeManagerUtilities::WorkSpace |
|
55 |
! |
|
56 |
||
13823 | 57 |
!PerforceSourceCodeManagerUtilities class methodsFor:'documentation'! |
58 |
||
59 |
copyright |
|
60 |
" |
|
61 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
62 |
All Rights Reserved |
|
63 |
||
64 |
This software is furnished under a license and may be used |
|
65 |
only in accordance with the terms of that license and with the |
|
66 |
inclusion of the above copyright notice. This software may not |
|
67 |
be provided or otherwise made available to, or used by, any |
|
68 |
other person. No title to or ownership of the software is |
|
69 |
hereby transferred. |
|
70 |
" |
|
71 |
! ! |
|
11532 | 72 |
|
73 |
!PerforceSourceCodeManagerUtilities class methodsFor:'class access'! |
|
74 |
||
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
75 |
checkInInfoDialogClass |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
76 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
77 |
^P4CheckinInfoDialog |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
78 |
! |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
79 |
|
11532 | 80 |
submitInfoDialogClass |
81 |
||
82 |
^ SubmitInfoDialog |
|
83 |
||
84 |
"Created: / 01-06-2012 / 11:09:15 / cg" |
|
85 |
! |
|
86 |
||
87 |
workSpaceClass |
|
88 |
^ WorkSpace |
|
89 |
||
90 |
"Created: / 01-06-2012 / 11:13:49 / cg" |
|
91 |
! ! |
|
92 |
||
93 |
!PerforceSourceCodeManagerUtilities methodsFor:'utilities-cvs'! |
|
94 |
||
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
95 |
askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName forNewContainer:forNewContainer |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
96 |
"open a dialog asking for a source container; |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
97 |
return a dictionary containing module, package and filename, |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
98 |
or nil if canceled." |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
99 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
100 |
|box y component answer |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
101 |
moduleHolder packageHolder fileNameHolder |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
102 |
module package fileName |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
103 |
knownContainers knownPackages packageUpdater |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
104 |
packageBoxComponent fileNameBoxComponent fileNameUpdater| |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
105 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
106 |
knownContainers := Set new. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
107 |
Smalltalk allClassesDo:[:cls | |pckg| |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
108 |
pckg := cls package. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
109 |
pckg size > 0 ifTrue:[ |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
110 |
knownContainers add:(pckg upTo:$:) |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
111 |
] |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
112 |
]. |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
113 |
knownContainers := knownContainers asOrderedCollection reject:[:module | module isBlank]. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
114 |
knownContainers sort. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
115 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
116 |
packageUpdater := [ |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
117 |
|theModulePrefix| |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
118 |
|
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
119 |
theModulePrefix := moduleHolder value , ':'. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
120 |
|
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
121 |
Cursor wait showWhile:[ |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
122 |
knownPackages := Set new. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
123 |
Smalltalk allClassesDo:[:cls | |pckg idx| |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
124 |
pckg := cls package. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
125 |
pckg size > 0 ifTrue:[ |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
126 |
(pckg startsWith:theModulePrefix) ifTrue:[ |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
127 |
idx := pckg indexOf:$:. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
128 |
knownPackages add:(pckg copyFrom:idx + 1) |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
129 |
] |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
130 |
] |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
131 |
]. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
132 |
knownPackages := knownPackages asOrderedCollection. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
133 |
knownPackages := knownPackages select:[:package | package isBlank not]. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
134 |
knownPackages sort. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
135 |
packageBoxComponent list:knownPackages. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
136 |
]. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
137 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
138 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
139 |
fileNameUpdater := [ |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
140 |
|module package files| |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
141 |
|
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
142 |
Cursor read showWhile:[ |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
143 |
module := moduleHolder value ? (PackageId noProjectID). |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
144 |
package := packageHolder value ? (PackageId noProjectID). |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
145 |
|
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
146 |
files := PerforceSourceCodeManager getExistingContainersInModule:module directory:package. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
147 |
files := files asOrderedCollection. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
148 |
files := files select:[:eachFile | eachFile asFilename hasSuffix:'st']. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
149 |
files sort. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
150 |
fileNameBoxComponent list:files. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
151 |
]. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
152 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
153 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
154 |
moduleHolder := initialModule asValue. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
155 |
packageHolder := initialPackage asValue. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
156 |
fileNameHolder := initialFileName asValue. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
157 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
158 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
159 |
"/ open a dialog for this |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
160 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
161 |
box := DialogBox new. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
162 |
box label:title. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
163 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
164 |
component := box addTextLabel:boxText withCRs. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
165 |
component adjust:#left; borderWidth:0. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
166 |
box addVerticalSpace. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
167 |
box addVerticalSpace. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
168 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
169 |
y := box yPosition. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
170 |
component := box addTextLabel:(resources string:'Module:'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
171 |
component width:0.4; adjust:#right. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
172 |
box yPosition:y. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
173 |
component := box addComboBoxOn:moduleHolder tabable:true. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
174 |
component list:knownContainers. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
175 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
176 |
"/ component := box addInputFieldOn:moduleHolder tabable:true. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
177 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
178 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
179 |
box addVerticalSpace. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
180 |
y := box yPosition. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
181 |
component := box addTextLabel:(resources string:'Package:'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
182 |
component width:0.4; adjust:#right. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
183 |
box yPosition:y. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
184 |
packageBoxComponent := component := box addComboBoxOn:packageHolder tabable:true. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
185 |
"/ component := box addInputFieldOn:packageHolder tabable:true. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
186 |
component width:0.6; left:0.4; "immediateAccept:true; "acceptOnLeave:true; cursorMovementWhenUpdating:#beginOfLine. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
187 |
packageUpdater value. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
188 |
moduleHolder onChangeEvaluate:packageUpdater. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
189 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
190 |
box addVerticalSpace. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
191 |
y := box yPosition. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
192 |
component := box addTextLabel:(resources string:'Filename:'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
193 |
component width:0.4; adjust:#right. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
194 |
box yPosition:y. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
195 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
196 |
forNewContainer ifTrue:[ |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
197 |
component := box addInputFieldOn:fileNameHolder tabable:true. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
198 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
199 |
] ifFalse:[ |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
200 |
fileNameBoxComponent := component := box addComboBoxOn:fileNameHolder tabable:true. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
201 |
component width:0.6; left:0.4; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
202 |
fileNameUpdater value. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
203 |
packageHolder onChangeEvaluate:fileNameUpdater. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
204 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
205 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
206 |
box addVerticalSpace. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
207 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
208 |
notice notNil ifTrue:[ |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
209 |
component := box addTextLabel:notice. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
210 |
component adjust:#left; borderWidth:0. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
211 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
212 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
213 |
box addVerticalSpace. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
214 |
box addAbortAndOkButtons. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
215 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
216 |
(YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[ |
15020
76c067348d2b
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
14665
diff
changeset
|
217 |
component := Button label:(resources string:'Yes to All'). |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
218 |
component action:[ |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
219 |
YesToAllNotification queryWith:true. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
220 |
box doAccept. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
221 |
box okPressed. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
222 |
]. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
223 |
box addButton:component. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
224 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
225 |
(AbortAllSignal isHandled) ifTrue:[ |
15020
76c067348d2b
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
14665
diff
changeset
|
226 |
component := Button label:(resources string:'Cancel All'). |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
227 |
component action:[ |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
228 |
box hide. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
229 |
AbortAllSignal raiseSignal. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
230 |
]. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
231 |
box addButton:component before:nil. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
232 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
233 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
234 |
(YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[ |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
235 |
answer := YesToAllQuery query. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
236 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
237 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
238 |
answer isNil ifTrue:[ |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
239 |
box showAtPointer. |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
240 |
answer := box accepted |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
241 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
242 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
243 |
box destroy. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
244 |
answer ifFalse:[ |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
245 |
^ nil |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
246 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
247 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
248 |
module := moduleHolder value withoutSpaces. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
249 |
package := packageHolder value withoutSpaces. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
250 |
fileName := fileNameHolder value withoutSpaces. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
251 |
^ Dictionary new |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
252 |
at:#module put:module; |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
253 |
at:#package put:package; |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
254 |
at:#fileName put:fileName; |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
255 |
yourself |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
256 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
257 |
" |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
258 |
self |
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
259 |
askForContainer:'enter container' title:'container' note:'some note' |
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
260 |
initialModule:'foo' initialPackage:'bar' initialFileName:'baz' |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
261 |
" |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
262 |
|
13400
3ac19c2f9575
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12893
diff
changeset
|
263 |
"Modified: / 29-08-2013 / 12:26:55 / cg" |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
264 |
! |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
265 |
|
11532 | 266 |
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClass usingManager:managerOrNil |
267 |
"check a class into the source repository. |
|
268 |
If the argument, aLogInfoOrNil isNil, ask interactively for log-message. |
|
269 |
If doCheckClass is true, the class is checked for send of halts etc." |
|
270 |
||
271 |
|logMessage checkinInfo mgr pri doSubmit| |
|
272 |
||
273 |
doSubmit := false. |
|
274 |
||
275 |
aClass isLoaded ifFalse:[ |
|
14333
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
276 |
self information:(resources string:'Cannot checkin unloaded classes (%1)' with:aClass name). |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
277 |
^ false. |
11532 | 278 |
]. |
279 |
||
280 |
mgr := managerOrNil. |
|
281 |
mgr isNil ifTrue:[ |
|
14333
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
282 |
mgr := self sourceCodeManagerFor:aClass. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
283 |
mgr isNil ifTrue:[ |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
284 |
^ false |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
285 |
] |
11532 | 286 |
]. |
287 |
||
288 |
self ensureCorrectVersionMethodsInClass:aClass usingManager:mgr. |
|
289 |
mgr supportsCheckinLogMessages ifTrue:[ |
|
14333
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
290 |
(self |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
291 |
getLogMessageForClassCheckinTakingDefaultsFromPreviousLogInfo:aLogInfoOrNil |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
292 |
forClass:aClass |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
293 |
valuesInto:[:logMessageRet :checkinInfoRet | |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
294 |
logMessage := logMessageRet. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
295 |
checkinInfo := checkinInfoRet. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
296 |
checkinInfo notNil ifTrue:[ |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
297 |
doSubmit := checkinInfo submitHolder value. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
298 |
]. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
299 |
] |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
300 |
) ifFalse:[^ false]. |
11532 | 301 |
]. |
302 |
||
303 |
(self classIsNotYetInRepository:aClass withManager:mgr) ifTrue:[ |
|
14333
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
304 |
(self createSourceContainerForClass:aClass usingManager:mgr) ifFalse:[ |
11532 | 305 |
"/ self warn:'did not create a container for ''' , aClass name , ''''. |
14333
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
306 |
^ false |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
307 |
]. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
308 |
^ true. |
11532 | 309 |
]. |
310 |
||
16954 | 311 |
self activityNotification:(resources string:'PerforceSourceCodeManager [info]: checking in %1' with:aClass name). |
11532 | 312 |
pri := Processor activePriority. |
313 |
Processor activeProcess withPriority:pri-1 to:pri |
|
314 |
do:[ |
|
14333
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
315 |
|revision aborted| |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
316 |
|
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
317 |
|
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
318 |
|
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
319 |
aborted := false. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
320 |
AbortOperationRequest handle:[:ex | |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
321 |
aborted := true. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
322 |
ex return. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
323 |
] do:[ |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
324 |
|checkinState cause| |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
325 |
checkinState := false. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
326 |
cause := ''. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
327 |
[ |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
328 |
checkinState := mgr checkinClass:aClass logMessage:logMessage submit:doSubmit |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
329 |
] on:SourceCodeManagerError do:[:ex| |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
330 |
cause := ex description. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
331 |
ex proceed. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
332 |
]. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
333 |
|
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
334 |
checkinState ifFalse:[ |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
335 |
Transcript showCR:'checkin of ''' , aClass name , ''' failed - ', cause. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
336 |
self warn:(resources stringWithCRs:'Checkin of "%1" failed\\' with:aClass name allBold),cause. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
337 |
^ false. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
338 |
]. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
339 |
checkinInfo notNil ifTrue:[ |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
340 |
checkinInfo isStable ifTrue:[ |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
341 |
"set stable tag for class that has been checked in" |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
342 |
self tagClass:aClass as:#stable. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
343 |
]. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
344 |
checkinInfo tagIt ifTrue:[ |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
345 |
"set an additional tag for class that has been checked in" |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
346 |
self tagClass:aClass as:(checkinInfo tag). |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
347 |
]. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
348 |
]. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
349 |
]. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
350 |
aborted ifTrue:[ |con| |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
351 |
Transcript showCR:'Checkin of ''' , aClass name , ''' aborted'. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
352 |
|
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
353 |
AbortAllOperationWantedQuery query ifTrue:[ |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
354 |
(Dialog |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
355 |
confirm:(resources stringWithCRs:'Checkin of "%1" aborted.\\Cancel all ?' with:aClass name) |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
356 |
default:false) |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
357 |
ifTrue:[ |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
358 |
AbortAllOperationRequest raise. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
359 |
] |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
360 |
]. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
361 |
^ false. |
3391320df63d
class: PerforceSourceCodeManagerUtilities
Stefan Vogel <sv@exept.de>
parents:
13926
diff
changeset
|
362 |
]. |
11532 | 363 |
]. |
364 |
^ true |
|
365 |
||
366 |
"Created: / 21-12-2011 / 18:19:14 / cg" |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
367 |
! |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
368 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
369 |
defineSourceContainerForClass:aClass usingManager:mgr title:title text:boxText createDirectories:createDirs createContainer:createContainer |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
370 |
"let user specify the source-repository values for aClass" |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
371 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
372 |
|className |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
373 |
"oldModule oldPackage" oldFileName |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
374 |
module directory fileName nameSpace nameSpacePrefix |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
375 |
info project nm creatingNew msg |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
376 |
answer doCheckinWithoutAsking forceCheckIn rslt note |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
377 |
requiredPackage projectDefinitionClass packageId| |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
378 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
379 |
mgr isNil ifTrue:[^ false]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
380 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
381 |
aClass isLoaded ifFalse:[ |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
382 |
self warn:(resources string:'Please load the %1-class first' with:aClass name). |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
383 |
^ false. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
384 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
385 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
386 |
className := aClass name. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
387 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
388 |
aClass isProjectDefinition ifTrue:[ |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
389 |
"/ no way - their package is already known and fix. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
390 |
module := aClass module. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
391 |
directory := aClass moduleDirectory. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
392 |
] ifFalse:[ |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
393 |
"/ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
394 |
"/ defaults, if nothing at all is known |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
395 |
"/ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
396 |
projectDefinitionClass := aClass projectDefinitionClass. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
397 |
projectDefinitionClass notNil ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
398 |
packageId := PackageId from:projectDefinitionClass package. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
399 |
module := packageId module. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
400 |
directory := packageId directory. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
401 |
] ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
402 |
(module := LastModule) isNil ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
403 |
module := (OperatingSystem getLoginName). |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
404 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
405 |
(directory := LastPackage) isNil ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
406 |
directory := 'private'. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
407 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
408 |
]. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
409 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
410 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
411 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
412 |
"/ try to extract some useful defaults from the current project |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
413 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
414 |
(Project notNil and:[(project := Project current) notNil]) ifTrue:[ |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
415 |
directory isNil ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
416 |
(nm := project repositoryDirectory) isNil ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
417 |
nm := project name |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
418 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
419 |
directory := nm. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
420 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
421 |
module isNil ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
422 |
(nm := project repositoryModule) notNil ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
423 |
module := nm |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
424 |
] |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
425 |
]. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
426 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
427 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
428 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
429 |
"/ ask the sourceCodeManager if it knows anything about that class |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
430 |
"/ if so, take that as a default. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
431 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
432 |
info := mgr sourceInfoOfClass:aClass. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
433 |
info notNil ifTrue:[ |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
434 |
true "module ~= LastModule" ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
435 |
(info includesKey:#module) ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
436 |
module := (info at:#module). |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
437 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
438 |
]. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
439 |
"/ true "package ~= LastPackage" ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
440 |
"/ (info includesKey:#directory) ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
441 |
"/ package := (info at:#directory). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
442 |
"/ ]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
443 |
"/ ]. |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
444 |
fileName := mgr containerFromSourceInfo:info. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
445 |
(nameSpace := aClass nameSpace) ~~ Smalltalk ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
446 |
nameSpacePrefix := nameSpace name , '::'. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
447 |
(fileName startsWith:nameSpacePrefix) ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
448 |
fileName := fileName copyFrom:(nameSpacePrefix size + 1). |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
449 |
] |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
450 |
]. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
451 |
"/ (info includesKey:#fileName) ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
452 |
"/ fileName := (info at:#fileName). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
453 |
"/ ] ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
454 |
"/ (info includesKey:#expectedFileName) ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
455 |
"/ fileName := (info at:#expectedFileName). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
456 |
"/ ] ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
457 |
"/ (info includesKey:#classFileNameBase) ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
458 |
"/ fileName := (info at:#classFileNameBase) , '.st'. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
459 |
"/ ] |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
460 |
"/ ] |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
461 |
"/ ] |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
462 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
463 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
464 |
fileName isNil ifTrue:[ |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
465 |
fileName := (Smalltalk fileNameForClass:aClass) , '.st'. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
466 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
467 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
468 |
OperatingSystem isMSDOSlike ifTrue:[ |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
469 |
module replaceAll:$\ with:$/. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
470 |
directory replaceAll:$\ with:$/. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
471 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
472 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
473 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
474 |
"/ check for conflicts (i.e. if such a container already exists) ... |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
475 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
476 |
doCheckinWithoutAsking := false. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
477 |
"/false ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
478 |
"/ (mgr checkForExistingContainer:fileName inModule:module directory:directory) ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
479 |
"/ answer := Dialog confirmWithCancel:(resources |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
480 |
"/ string:'About to change the source container. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
481 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
482 |
"/Notice: there is a container for %1 in: |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
483 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
484 |
"/ %2 / %3 / %4 |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
485 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
486 |
"/Do you want to change it or check right into that container ?' |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
487 |
"/ with:className |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
488 |
"/ with:module |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
489 |
"/ with:directory |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
490 |
"/ with:fileName) |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
491 |
"/ labels:(resources array:#('Cancel' 'Check in' 'Change')). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
492 |
"/ answer isNil ifTrue:[AbortSignal raise]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
493 |
"/ answer ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
494 |
"/ doCheckinWithoutAsking := false. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
495 |
"/ oldModule := module. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
496 |
"/ oldPackage := directory. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
497 |
"/ oldFileName := fileName |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
498 |
"/ ] ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
499 |
"/ doCheckinWithoutAsking := true. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
500 |
"/ creatingNew := false. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
501 |
"/ ]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
502 |
"/ ]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
503 |
"/]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
504 |
mgr isContainerBased ifTrue:[ |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
505 |
doCheckinWithoutAsking ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
506 |
"/ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
507 |
"/ open a dialog for this |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
508 |
"/ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
509 |
(mgr checkForExistingContainer:fileName inModule:module directory:directory) ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
510 |
note := 'Notice: class seems to have no container yet.'. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
511 |
creatingNew := true. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
512 |
] ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
513 |
creatingNew := false. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
514 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
515 |
|
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
516 |
rslt := self |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
517 |
askForContainer:boxText title:title note:note |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
518 |
initialModule:module initialPackage:directory initialFileName:fileName |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
519 |
forNewContainer:true. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
520 |
|
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
521 |
rslt isNil ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
522 |
^ false |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
523 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
524 |
|
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
525 |
module := rslt at:#module. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
526 |
directory := rslt at:#package. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
527 |
fileName := rslt at:#fileName. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
528 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
529 |
(fileName endsWith:',v') ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
530 |
fileName := fileName copyButLast:2 |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
531 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
532 |
(fileName endsWith:'.st') ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
533 |
fileName := fileName , '.st' |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
534 |
]. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
535 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
536 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
537 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
538 |
"/ we require the packageID to be <module>:<container-dir> |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
539 |
"/ check for this ... |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
540 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
541 |
requiredPackage := ((module ? '') , ':' , (directory ? '')) asSymbol. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
542 |
requiredPackage ~= aClass package ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
543 |
"/ doCheckinWithoutAsking ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
544 |
"/ (self confirm:'Change the classes packageID to: ''', requiredPackage , ''' ?') |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
545 |
"/ ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
546 |
"/ ^ false |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
547 |
"/ ] |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
548 |
"/ ]. |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
549 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:requiredPackage]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
550 |
aClass package:requiredPackage. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
551 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
552 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
553 |
info := aClass revisionInfo. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
554 |
info notNil ifTrue:[ |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
555 |
(info repositoryPathName isNil) ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
556 |
info := nil |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
557 |
]. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
558 |
"/ (info includesKey:#repositoryPathName) ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
559 |
"/ info := nil |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
560 |
"/ ] |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
561 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
562 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
563 |
info isNil ifTrue:[ |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
564 |
true "doCheckinWithoutAsking" ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
565 |
answer := Dialog |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
566 |
confirmWithCancel:(resources string:'%1 does not have any (usable) revision info (#version method)\\Shall I create one ?' with:className) withCRs |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
567 |
labels:(resources array:#( 'Cancel' 'No' 'Yes')). |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
568 |
answer isNil ifTrue:[^ false]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
569 |
] ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
570 |
answer := true. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
571 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
572 |
answer ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
573 |
mgr |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
574 |
updateVersionMethodOf:aClass |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
575 |
for:(mgr initialRevisionStringFor:aClass |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
576 |
inModule:module |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
577 |
directory:directory |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
578 |
container:fileName). |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
579 |
]. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
580 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
581 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
582 |
(self checkForExistingModule:module usingManager:mgr allowCreate:(createDirs or:[creatingNew])) |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
583 |
ifFalse:[^ false]. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
584 |
LastModule := module. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
585 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
586 |
(self checkForExistingModule:module directory:directory usingManager:mgr allowCreate:(createDirs or:[creatingNew])) |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
587 |
ifFalse:[^ false]. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
588 |
LastPackage := directory. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
589 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
590 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
591 |
"/ check for the container itself |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
592 |
"/ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
593 |
(mgr isContainerBased not |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
594 |
or:[ mgr checkForExistingContainer:fileName inModule:module directory:directory ]) ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
595 |
"/ (oldModule notNil |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
596 |
"/ and:[(oldModule ~= module) |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
597 |
"/ or:[oldPackage ~= package |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
598 |
"/ or:[oldFileName ~= fileName]]]) |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
599 |
"/ ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
600 |
"/ self warn:(resources string:'no change'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
601 |
"/ ^ false. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
602 |
"/ ]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
603 |
|
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
604 |
mgr isContainerBased ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
605 |
creatingNew ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
606 |
self warn:(resources string:'Container for %1 already exists in %2/%3.' with:fileName with:module with:directory) withCRs. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
607 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
608 |
|
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
609 |
doCheckinWithoutAsking ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
610 |
(Dialog |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
611 |
confirm:(resources string:'check %1 into the existing container |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
612 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
613 |
%2 / %3 / %4 ?' |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
614 |
with:className |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
615 |
with:module |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
616 |
with:directory |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
617 |
with:fileName) withCRs |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
618 |
noLabel:'Cancel') |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
619 |
ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
620 |
^ false. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
621 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
622 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
623 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
624 |
oldFileName notNil ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
625 |
msg := ('forced checkin / source container change from ' , oldFileName). |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
626 |
] ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
627 |
msg := 'defined source container' |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
628 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
629 |
|
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
630 |
(forceCheckIn := doCheckinWithoutAsking) ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
631 |
(mgr |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
632 |
checkinClass:aClass |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
633 |
fileName:fileName |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
634 |
directory:directory |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
635 |
module:module |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
636 |
logMessage:msg) |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
637 |
ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
638 |
doCheckinWithoutAsking ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
639 |
(Dialog |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
640 |
confirm:'No easy merge seems possible; force checkin (no merge) ?' |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
641 |
noLabel:'Cancel') |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
642 |
ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
643 |
^ false. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
644 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
645 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
646 |
forceCheckIn := true. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
647 |
] |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
648 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
649 |
forceCheckIn ifTrue:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
650 |
(mgr |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
651 |
checkinClass:aClass |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
652 |
fileName:fileName |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
653 |
directory:directory |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
654 |
module:module |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
655 |
logMessage:msg |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
656 |
force:true) |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
657 |
ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
658 |
self warn:(resources string:'Failed to check into existing container.'). |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
659 |
^ false. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
660 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
661 |
]. |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
662 |
^ true |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
663 |
] ifFalse:[ |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
664 |
(createContainer or:[creatingNew]) ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
665 |
(Dialog |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
666 |
confirm:(resources string:'No container exists for %1 in %2/%3\\create ?' |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
667 |
with:fileName with:module with:directory) withCRs |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
668 |
noLabel:'Cancel') ifFalse:[ |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
669 |
^ false |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
670 |
] |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
671 |
] |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
672 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
673 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
674 |
aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | mthd setPackage:requiredPackage]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
675 |
aClass package:requiredPackage. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
676 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
677 |
(mgr |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
678 |
createContainerFor:aClass |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
679 |
inModule:module |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
680 |
package:directory |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
681 |
container:fileName |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
682 |
) ifFalse:[ |
13592
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
683 |
self warn:(resources string:'Failed to create container.'). |
1e59bda02cf8
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
13400
diff
changeset
|
684 |
^ false. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
685 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
686 |
^ true |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
687 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
688 |
"Created: / 21-12-2011 / 18:34:02 / cg" |
11532 | 689 |
! ! |
690 |
||
691 |
!PerforceSourceCodeManagerUtilities methodsFor:'utilities-p4'! |
|
692 |
||
693 |
submit |
|
694 |
self defaultManager submit |
|
695 |
! ! |
|
696 |
||
697 |
!PerforceSourceCodeManagerUtilities methodsFor:'utilities-p4-interaction'! |
|
698 |
||
699 |
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswerOrNil withQuickOption:withQuickOption |
|
700 |
"ask for a log message for checking in a class (plus checkinQuick state info), |
|
701 |
and other info (mark as stable, for example). |
|
702 |
Return the info-object (actually: the dialog) or nil if aborted." |
|
703 |
||
704 |
|logMsg infoDialog| |
|
705 |
||
706 |
infoDialog := self defaultManager checkInInfoDialogClass |
|
707 |
getCheckinInfoFor:aClassNameOrPackageNameString |
|
708 |
initialAnswer:(initialAnswerOrNil ? LastSourceLogMessage) |
|
709 |
withQuickOption:withQuickOption. |
|
710 |
infoDialog notNil ifTrue:[ |
|
711 |
logMsg := infoDialog logMessage. |
|
712 |
logMsg notEmptyOrNil ifTrue:[ |
|
713 |
LastSourceLogMessage := logMsg |
|
714 |
]. |
|
715 |
]. |
|
716 |
^ infoDialog |
|
717 |
||
718 |
" |
|
719 |
SourceCodeManagerUtilities getCheckinInfoFor:'hello' initialAnswer:'bla' |
|
720 |
" |
|
721 |
||
722 |
"Modified: / 06-07-2010 / 11:21:28 / cg" |
|
723 |
! ! |
|
724 |
||
725 |
!PerforceSourceCodeManagerUtilities::P4CheckinInfoDialog class methodsFor:'documentation'! |
|
726 |
||
727 |
copyright |
|
728 |
" |
|
729 |
COPYRIGHT (c) 2005 eXept Software AG |
|
730 |
All Rights Reserved |
|
731 |
||
732 |
This software is furnished under a license and may be used |
|
733 |
only in accordance with the terms of that license and with the |
|
734 |
inclusion of the above copyright notice. This software may not |
|
735 |
be provided or otherwise made available to, or used by, any |
|
736 |
other person. No title to or ownership of the software is |
|
737 |
hereby transferred. |
|
738 |
" |
|
739 |
! |
|
740 |
||
741 |
documentation |
|
742 |
" |
|
743 |
checkin-dialog. |
|
744 |
used to be private in SourceCodeManagerUtilites. |
|
745 |
moved to libtool because libbasic3 should not contain code inheriting from GUI classes. |
|
746 |
||
747 |
[author:] |
|
748 |
||
749 |
[see also:] |
|
750 |
||
751 |
[instance variables:] |
|
752 |
||
753 |
[class variables:] |
|
754 |
" |
|
755 |
! ! |
|
756 |
||
757 |
!PerforceSourceCodeManagerUtilities::P4CheckinInfoDialog class methodsFor:'interface specs'! |
|
758 |
||
759 |
windowSpec |
|
760 |
"This resource specification was automatically generated |
|
761 |
by the UIPainter of ST/X." |
|
762 |
||
763 |
"Do not manually edit this!! If it is corrupted, |
|
764 |
the UIPainter may not be able to read the specification." |
|
765 |
||
766 |
" |
|
767 |
UIPainter new openOnClass:PerforceSourceCodeManager::P4CheckinInfoDialog andSelector:#windowSpec |
|
768 |
PerforceSourceCodeManager::P4CheckinInfoDialog new openInterface:#windowSpec |
|
769 |
PerforceSourceCodeManager::P4CheckinInfoDialog open |
|
770 |
" |
|
771 |
||
772 |
<resource: #canvas> |
|
773 |
||
774 |
^ |
|
775 |
#(FullSpec |
|
776 |
name: windowSpec |
|
777 |
window: |
|
778 |
(WindowSpec |
|
779 |
label: 'Enter Log Message' |
|
780 |
name: 'Enter Log Message' |
|
781 |
min: (Point 10 10) |
|
782 |
bounds: (Rectangle 0 0 800 327) |
|
783 |
) |
|
784 |
component: |
|
785 |
(SpecCollection |
|
786 |
collection: ( |
|
787 |
(HorizontalPanelViewSpec |
|
788 |
name: 'HorizontalPanel2' |
|
789 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
790 |
horizontalLayout: left |
|
791 |
verticalLayout: center |
|
792 |
horizontalSpace: 0 |
|
793 |
verticalSpace: 3 |
|
794 |
component: |
|
795 |
(SpecCollection |
|
796 |
collection: ( |
|
797 |
(LabelSpec |
|
798 |
label: 'Enter checkIn log-message for:' |
|
799 |
name: 'Label1' |
|
800 |
translateLabel: true |
|
801 |
resizeForLabel: true |
|
802 |
useDefaultExtent: true |
|
803 |
) |
|
804 |
(LabelSpec |
|
805 |
name: 'Label2' |
|
806 |
translateLabel: true |
|
807 |
labelChannel: descriptionHolder |
|
808 |
useDefaultExtent: true |
|
809 |
) |
|
810 |
) |
|
811 |
||
812 |
) |
|
813 |
) |
|
814 |
(TextEditorSpec |
|
815 |
name: 'TextEditor1' |
|
816 |
layout: (LayoutFrame 2 0.0 38 0 -2 1 -125 1) |
|
817 |
model: logMessageHolder |
|
818 |
hasHorizontalScrollBar: true |
|
819 |
hasVerticalScrollBar: true |
|
820 |
hasKeyboardFocusInitially: false |
|
821 |
) |
|
822 |
(LabelSpec |
|
823 |
name: 'Label4' |
|
824 |
layout: (LayoutFrame 0 0.0 -119 1 0 1.0 -97 1) |
|
825 |
translateLabel: true |
|
826 |
labelChannel: warningMessageHolder |
|
827 |
) |
|
828 |
(CheckBoxSpec |
|
829 |
label: 'Quick Checkin (Only Classes in ChangeSet)' |
|
830 |
name: 'CheckInChangedOnlyCheckbox' |
|
831 |
layout: (LayoutFrame 3 0 -95 1 -3 0.5 -73 1) |
|
832 |
visibilityChannel: quickCheckInVisibleHolder |
|
833 |
model: quickCheckInHolder |
|
834 |
translateLabel: true |
|
835 |
) |
|
836 |
(CheckBoxSpec |
|
837 |
label: 'Mark as Stable' |
|
838 |
name: 'MarkStableCheckBox' |
|
839 |
layout: (LayoutFrame 3 0 -68 1 -3 1 -46 1) |
|
840 |
model: isStableHolder |
|
841 |
translateLabel: true |
|
842 |
) |
|
843 |
(LabelSpec |
|
844 |
label: 'Tag:' |
|
845 |
name: 'Label3' |
|
846 |
layout: (LayoutFrame -40 0.5 -67 1 0 0.5 -45 1) |
|
847 |
translateLabel: true |
|
848 |
adjust: right |
|
849 |
) |
|
850 |
(InputFieldSpec |
|
851 |
name: 'TagEntryField' |
|
852 |
layout: (LayoutFrame 0 0.5 -68 1 -3 1 -46 1) |
|
853 |
enableChannel: tagItInHolder |
|
854 |
model: tagHolder |
|
855 |
acceptOnReturn: true |
|
856 |
acceptOnTab: true |
|
857 |
acceptOnLostFocus: true |
|
858 |
acceptOnPointerLeave: false |
|
859 |
) |
|
860 |
(HorizontalPanelViewSpec |
|
861 |
name: 'ButtonPanel1' |
|
862 |
layout: (LayoutFrame 0 0.0 -40 1 0 1.0 0 1.0) |
|
863 |
horizontalLayout: fitSpace |
|
864 |
verticalLayout: center |
|
865 |
horizontalSpace: 3 |
|
866 |
verticalSpace: 2 |
|
867 |
reverseOrderIfOKAtLeft: true |
|
868 |
component: |
|
869 |
(SpecCollection |
|
870 |
collection: ( |
|
871 |
(ActionButtonSpec |
|
872 |
label: 'Cancel' |
|
873 |
name: 'Button2' |
|
874 |
translateLabel: true |
|
875 |
model: doCancel |
|
876 |
extent: (Point 395 22) |
|
877 |
) |
|
878 |
(ActionButtonSpec |
|
879 |
label: 'OK' |
|
880 |
name: 'Button1' |
|
881 |
translateLabel: true |
|
882 |
model: doAccept |
|
883 |
extent: (Point 396 22) |
|
884 |
) |
|
885 |
) |
|
886 |
||
887 |
) |
|
888 |
) |
|
889 |
(CheckBoxSpec |
|
890 |
label: 'Immediate Submit' |
|
891 |
name: 'CheckBox1' |
|
892 |
layout: (LayoutFrame 3 0.5 -95 1 -3 1 -73 1) |
|
893 |
model: submitHolder |
|
894 |
translateLabel: true |
|
895 |
) |
|
896 |
) |
|
897 |
||
898 |
) |
|
899 |
) |
|
900 |
! ! |
|
901 |
||
902 |
!PerforceSourceCodeManagerUtilities::P4CheckinInfoDialog class methodsFor:'opening'! |
|
903 |
||
904 |
getCheckinInfoFor:aString initialAnswer:initialAnswer |
|
905 |
^ self |
|
906 |
getCheckinInfoFor:aString |
|
907 |
initialAnswer:initialAnswer |
|
908 |
withQuickOption:false |
|
909 |
||
910 |
" |
|
911 |
self getCheckinInfoFor:'hello' initialAnswer:'bla' |
|
912 |
" |
|
913 |
||
914 |
"Modified (format): / 12-03-2012 / 12:38:48 / cg" |
|
915 |
! |
|
916 |
||
917 |
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswer withQuickOption:withQuickOption |
|
918 |
^ self |
|
919 |
getCheckinInfoFor:aClassNameOrPackageNameString |
|
920 |
initialAnswer:initialAnswer |
|
921 |
withQuickOption:withQuickOption |
|
922 |
logHistory:#() |
|
923 |
||
924 |
" |
|
925 |
self getCheckinInfoFor:'hello' initialAnswer:'bla' |
|
926 |
" |
|
927 |
||
928 |
"Modified: / 12-03-2012 / 12:39:00 / cg" |
|
929 |
! |
|
930 |
||
931 |
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswer withQuickOption:withQuickOption logHistory:logHistoryArg |
|
932 |
|dialog warnMessage| |
|
933 |
||
934 |
warnMessage := nil. |
|
935 |
||
936 |
[ |
|
937 |
dialog := self new. |
|
938 |
dialog |
|
939 |
description:aClassNameOrPackageNameString; |
|
940 |
logMessage:initialAnswer; |
|
941 |
withQuickOption:withQuickOption; |
|
942 |
logHistory:logHistoryArg. |
|
943 |
||
944 |
dialog warningMessageHolder value:warnMessage. |
|
945 |
dialog open. |
|
946 |
dialog accepted ifFalse:[ ^ nil ]. |
|
947 |
] doUntil:[ |
|
948 |
|stopAsking| |
|
949 |
||
950 |
stopAsking := dialog allowEmptyLogMessage |
|
951 |
or:[ dialog logMessage withoutSeparators notEmptyOrNil ]. |
|
952 |
stopAsking ifFalse:[ |
|
16519 | 953 |
warnMessage := (self resources |
19088 | 954 |
string:'Please enter a description of your changes!!') allRed. |
11532 | 955 |
]. |
956 |
stopAsking |
|
957 |
]. |
|
958 |
^ dialog |
|
959 |
||
960 |
||
961 |
" |
|
962 |
self getCheckinInfoFor:'hello' initialAnswer:'bla' |
|
963 |
" |
|
964 |
||
965 |
"Created: / 12-03-2012 / 12:36:26 / cg" |
|
966 |
! ! |
|
967 |
||
968 |
!PerforceSourceCodeManagerUtilities::P4CheckinInfoDialog methodsFor:'accessing'! |
|
969 |
||
970 |
allowEmptyLogMessage |
|
971 |
^ allowEmptyLogMessage ? false |
|
972 |
||
973 |
"Created: / 06-07-2010 / 11:23:18 / cg" |
|
974 |
! |
|
975 |
||
976 |
allowEmptyLogMessage:aBoolean |
|
977 |
allowEmptyLogMessage := aBoolean |
|
978 |
||
979 |
"Created: / 06-07-2010 / 11:23:31 / cg" |
|
980 |
! |
|
981 |
||
982 |
description |
|
983 |
^ self descriptionHolder value |
|
984 |
! |
|
985 |
||
986 |
description:aString |
|
987 |
self descriptionHolder value:aString allBold |
|
988 |
! |
|
989 |
||
990 |
isStable |
|
991 |
^ self isStableHolder value |
|
992 |
! |
|
993 |
||
994 |
isStable:aBoolean |
|
995 |
self isStableHolder value:aBoolean |
|
996 |
! |
|
997 |
||
998 |
logHistory:something |
|
999 |
logHistory := something. |
|
1000 |
! |
|
1001 |
||
1002 |
logMessage |
|
1003 |
^ self logMessageHolder value |
|
1004 |
! |
|
1005 |
||
1006 |
logMessage:aString |
|
1007 |
self logMessageHolder value:aString |
|
1008 |
! |
|
1009 |
||
1010 |
quickCheckIn |
|
1011 |
^ self quickCheckInHolder value |
|
1012 |
! |
|
1013 |
||
1014 |
quickCheckIn:aBoolean |
|
1015 |
self quickCheckInHolder value:aBoolean |
|
1016 |
! |
|
1017 |
||
1018 |
tag |
|
1019 |
^ self tagHolder value withoutSeparators |
|
1020 |
! |
|
1021 |
||
1022 |
tag:aStringOrNil |
|
1023 |
self tagHolder value:aStringOrNil |
|
1024 |
||
1025 |
"Modified: / 12-09-2006 / 12:03:50 / cg" |
|
1026 |
! |
|
1027 |
||
1028 |
tagIt |
|
1029 |
^ self tag notEmptyOrNil |
|
1030 |
||
1031 |
"Created: / 12-09-2006 / 13:06:49 / cg" |
|
1032 |
! |
|
1033 |
||
1034 |
withQuickOption:aBoolean |
|
1035 |
^ self quickCheckInVisibleHolder value:aBoolean |
|
1036 |
! ! |
|
1037 |
||
1038 |
!PerforceSourceCodeManagerUtilities::P4CheckinInfoDialog methodsFor:'aspects'! |
|
1039 |
||
1040 |
descriptionHolder |
|
1041 |
descriptionHolder isNil ifTrue:[ |
|
1042 |
descriptionHolder := ValueHolder new. |
|
1043 |
]. |
|
1044 |
^ descriptionHolder |
|
1045 |
! |
|
1046 |
||
1047 |
isStableHolder |
|
1048 |
isStableHolder isNil ifTrue:[ |
|
1049 |
isStableHolder := false asValue. |
|
1050 |
]. |
|
1051 |
^ isStableHolder. |
|
1052 |
||
1053 |
"Modified: / 16-01-2007 / 16:00:26 / cg" |
|
1054 |
! |
|
1055 |
||
1056 |
logHistoryHeadLineSelectionHolder |
|
1057 |
logHistoryHeadLineSelectionHolder isNil ifTrue:[ |
|
1058 |
logHistoryHeadLineSelectionHolder := nil asValue. |
|
1059 |
logHistoryHeadLineSelectionHolder |
|
1060 |
onChangeEvaluate: |
|
1061 |
[ |
|
1062 |
self logMessageHolder value:(logHistory at:logHistoryHeadLineSelectionHolder value) |
|
1063 |
]. |
|
1064 |
]. |
|
1065 |
^ logHistoryHeadLineSelectionHolder |
|
1066 |
||
1067 |
"Created: / 12-03-2012 / 12:40:36 / cg" |
|
1068 |
! |
|
1069 |
||
1070 |
logHistoryHeadLines |
|
1071 |
^ (logHistory ? #()) |
|
1072 |
collect:[:msg | |
|
1073 |
msg withoutLeadingSeparators asCollectionOfLines first , '...' |
|
1074 |
] |
|
1075 |
||
1076 |
"Created: / 12-03-2012 / 12:39:35 / cg" |
|
1077 |
! |
|
1078 |
||
1079 |
logMessageHolder |
|
1080 |
logMessageHolder isNil ifTrue:[ |
|
1081 |
logMessageHolder := '' asValue. |
|
1082 |
]. |
|
1083 |
^ logMessageHolder. |
|
1084 |
||
1085 |
"Modified: / 12-03-2012 / 12:34:13 / cg" |
|
1086 |
! |
|
1087 |
||
1088 |
quickCheckInHolder |
|
1089 |
quickCheckInHolder isNil ifTrue:[ |
|
1090 |
quickCheckInHolder := true asValue. |
|
1091 |
]. |
|
1092 |
^ quickCheckInHolder |
|
1093 |
! |
|
1094 |
||
1095 |
quickCheckInVisibleHolder |
|
1096 |
quickCheckInVisibleHolder isNil ifTrue:[ |
|
1097 |
quickCheckInVisibleHolder := false asValue. |
|
1098 |
]. |
|
1099 |
^ quickCheckInVisibleHolder |
|
1100 |
! |
|
1101 |
||
1102 |
submitHolder |
|
1103 |
submitHolder isNil ifTrue:[ |
|
1104 |
submitHolder := false asValue. |
|
1105 |
]. |
|
1106 |
^ submitHolder |
|
1107 |
! |
|
1108 |
||
1109 |
tagHolder |
|
1110 |
tagHolder isNil ifTrue:[ |
|
1111 |
tagHolder := '' asValue. |
|
1112 |
]. |
|
1113 |
^ tagHolder |
|
1114 |
! |
|
1115 |
||
1116 |
warningMessageHolder |
|
1117 |
warningMessageHolder isNil ifTrue:[ |
|
1118 |
warningMessageHolder := nil asValue. |
|
1119 |
]. |
|
1120 |
^ warningMessageHolder. |
|
1121 |
||
1122 |
"Created: / 06-07-2010 / 11:30:29 / cg" |
|
1123 |
! ! |
|
1124 |
||
1125 |
!PerforceSourceCodeManagerUtilities::SubmitInfoDialog class methodsFor:'documentation'! |
|
1126 |
||
1127 |
copyright |
|
1128 |
" |
|
1129 |
COPYRIGHT (c) 2005 eXept Software AG |
|
1130 |
All Rights Reserved |
|
1131 |
||
1132 |
This software is furnished under a license and may be used |
|
1133 |
only in accordance with the terms of that license and with the |
|
1134 |
inclusion of the above copyright notice. This software may not |
|
1135 |
be provided or otherwise made available to, or used by, any |
|
1136 |
other person. No title to or ownership of the software is |
|
1137 |
hereby transferred. |
|
1138 |
" |
|
1139 |
! |
|
1140 |
||
1141 |
documentation |
|
1142 |
" |
|
1143 |
checkin-dialog. |
|
1144 |
used to be private in SourceCodeManagerUtilites. |
|
1145 |
moved to libtool because libbasic3 should not contain code inheriting from GUI classes. |
|
1146 |
||
1147 |
[author:] |
|
1148 |
||
1149 |
[see also:] |
|
1150 |
||
1151 |
[instance variables:] |
|
1152 |
||
1153 |
[class variables:] |
|
1154 |
" |
|
1155 |
! ! |
|
1156 |
||
1157 |
!PerforceSourceCodeManagerUtilities::SubmitInfoDialog class methodsFor:'interface specs'! |
|
1158 |
||
1159 |
windowSpec |
|
1160 |
"This resource specification was automatically generated |
|
1161 |
by the UIPainter of ST/X." |
|
1162 |
||
1163 |
"Do not manually edit this!! If it is corrupted, |
|
1164 |
the UIPainter may not be able to read the specification." |
|
1165 |
||
1166 |
" |
|
1167 |
UIPainter new openOnClass:PerforceSourceCodeManager::SubmitInfoDialog andSelector:#windowSpec |
|
1168 |
PerforceSourceCodeManager::SubmitInfoDialog new openInterface:#windowSpec |
|
1169 |
PerforceSourceCodeManager::SubmitInfoDialog open |
|
1170 |
" |
|
1171 |
||
1172 |
<resource: #canvas> |
|
1173 |
||
1174 |
^ |
|
1175 |
#(FullSpec |
|
1176 |
name: windowSpec |
|
1177 |
window: |
|
1178 |
(WindowSpec |
|
1179 |
label: 'Enter Log Message' |
|
1180 |
name: 'Enter Log Message' |
|
1181 |
min: (Point 10 10) |
|
1182 |
bounds: (Rectangle 0 0 563 561) |
|
1183 |
) |
|
1184 |
component: |
|
1185 |
(SpecCollection |
|
1186 |
collection: ( |
|
1187 |
(HorizontalPanelViewSpec |
|
1188 |
name: 'HorizontalPanel2' |
|
1189 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
1190 |
horizontalLayout: left |
|
1191 |
verticalLayout: center |
|
1192 |
horizontalSpace: 0 |
|
1193 |
verticalSpace: 3 |
|
1194 |
component: |
|
1195 |
(SpecCollection |
|
1196 |
collection: ( |
|
1197 |
(LabelSpec |
|
1198 |
label: 'Enter checkIn log-message for:' |
|
1199 |
name: 'Label1' |
|
1200 |
translateLabel: true |
|
1201 |
resizeForLabel: true |
|
1202 |
useDefaultExtent: true |
|
1203 |
) |
|
1204 |
(LabelSpec |
|
1205 |
name: 'Label2' |
|
1206 |
translateLabel: true |
|
1207 |
labelChannel: descriptionHolder |
|
1208 |
useDefaultExtent: true |
|
1209 |
) |
|
1210 |
) |
|
1211 |
||
1212 |
) |
|
1213 |
) |
|
1214 |
(VerticalPanelViewSpec |
|
1215 |
name: 'VerticalPanel1' |
|
1216 |
layout: (LayoutFrame 0 0.0 38 0 0 1.0 -80 1) |
|
1217 |
horizontalLayout: fit |
|
1218 |
verticalLayout: topFit |
|
1219 |
horizontalSpace: 3 |
|
1220 |
verticalSpace: 3 |
|
1221 |
component: |
|
1222 |
(SpecCollection |
|
1223 |
collection: ( |
|
1224 |
(LabelSpec |
|
1225 |
label: 'Files:' |
|
1226 |
name: 'Label4' |
|
1227 |
translateLabel: true |
|
1228 |
adjust: left |
|
1229 |
extent: (Point 563 23) |
|
1230 |
) |
|
1231 |
(TextEditorSpec |
|
1232 |
name: 'TextEditor1' |
|
1233 |
enableChannel: false |
|
1234 |
model: filesHolder |
|
1235 |
hasHorizontalScrollBar: true |
|
1236 |
hasVerticalScrollBar: true |
|
1237 |
hasKeyboardFocusInitially: false |
|
1238 |
extent: (Point 563 146) |
|
1239 |
) |
|
1240 |
(LabelSpec |
|
1241 |
label: 'Log Message:' |
|
1242 |
name: 'Label5' |
|
1243 |
translateLabel: true |
|
1244 |
adjust: left |
|
1245 |
extent: (Point 563 23) |
|
1246 |
) |
|
1247 |
(TextEditorSpec |
|
1248 |
name: 'TextEditor2' |
|
1249 |
model: logMessageHolder |
|
1250 |
hasHorizontalScrollBar: true |
|
1251 |
hasVerticalScrollBar: true |
|
1252 |
hasKeyboardFocusInitially: false |
|
1253 |
extent: (Point 563 242) |
|
1254 |
) |
|
1255 |
) |
|
1256 |
||
1257 |
) |
|
1258 |
) |
|
1259 |
(CheckBoxSpec |
|
1260 |
label: 'Mark as Stable' |
|
1261 |
name: 'MarkStableCheckBox' |
|
1262 |
layout: (LayoutFrame 3 0 -68 1 -3 1 -46 1) |
|
1263 |
model: isStableHolder |
|
1264 |
translateLabel: true |
|
1265 |
) |
|
1266 |
(LabelSpec |
|
1267 |
label: 'Tag:' |
|
1268 |
name: 'Label3' |
|
1269 |
layout: (LayoutFrame -40 0.5 -67 1 0 0.5 -45 1) |
|
1270 |
translateLabel: true |
|
1271 |
adjust: right |
|
1272 |
) |
|
1273 |
(InputFieldSpec |
|
1274 |
name: 'TagEntryField' |
|
1275 |
layout: (LayoutFrame 0 0.5 -68 1 -3 1 -46 1) |
|
1276 |
enableChannel: tagItInHolder |
|
1277 |
model: tagHolder |
|
1278 |
acceptOnReturn: true |
|
1279 |
acceptOnTab: true |
|
1280 |
acceptOnLostFocus: true |
|
1281 |
acceptOnPointerLeave: false |
|
1282 |
) |
|
1283 |
(HorizontalPanelViewSpec |
|
1284 |
name: 'ButtonPanel1' |
|
1285 |
layout: (LayoutFrame 0 0.0 -40 1 0 1.0 0 1.0) |
|
1286 |
horizontalLayout: fitSpace |
|
1287 |
verticalLayout: center |
|
1288 |
horizontalSpace: 3 |
|
1289 |
verticalSpace: 2 |
|
1290 |
reverseOrderIfOKAtLeft: true |
|
1291 |
component: |
|
1292 |
(SpecCollection |
|
1293 |
collection: ( |
|
1294 |
(ActionButtonSpec |
|
1295 |
label: 'Cancel' |
|
1296 |
name: 'Button2' |
|
1297 |
translateLabel: true |
|
1298 |
model: doCancel |
|
1299 |
extent: (Point 277 22) |
|
1300 |
) |
|
1301 |
(ActionButtonSpec |
|
1302 |
label: 'OK' |
|
1303 |
name: 'Button1' |
|
1304 |
translateLabel: true |
|
1305 |
model: doAccept |
|
1306 |
extent: (Point 277 22) |
|
1307 |
) |
|
1308 |
) |
|
1309 |
||
1310 |
) |
|
1311 |
) |
|
1312 |
) |
|
1313 |
||
1314 |
) |
|
1315 |
) |
|
1316 |
! ! |
|
1317 |
||
1318 |
!PerforceSourceCodeManagerUtilities::SubmitInfoDialog class methodsFor:'opening'! |
|
1319 |
||
1320 |
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswer withFileList:fileList |
|
1321 |
|dialog warnMessage| |
|
1322 |
||
1323 |
warnMessage := nil. |
|
1324 |
||
1325 |
[ |
|
1326 |
dialog := self new. |
|
1327 |
dialog |
|
1328 |
description:aClassNameOrPackageNameString; |
|
1329 |
logMessage:initialAnswer; |
|
1330 |
files:fileList. |
|
1331 |
||
1332 |
dialog warningMessageHolder value:warnMessage. |
|
1333 |
dialog open. |
|
1334 |
dialog accepted ifFalse:[ ^ nil ]. |
|
1335 |
] doUntil:[ |
|
1336 |
|stopAsking| |
|
1337 |
||
1338 |
stopAsking := dialog allowEmptyLogMessage |
|
1339 |
or:[ dialog logMessage withoutSeparators notEmptyOrNil ]. |
|
1340 |
stopAsking ifFalse:[ |
|
16519 | 1341 |
warnMessage := (self resources |
19088 | 1342 |
string:'Please enter a description of your changes!!') allRed. |
11532 | 1343 |
]. |
1344 |
stopAsking |
|
1345 |
]. |
|
1346 |
^ dialog |
|
1347 |
||
1348 |
||
1349 |
" |
|
1350 |
self getCheckinInfoFor:'hello' initialAnswer:'bla' |
|
1351 |
" |
|
1352 |
||
1353 |
"Modified: / 06-07-2010 / 11:40:00 / cg" |
|
1354 |
! |
|
1355 |
||
1356 |
getCheckinInfoFor:aClassNameOrPackageNameString initialAnswer:initialAnswer withQuickOption:withQuickOption |
|
1357 |
|dialog warnMessage| |
|
1358 |
||
1359 |
warnMessage := nil. |
|
1360 |
||
1361 |
[ |
|
1362 |
dialog := self new. |
|
1363 |
dialog |
|
1364 |
description:aClassNameOrPackageNameString; |
|
1365 |
logMessage:initialAnswer; |
|
1366 |
withQuickOption:withQuickOption. |
|
1367 |
||
1368 |
dialog warningMessageHolder value:warnMessage. |
|
1369 |
dialog open. |
|
1370 |
dialog accepted ifFalse:[ ^ nil ]. |
|
1371 |
] doUntil:[ |
|
1372 |
|stopAsking| |
|
1373 |
||
1374 |
stopAsking := dialog allowEmptyLogMessage |
|
1375 |
or:[ dialog logMessage withoutSeparators notEmptyOrNil ]. |
|
1376 |
stopAsking ifFalse:[ |
|
16519 | 1377 |
warnMessage := (self resources |
19088 | 1378 |
string:'Please enter a description of your changes!!') allRed. |
11532 | 1379 |
]. |
1380 |
stopAsking |
|
1381 |
]. |
|
1382 |
^ dialog |
|
1383 |
||
1384 |
||
1385 |
" |
|
1386 |
self getCheckinInfoFor:'hello' initialAnswer:'bla' |
|
1387 |
" |
|
1388 |
||
1389 |
"Modified: / 06-07-2010 / 11:40:00 / cg" |
|
1390 |
! ! |
|
1391 |
||
1392 |
!PerforceSourceCodeManagerUtilities::SubmitInfoDialog methodsFor:'accessing'! |
|
1393 |
||
1394 |
allowEmptyLogMessage |
|
1395 |
^ allowEmptyLogMessage ? false |
|
1396 |
||
1397 |
"Created: / 06-07-2010 / 11:23:18 / cg" |
|
1398 |
! |
|
1399 |
||
1400 |
allowEmptyLogMessage:aBoolean |
|
1401 |
allowEmptyLogMessage := aBoolean |
|
1402 |
||
1403 |
"Created: / 06-07-2010 / 11:23:31 / cg" |
|
1404 |
! |
|
1405 |
||
1406 |
description |
|
1407 |
^ self descriptionHolder value |
|
1408 |
! |
|
1409 |
||
1410 |
description:aString |
|
1411 |
self descriptionHolder value:aString allBold |
|
1412 |
! |
|
1413 |
||
1414 |
files |
|
1415 |
^ self filesHolder value |
|
1416 |
! |
|
1417 |
||
1418 |
files:aString |
|
1419 |
self filesHolder value:aString |
|
1420 |
! |
|
1421 |
||
1422 |
isStable |
|
1423 |
^ self isStableHolder value |
|
1424 |
! |
|
1425 |
||
1426 |
isStable:aBoolean |
|
1427 |
self isStableHolder value:aBoolean |
|
1428 |
! |
|
1429 |
||
1430 |
logMessage |
|
1431 |
^ self logMessageHolder value |
|
1432 |
! |
|
1433 |
||
1434 |
logMessage:aString |
|
1435 |
self logMessageHolder value:aString |
|
1436 |
! |
|
1437 |
||
1438 |
quickCheckIn |
|
1439 |
^ self quickCheckInHolder value |
|
1440 |
! |
|
1441 |
||
1442 |
quickCheckIn:aBoolean |
|
1443 |
self quickCheckInHolder value:aBoolean |
|
1444 |
! |
|
1445 |
||
1446 |
tag |
|
1447 |
^ self tagHolder value withoutSeparators |
|
1448 |
! |
|
1449 |
||
1450 |
tag:aStringOrNil |
|
1451 |
self tagHolder value:aStringOrNil |
|
1452 |
||
1453 |
"Modified: / 12-09-2006 / 12:03:50 / cg" |
|
1454 |
! |
|
1455 |
||
1456 |
tagIt |
|
1457 |
^ self tag notEmptyOrNil |
|
1458 |
||
1459 |
"Created: / 12-09-2006 / 13:06:49 / cg" |
|
1460 |
! |
|
1461 |
||
1462 |
withQuickOption:aBoolean |
|
1463 |
^ self quickCheckInVisibleHolder value:aBoolean |
|
1464 |
! ! |
|
1465 |
||
1466 |
!PerforceSourceCodeManagerUtilities::SubmitInfoDialog methodsFor:'aspects'! |
|
1467 |
||
1468 |
descriptionHolder |
|
1469 |
descriptionHolder isNil ifTrue:[ |
|
1470 |
descriptionHolder := ValueHolder new. |
|
1471 |
]. |
|
1472 |
^ descriptionHolder |
|
1473 |
! |
|
1474 |
||
1475 |
filesHolder |
|
16183 | 1476 |
"automatically generated by UIPainter ..." |
1477 |
||
11532 | 1478 |
<resource: #uiAspect> |
1479 |
||
1480 |
filesHolder isNil ifTrue:[ |
|
1481 |
filesHolder := '' asValue. |
|
1482 |
]. |
|
1483 |
^ filesHolder. |
|
1484 |
! |
|
1485 |
||
1486 |
isStableHolder |
|
1487 |
isStableHolder isNil ifTrue:[ |
|
1488 |
isStableHolder := false asValue. |
|
1489 |
]. |
|
1490 |
^ isStableHolder. |
|
1491 |
||
1492 |
"Modified: / 16-01-2007 / 16:00:26 / cg" |
|
1493 |
! |
|
1494 |
||
1495 |
logMessageHolder |
|
1496 |
logMessageHolder isNil ifTrue:[ |
|
1497 |
logMessageHolder := LastSourceLogMessage asValue. |
|
1498 |
]. |
|
1499 |
^ logMessageHolder. |
|
1500 |
! |
|
1501 |
||
1502 |
quickCheckInHolder |
|
1503 |
quickCheckInHolder isNil ifTrue:[ |
|
1504 |
quickCheckInHolder := true asValue. |
|
1505 |
]. |
|
1506 |
^ quickCheckInHolder |
|
1507 |
! |
|
1508 |
||
1509 |
quickCheckInVisibleHolder |
|
1510 |
quickCheckInVisibleHolder isNil ifTrue:[ |
|
1511 |
quickCheckInVisibleHolder := false asValue. |
|
1512 |
]. |
|
1513 |
^ quickCheckInVisibleHolder |
|
1514 |
! |
|
1515 |
||
1516 |
tagHolder |
|
1517 |
tagHolder isNil ifTrue:[ |
|
1518 |
tagHolder := '' asValue. |
|
1519 |
]. |
|
1520 |
^ tagHolder |
|
1521 |
! |
|
1522 |
||
1523 |
tagItInHolder |
|
16183 | 1524 |
"automatically generated by UIPainter ..." |
1525 |
||
11532 | 1526 |
<resource: #uiAspect> |
1527 |
||
1528 |
tagItInHolder isNil ifTrue:[ |
|
1529 |
tagItInHolder := true asValue. |
|
1530 |
]. |
|
1531 |
^ tagItInHolder. |
|
1532 |
! |
|
1533 |
||
1534 |
warningMessageHolder |
|
1535 |
warningMessageHolder isNil ifTrue:[ |
|
1536 |
warningMessageHolder := nil asValue. |
|
1537 |
]. |
|
1538 |
^ warningMessageHolder. |
|
1539 |
||
1540 |
"Created: / 06-07-2010 / 11:30:29 / cg" |
|
1541 |
! ! |
|
1542 |
||
1543 |
!PerforceSourceCodeManagerUtilities::WorkSpace class methodsFor:'instance creation'! |
|
1544 |
||
1545 |
newWorkSpaceFor:aSettingsString |
|
1546 |
" |
|
1547 |
get the workspace definition from perforce client command output |
|
1548 |
" |
|
1549 |
||
1550 |
|workSpace| |
|
1551 |
||
1552 |
aSettingsString isEmptyOrNil ifTrue:[ ^nil]. |
|
1553 |
workSpace := self new initialize. |
|
1554 |
^ workSpace newWorkSpaceFor:aSettingsString |
|
1555 |
! |
|
1556 |
||
1557 |
newWorkSpaceForSettings:settingsDict |
|
1558 |
" |
|
1559 |
get the workspace definition from perforce client command output" |
|
1560 |
||
1561 |
|workSpace| |
|
1562 |
||
1563 |
workSpace := self new initialize. |
|
1564 |
^ workSpace newWorkSpaceForSettings:settingsDict |
|
1565 |
! ! |
|
1566 |
||
1567 |
!PerforceSourceCodeManagerUtilities::WorkSpace methodsFor:'accessing'! |
|
1568 |
||
1569 |
client |
|
1570 |
^ client |
|
1571 |
! |
|
1572 |
||
1573 |
client:something |
|
1574 |
client := something. |
|
1575 |
! |
|
1576 |
||
1577 |
host |
|
1578 |
^ host |
|
1579 |
! |
|
1580 |
||
1581 |
host:something |
|
1582 |
host := something. |
|
1583 |
! |
|
1584 |
||
1585 |
owner |
|
1586 |
^ owner |
|
1587 |
! |
|
1588 |
||
1589 |
owner:something |
|
1590 |
owner := something. |
|
1591 |
! |
|
1592 |
||
1593 |
perforceSettings |
|
1594 |
||
1595 |
perforceSettings isNil ifTrue:[ |
|
1596 |
perforceSettings := Dictionary new. |
|
1597 |
]. |
|
1598 |
^ perforceSettings |
|
1599 |
! |
|
1600 |
||
1601 |
perforceSettings:something |
|
1602 |
perforceSettings := something. |
|
1603 |
self owner:(perforceSettings at:#user ifAbsent:nil). |
|
1604 |
self client:(perforceSettings at:#client ifAbsent:nil). |
|
1605 |
! |
|
1606 |
||
1607 |
root |
|
1608 |
^ root |
|
1609 |
! |
|
1610 |
||
1611 |
root:something |
|
1612 |
root := something. |
|
1613 |
! |
|
1614 |
||
1615 |
tempDirectory |
|
1616 |
||
1617 |
tempDirectory isNil ifTrue:[ |
|
1618 |
tempDirectory := PerforceSourceCodeManager createTempDirectory:nil forModule:nil. |
|
1619 |
]. |
|
1620 |
^ tempDirectory |
|
1621 |
! |
|
1622 |
||
1623 |
temporaryWorkSpace |
|
1624 |
^ temporaryWorkSpace |
|
1625 |
! |
|
1626 |
||
1627 |
views |
|
1628 |
views isNil ifTrue:[ |
|
1629 |
views := OrderedCollection new. |
|
1630 |
]. |
|
1631 |
^ views |
|
1632 |
! ! |
|
1633 |
||
1634 |
!PerforceSourceCodeManagerUtilities::WorkSpace methodsFor:'actions'! |
|
1635 |
||
1636 |
addCheckIn:checkInDefinition submit:doSubmit |
|
1637 |
||
1638 |
| packagePath fullFilename s perforceCommand outputStream errorStream result tmpFilename binRevision newRevisionString number| |
|
1639 |
||
1640 |
" create container for class initial check in" |
|
1641 |
checkInDefinition isClassCheckin ifTrue:[ |
|
1642 |
binRevision := checkInDefinition getBinaryRevisionNumber. |
|
1643 |
(binRevision notNil and:[binRevision ~= 0]) ifTrue:[ |
|
1644 |
(Dialog confirm:('Someone seems to have removed the source container for ',checkInDefinition definitionObjectString,'\\Force new checkin ?') withCRs) ifTrue:[ |
|
1645 |
checkInDefinition definitionClass setBinaryRevision:nil. |
|
1646 |
] ifFalse:[ |
|
1647 |
^false |
|
1648 |
]. |
|
1649 |
]. |
|
1650 |
]. |
|
1651 |
"initial checkin here" |
|
1652 |
self activityNotification:'adding ' , checkInDefinition definitionObjectString , ' to perforce repository...'. |
|
1653 |
self getTemporaryWorkspaceFor:checkInDefinition. |
|
1654 |
self temporaryWorkSpace isNil ifTrue:[ |
|
1655 |
self perforceError raiseErrorString:('Error getting temporary workspace when adding ', checkInDefinition definitionObjectString, '.'). |
|
1656 |
^false |
|
1657 |
]. |
|
1658 |
number := self getChangeListNumber. |
|
1659 |
number isNil ifTrue:[ |
|
1660 |
self perforceError raiseErrorString:('Error when getting a change list for ', checkInDefinition definitionObjectString, '.'). |
|
1661 |
^false |
|
1662 |
]. |
|
1663 |
packagePath := Smalltalk packageDirectoryForPackageId:checkInDefinition package. |
|
1664 |
fullFilename := (packagePath construct:checkInDefinition packageDir) construct:checkInDefinition fileName. |
|
1665 |
tmpFilename := self getTemporaryFilenameFor:fullFilename pathName. |
|
1666 |
tmpFilename directory recursiveMakeDirectory. |
|
1667 |
s := tmpFilename writeStream. |
|
1668 |
checkInDefinition isClassCheckin ifTrue:[ |
|
1669 |
newRevisionString := self initialRevisionStringFor:checkInDefinition. |
|
1670 |
PerforceSourceCodeManager updateVersionMethod:(PerforceSourceCodeManager nameOfVersionMethodInClasses) |
|
1671 |
of:checkInDefinition definitionClass |
|
1672 |
for:newRevisionString. |
|
1673 |
]. |
|
1674 |
checkInDefinition isClassCheckin ifTrue:[ |
|
1675 |
PerforceSourceCodeManager fileOutSourceCodeOf:checkInDefinition definitionClass on:s. |
|
1676 |
] ifFalse:[ |
|
1677 |
s nextPutAll:checkInDefinition fileContents. |
|
1678 |
]. |
|
1679 |
s close. |
|
1680 |
perforceCommand := ('add -t +ko -c ' , number printString, ' "', tmpFilename pathName, '"'). |
|
1681 |
outputStream := ReadWriteStream on:''. |
|
1682 |
errorStream := ReadWriteStream on:''. |
|
1683 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
|
1684 |
inputFrom:nil outputTo:outputStream |
|
1685 |
errorTo:errorStream |
|
1686 |
logHeader:('adding ', checkInDefinition definitionObjectString, '.'). |
|
1687 |
result ifFalse:[ |
|
1688 |
checkInDefinition isClassCheckin ifTrue:[ |
|
1689 |
Class withoutUpdatingChangesDo:[ |
|
1690 |
checkInDefinition definitionClass class removeSelector:PerforceSourceCodeManager nameOfVersionMethodInClasses |
|
1691 |
]. |
|
1692 |
]. |
|
1693 |
^ false |
|
1694 |
]. |
|
1695 |
result := self changeChangeDescriptionTo:checkInDefinition logMessage asStringCollection changeNumber:number printString. |
|
1696 |
doSubmit ifTrue:[ |
|
1697 |
result := self submitChangeNumber:number printString. |
|
1698 |
checkInDefinition isClassCheckin ifFalse:[ |
|
1699 |
" checkout in real workspace " |
|
1700 |
perforceCommand := ('sync ' , number printString, ' "', fullFilename pathName, '"'). |
|
1701 |
outputStream := ReadWriteStream on:''. |
|
1702 |
errorStream := ReadWriteStream on:''. |
|
1703 |
result := self executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
|
1704 |
inputFrom:nil outputTo:outputStream |
|
1705 |
errorTo:errorStream |
|
1706 |
logHeader:('sync in my workspace ', checkInDefinition definitionObjectString, '.'). |
|
1707 |
result ifFalse:[ |
|
1708 |
^ false |
|
1709 |
]. |
|
1710 |
]. |
|
1711 |
]. |
|
1712 |
||
1713 |
self activityNotification:''. |
|
1714 |
^result |
|
1715 |
! |
|
1716 |
||
1717 |
askForMergedSource:mergedSource |
|
1718 |
localSource:mySource |
|
1719 |
changesDict:changesDict |
|
1720 |
haveRevision:haveRevision |
|
1721 |
changesAsLogged:changesAsLogged |
|
1722 |
pathName:pathName |
|
1723 |
definitionClass:definitionClass |
|
1724 |
||
1725 |
|msg answer checkInRepaired emphasizedText emSep diffTextComment didAccept editor repairedText resultSource| |
|
1726 |
||
1727 |
(changesDict notNil and:[(changesDict at:#conflicting) > 0]) ifTrue:[ |
|
1728 |
"ooops must resolve conflicts" |
|
1729 |
msg := self messageForConflictsInClass:definitionClass revision:haveRevision. |
|
1730 |
answer := self checkinTroubleDialog:'Version conflict' |
|
1731 |
message:msg |
|
1732 |
log:changesAsLogged |
|
1733 |
abortable:false |
|
1734 |
option:'show conflicts' |
|
1735 |
option2:'resolve conflicts'. |
|
1736 |
||
1737 |
answer == #option ifTrue:[ |
|
1738 |
"/ |
|
1739 |
"/ show conflicts in a 3-way DiffTextView ... |
|
1740 |
"/ |
|
1741 |
Diff3TextView |
|
1742 |
openOnMergedText:mergedSource |
|
1743 |
label:'your version (checkin attempt)' |
|
1744 |
label:'original (base version)' |
|
1745 |
label:'newest repository version'. |
|
1746 |
]. |
|
1747 |
||
1748 |
checkInRepaired := false. |
|
1749 |
answer == #option2 ifTrue:[ |
|
1750 |
"/ |
|
1751 |
"/ allow checkin of repair version |
|
1752 |
"/ this is error prone ... |
|
1753 |
"/ |
|
1754 |
"/ |
|
1755 |
"/ show merged version in an editor ... |
|
1756 |
"/ ... accept will check it in. |
|
1757 |
"/ |
|
1758 |
emphasizedText := mergedSource asStringCollection. |
|
1759 |
emSep := (Array with:(#color->Color black) with:(#backgroundColor->Color green)). |
|
1760 |
emphasizedText := Diff3TextView |
|
1761 |
emphasizeMergedDiff3TextFromPerforce:emphasizedText |
|
1762 |
origEmphasis:(Array with:(#color->Color black) with:(#backgroundColor->Color yellow)) |
|
1763 |
otherEmphasis:(Array with:(#color->Color white) with:(#backgroundColor->Color red)) |
|
1764 |
yourEmphasis:(Array with:(#color->Color white) with:(#backgroundColor->Color red)) |
|
1765 |
separatorEmphasis:emSep. |
|
1766 |
||
1767 |
diffTextComment := self diffTextComment. |
|
1768 |
diffTextComment := (Text string:diffTextComment emphasis:emSep) asStringCollection. |
|
1769 |
emphasizedText := diffTextComment , emphasizedText. |
|
1770 |
||
1771 |
didAccept := false. checkInRepaired := true. |
|
1772 |
[didAccept not and:[checkInRepaired]] whileTrue:[ |
|
1773 |
editor := RCSConflictEditTextView |
|
1774 |
setupWith:emphasizedText |
|
1775 |
title:'Resolve conflicts in ' , pathName asFilename baseName , ', then accept & close to checkin'. |
|
1776 |
||
1777 |
editor acceptAction:[:dummy | |
|
1778 |
repairedText := editor list. |
|
1779 |
didAccept := true. |
|
1780 |
]. |
|
1781 |
didAccept := false. |
|
1782 |
editor topView openModal. |
|
1783 |
||
1784 |
didAccept ifFalse:[ |
|
1785 |
(Dialog confirm:'You did not accept the new text. Edit again ?') |
|
1786 |
ifFalse:[ |
|
1787 |
checkInRepaired := false. |
|
1788 |
] |
|
1789 |
] ifTrue:[ |
|
1790 |
"/ check if all green-stuff (separators) have been removed |
|
1791 |
(repairedText findFirst:[:line | line notNil and:[line notEmpty and:[(line emphasisAt:1) = emSep]]]) ~~ 0 ifTrue:[ |
|
1792 |
self warn:'You have to look at ALL conflicts, and remove ALL green lines as a confirmation !!'. |
|
1793 |
didAccept := false. |
|
1794 |
] |
|
1795 |
]. |
|
1796 |
]. |
|
1797 |
resultSource := repairedText asString string. |
|
1798 |
]. |
|
1799 |
||
1800 |
checkInRepaired ifTrue:[ |
|
16954 | 1801 |
Transcript showCR:'PerforceSourceCodeManager [info]: checking in ' , pathName asFilename baseName , ' (manually repaired version) ...' |
11532 | 1802 |
] ifFalse:[ |
1803 |
'PerforceSourceCodeManager [warning]: cannot (for now) checkin; conflicts found' infoPrintCR. |
|
1804 |
Transcript showCR:'checkin of ' , pathName asFilename baseName , ' aborted (conflicting changes; repository unchanged)'. |
|
1805 |
^ nil. |
|
1806 |
] |
|
1807 |
] ifFalse:[ |
|
1808 |
mySource = mergedSource ifTrue:[ |
|
1809 |
msg := self messageForNoChangesInClass:definitionClass. |
|
1810 |
self checkinTroubleDialog:'Merging versions' |
|
1811 |
message:msg |
|
1812 |
log:changesAsLogged |
|
1813 |
abortable:false |
|
1814 |
option:nil. |
|
1815 |
] ifFalse:[ |
|
1816 |
msg := self messageForChangesInClass:definitionClass revision:haveRevision. |
|
1817 |
answer := self checkinTroubleDialog:'Merging versions' |
|
1818 |
message:msg |
|
1819 |
log:changesAsLogged |
|
1820 |
abortable:true |
|
1821 |
option:'Stop - see first'. |
|
1822 |
answer ~~ true ifTrue:[ |
|
1823 |
answer == #option ifTrue:[ |
|
1824 |
DiffCodeView |
|
1825 |
openOn:mySource |
|
1826 |
label:'current version' |
|
1827 |
and:mergedSource |
|
1828 |
label:'merged version'. |
|
1829 |
||
1830 |
]. |
|
1831 |
Transcript showCR:'checkin aborted - (no merge; repository unchanged)'. |
|
1832 |
^ nil. |
|
1833 |
]. |
|
1834 |
resultSource := mergedSource. |
|
1835 |
]. |
|
1836 |
]. |
|
1837 |
^ resultSource |
|
1838 |
||
1839 |
"Modified (format): / 01-06-2012 / 10:45:09 / cg" |
|
1840 |
! |
|
1841 |
||
1842 |
changeChangeDescriptionTo:logLines changeNumber:changeNumber |
|
1843 |
||
1844 |
|perforceCommand outputStream errorStream changeListFile result changeFileContents changeListFileStream firstIndex oldLogFileLines writeNextLine newLogFileLines currentTokenLineParts currentToken| |
|
1845 |
||
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1846 |
self temporaryWorkSpace isNil ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1847 |
self perforceError raiseErrorString:('Error getting temporary workspace when change the change description for ', changeNumber printString, '.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1848 |
^false. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1849 |
]. |
11532 | 1850 |
perforceCommand := 'change -o ', (changeNumber ? ''). |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1851 |
outputStream := ReadWriteStream on:''. |
11532 | 1852 |
errorStream := ReadWriteStream on:''. |
1853 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1854 |
inDirectory:self tempDirectory |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1855 |
inputFrom:nil |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1856 |
outputTo:outputStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1857 |
errorTo:errorStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1858 |
logHeader:('get change desription for change ', changeNumber printString, '.'). |
11532 | 1859 |
result ifFalse:[ |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1860 |
^ false |
11532 | 1861 |
]. |
1862 |
changeFileContents := outputStream contents. |
|
1863 |
changeFileContents isEmptyOrNil ifTrue:[ |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1864 |
^false |
11532 | 1865 |
]. |
1866 |
changeListFile := self tempDirectory construct:'change'. |
|
1867 |
changeListFileStream := changeListFile writeStream. |
|
1868 |
changeFileContents := changeFileContents asStringCollection. |
|
1869 |
firstIndex := changeFileContents indexOfLineStartingWith:'Description:'. |
|
1870 |
firstIndex == 0 ifTrue:[ |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1871 |
^false |
11532 | 1872 |
]. |
1873 |
oldLogFileLines := StringCollection new. |
|
1874 |
changeFileContents from:firstIndex do:[:aLine| |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1875 |
((aLine size > 1) and:[aLine first ~= $# and:[aLine first isSeparator not]]) ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1876 |
currentTokenLineParts := aLine asCollectionOfSubstringsSeparatedBy:$:. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1877 |
currentTokenLineParts size > 1 ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1878 |
currentToken := currentTokenLineParts first. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1879 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1880 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1881 |
((aLine size > 1) and:[aLine first isSeparator and:[currentToken = 'Description']]) ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1882 |
oldLogFileLines add:(aLine copyFrom:2). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1883 |
]. |
11532 | 1884 |
]. |
1885 |
newLogFileLines := StringCollection new. |
|
1886 |
changeNumber isNil ifTrue:[ |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1887 |
newLogFileLines := logLines. |
11532 | 1888 |
] ifFalse:[ |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1889 |
(oldLogFileLines asString includesString:logLines asString) ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1890 |
newLogFileLines := oldLogFileLines. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1891 |
] ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1892 |
newLogFileLines := oldLogFileLines. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1893 |
newLogFileLines addAll:logLines |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1894 |
]. |
11532 | 1895 |
]. |
1896 |
writeNextLine := true. |
|
1897 |
changeFileContents do:[:aLine| |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1898 |
writeNextLine ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1899 |
(aLine notEmpty and:[aLine first isSeparator not]) ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1900 |
writeNextLine := true. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1901 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1902 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1903 |
writeNextLine ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1904 |
(aLine startsWith:'Description:') ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1905 |
changeListFileStream nextPutLine:aLine. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1906 |
newLogFileLines do:[:logLine| |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1907 |
changeListFileStream nextPut:Character tab. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1908 |
changeListFileStream nextPutLine:logLine. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1909 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1910 |
writeNextLine := false. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1911 |
] ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1912 |
changeListFileStream nextPutLine:aLine |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1913 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1914 |
]. |
11532 | 1915 |
]. |
1916 |
changeListFileStream close. |
|
1917 |
perforceCommand := ('change -i < "', changeListFile pathName, '"'). |
|
1918 |
outputStream := ReadWriteStream on:''. |
|
1919 |
errorStream := ReadWriteStream on:''. |
|
1920 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1921 |
inDirectory:self tempDirectory |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1922 |
inputFrom:nil |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1923 |
outputTo:outputStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1924 |
errorTo:errorStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1925 |
logHeader:('write change desription for change ', changeNumber printString, '.'). |
11532 | 1926 |
result ifFalse:[ |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1927 |
^false |
11532 | 1928 |
]. |
1929 |
^ true |
|
1930 |
! |
|
1931 |
||
1932 |
checkForExistingContainer:checkInDefinition |
|
1933 |
||
1934 |
||
1935 |
|perforceCommand outputStream errorStream result packagePath fullFilename depotPath| |
|
1936 |
||
1937 |
packagePath := Smalltalk packageDirectoryForPackageId:checkInDefinition package. |
|
1938 |
fullFilename := packagePath construct:checkInDefinition packageDir. |
|
1939 |
depotPath := self getDepotPathForLocalPath:fullFilename pathName. |
|
1940 |
perforceCommand := ('dirs "' ,depotPath , '"'). |
|
1941 |
outputStream := ReadWriteStream on:''. |
|
1942 |
errorStream := ReadWriteStream on:''. |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1943 |
self getTemporaryWorkspaceFor:checkInDefinition. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1944 |
self temporaryWorkSpace isNil ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1945 |
self perforceError raiseErrorString:('Error getting temporary workspace when check for existing container ', checkInDefinition definitionObjectString, '.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1946 |
^false. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1947 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1948 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1949 |
inputFrom:nil outputTo:outputStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1950 |
errorTo:errorStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1951 |
logHeader:('dirs in checkForExistingContainer for ', depotPath, '.'). |
11532 | 1952 |
result ifFalse:[ |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1953 |
^ false |
11532 | 1954 |
]. |
1955 |
errorStream contents notEmpty ifTrue:[ |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1956 |
^false |
11532 | 1957 |
]. |
1958 |
^ true |
|
1959 |
! |
|
1960 |
||
1961 |
checkIn:checkInDefinition submit:doSubmit |
|
1962 |
||
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1963 |
| packagePath fullFilename s perforceCommand outputStream errorStream result tmpFilename fileNameAndRev tmpFilenameAndRev |
11532 | 1964 |
haveChange nextVersionMethod diffOutput number baseRevision cls newestInRepository newVersionString openChangeNumber| |
1965 |
||
1966 |
self activityNotification:'checkin ' , checkInDefinition definitionObjectString , ' to perforce repository...'. |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1967 |
[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1968 |
cls := checkInDefinition definitionClass. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1969 |
self getTemporaryWorkspaceFor:checkInDefinition. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1970 |
self temporaryWorkSpace isNil ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1971 |
self perforceError raiseErrorString:('Error getting temporary workspace when check in ', checkInDefinition definitionObjectString, '.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1972 |
^false. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1973 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1974 |
baseRevision := checkInDefinition getLocalRevisionNumber. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1975 |
newestInRepository := checkInDefinition getReposRevisionNumberBeforeCheckin. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1976 |
(checkInDefinition isClassCheckin and:[baseRevision isNil]) ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1977 |
(Dialog confirm:('The version-info of ',checkInDefinition definitionObjectString allBold,' not exists. \Patch the version info?') withCRs) |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1978 |
ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1979 |
newVersionString := self updatedRevisionStringOf:cls |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1980 |
forRevision:newestInRepository printString with:(cls revisionStringOfManager:PerforceSourceCodeManager). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1981 |
PerforceSourceCodeManager updateVersionMethod:(PerforceSourceCodeManager nameOfVersionMethodInClasses) |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1982 |
of:cls |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1983 |
for:newVersionString. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1984 |
baseRevision := checkInDefinition getLocalRevisionNumber. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1985 |
baseRevision notNil ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1986 |
(Dialog confirm:('Check in ', checkInDefinition definitionObjectString allBold, 'based on version ', baseRevision printString, '?') withCRs) |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1987 |
ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1988 |
^false. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1989 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1990 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1991 |
] ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1992 |
^false |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1993 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1994 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1995 |
packagePath := Smalltalk packageDirectoryForPackageId:checkInDefinition package. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1996 |
fullFilename := (packagePath construct:checkInDefinition packageDir) construct:checkInDefinition fileName. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1997 |
tmpFilename := self getTemporaryFilenameFor:fullFilename pathName. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1998 |
tmpFilename directory recursiveMakeDirectory. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
1999 |
checkInDefinition isClassCheckin ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2000 |
baseRevision > newestInRepository ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2001 |
openChangeNumber := self getOpenChangeFor:checkInDefinition. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2002 |
openChangeNumber isNil ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2003 |
(Dialog confirm:('The version-info of ',checkInDefinition definitionObjectString allBold,' is wrong \(The class version (',baseRevision printString allBold,') is newer than the newest version in the repository (',newestInRepository printString allBold,').\\Patch the version and checkin ?') withCRs) |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2004 |
ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2005 |
newVersionString := self updatedRevisionStringOf:cls |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2006 |
forRevision:newestInRepository printString with:(cls revisionStringOfManager:PerforceSourceCodeManager). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2007 |
PerforceSourceCodeManager updateVersionMethod:(PerforceSourceCodeManager nameOfVersionMethodInClasses) |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2008 |
of:cls |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2009 |
for:newVersionString. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2010 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2011 |
cls updateVersionMethodFor:newVersionString. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2012 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2013 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2014 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2015 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2016 |
checkInDefinition isClassCheckin ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2017 |
fileNameAndRev := checkInDefinition fileName, '#', baseRevision printString. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2018 |
] ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2019 |
fileNameAndRev := checkInDefinition fileName, '#', newestInRepository printString. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2020 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2021 |
tmpFilenameAndRev := tmpFilename directory construct:fileNameAndRev. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2022 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2023 |
openChangeNumber notNil ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2024 |
s := tmpFilename writeStream. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2025 |
checkInDefinition isClassCheckin ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2026 |
PerforceSourceCodeManager fileOutSourceCodeOf:cls on:s. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2027 |
] ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2028 |
s nextPutAll:checkInDefinition fileContents. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2029 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2030 |
s close. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2031 |
self changeChangeDescriptionTo:checkInDefinition logMessage asStringCollection changeNumber:openChangeNumber printString. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2032 |
doSubmit ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2033 |
self submitChangeNumber:openChangeNumber printString |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2034 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2035 |
^true |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2036 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2037 |
perforceCommand := ('revert "' , tmpFilename pathName, '"'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2038 |
outputStream := ReadWriteStream on:''. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2039 |
errorStream := ReadWriteStream on:''. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2040 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2041 |
inputFrom:nil outputTo:outputStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2042 |
errorTo:errorStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2043 |
logHeader:('sync ', checkInDefinition definitionObjectString, ' to revision ', baseRevision printString, '.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2044 |
result ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2045 |
^ false |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2046 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2047 |
perforceCommand := ('sync -f "' , tmpFilenameAndRev pathName, '"'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2048 |
outputStream := ReadWriteStream on:''. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2049 |
errorStream := ReadWriteStream on:''. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2050 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2051 |
inputFrom:nil outputTo:outputStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2052 |
errorTo:errorStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2053 |
logHeader:('sync ', checkInDefinition definitionObjectString, ' to revision ', baseRevision printString, '.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2054 |
result ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2055 |
^ false |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2056 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2057 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2058 |
number := self getChangeListNumber. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2059 |
number isNil ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2060 |
self perforceError raiseErrorString:('Error when getting a change list for ', checkInDefinition definitionObjectString, '.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2061 |
^false |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2062 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2063 |
perforceCommand := ('edit -c ' ,number printString, ' "', tmpFilename pathName, '"'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2064 |
outputStream := ReadWriteStream on:''. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2065 |
errorStream := ReadWriteStream on:''. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2066 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2067 |
inputFrom:nil outputTo:outputStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2068 |
errorTo:errorStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2069 |
logHeader:('edit ', checkInDefinition definitionObjectString, '.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2070 |
result ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2071 |
^ false |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2072 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2073 |
s := tmpFilename writeStream. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2074 |
checkInDefinition isClassCheckin ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2075 |
PerforceSourceCodeManager fileOutSourceCodeOf:cls on:s. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2076 |
] ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2077 |
s nextPutAll:checkInDefinition fileContents. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2078 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2079 |
s close. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2080 |
perforceCommand := ('diff -db -dw -dl "' , tmpFilename pathName, '"'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2081 |
outputStream := ReadWriteStream on:''. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2082 |
errorStream := ReadWriteStream on:''. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2083 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2084 |
inputFrom:nil outputTo:outputStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2085 |
errorTo:errorStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2086 |
logHeader:('diff ', checkInDefinition definitionObjectString, '.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2087 |
diffOutput := outputStream contents asStringCollection. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2088 |
haveChange := diffOutput isEmptyOrNil or:[diffOutput notEmptyOrNil and:[diffOutput size > 1]]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2089 |
haveChange ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2090 |
self information:checkInDefinition definitionObjectString, ' not changed for revision ', baseRevision printString. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2091 |
newestInRepository ~= baseRevision ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2092 |
newVersionString := self updatedRevisionStringOf:cls |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2093 |
forRevision:newestInRepository printString with:(cls revisionStringOfManager:PerforceSourceCodeManager). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2094 |
PerforceSourceCodeManager updateVersionMethod:(PerforceSourceCodeManager nameOfVersionMethodInClasses) |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2095 |
of:cls |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2096 |
for:newVersionString. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2097 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2098 |
perforceCommand := ('revert "' , tmpFilename pathName, '"'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2099 |
outputStream := ReadWriteStream on:''. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2100 |
errorStream := ReadWriteStream on:''. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2101 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2102 |
inputFrom:nil outputTo:outputStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2103 |
errorTo:errorStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2104 |
logHeader:('revert ', checkInDefinition definitionObjectString, '.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2105 |
^true |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2106 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2107 |
checkInDefinition isClassCheckin ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2108 |
nextVersionMethod := self nextRevisionStringFor:checkInDefinition. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2109 |
nextVersionMethod isNil ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2110 |
self perforceError raiseErrorString:('Cant get next version method string for ', checkInDefinition definitionObjectString, ' revision ', baseRevision printString, '.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2111 |
^false |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2112 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2113 |
PerforceSourceCodeManager updateVersionMethod:(PerforceSourceCodeManager nameOfVersionMethodInClasses) |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2114 |
of:cls |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2115 |
for:nextVersionMethod. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2116 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2117 |
result := self changeChangeDescriptionTo:checkInDefinition logMessage asStringCollection changeNumber:number printString. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2118 |
doSubmit ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2119 |
result := self submitChangeNumber:number printString |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2120 |
]. |
11532 | 2121 |
] ensure:[ |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2122 |
self activityNotification:''. |
11532 | 2123 |
]. |
2124 |
^result |
|
2125 |
! |
|
2126 |
||
2127 |
createChange |
|
2128 |
||
2129 |
^self changeChangeDescriptionTo:('' asStringCollection) changeNumber:nil |
|
2130 |
! |
|
2131 |
||
2132 |
createWorkSpaceClientSpecFor:checkInDefinition |
|
2133 |
||
2134 |
|ws myView| |
|
2135 |
||
2136 |
ws := WriteStream on:''. |
|
2137 |
ws nextPutAll:'Client: '. |
|
2138 |
ws nextPutAll:(self client). |
|
2139 |
ws cr. |
|
2140 |
ws nextPutAll:'Owner: '. |
|
2141 |
ws nextPutAll:(self owner). |
|
2142 |
ws cr. |
|
2143 |
ws nextPutAll:'Host: '. |
|
2144 |
ws nextPutAll:(self host). |
|
2145 |
ws cr. |
|
2146 |
ws nextPutAll:'Description: '. |
|
2147 |
ws nextPutAll:'Used temporary for Smalltalk/X'. |
|
2148 |
ws cr. |
|
2149 |
ws nextPutAll:'Root: '. |
|
2150 |
ws nextPutAll:(self root asFilename pathName). |
|
2151 |
ws cr. |
|
2152 |
ws nextPutAll:'Options: '. |
|
2153 |
ws nextPutAll:'allwrite noclobber nocompress unlocked nomodtime normdir'. |
|
2154 |
ws cr. |
|
2155 |
ws nextPutAll:'SubmitOptions: '. |
|
2156 |
ws nextPutAll:'submitunchanged'. |
|
2157 |
ws cr. |
|
2158 |
ws nextPutAll:'LineEnd: '. |
|
2159 |
ws nextPutAll:'local'. |
|
2160 |
ws cr. |
|
2161 |
ws nextPutAll:'View: '. |
|
2162 |
myView := checkInDefinition workSpace getViewForPackage:checkInDefinition package. |
|
2163 |
ws nextPutAll:myView depot. |
|
2164 |
ws space. |
|
2165 |
ws nextPutAll:'//', self client, '/...'. |
|
2166 |
ws cr. |
|
2167 |
ws close. |
|
2168 |
^ws contents |
|
2169 |
! |
|
2170 |
||
2171 |
delete:checkInDefinition submit:doSubmit |
|
2172 |
||
2173 |
| packagePath fullFilename perforceCommand outputStream errorStream result tmpFilename number newestInRepository| |
|
2174 |
||
2175 |
self activityNotification:'delete ' , checkInDefinition definitionObjectString , ' from perforce repository...'. |
|
2176 |
[ |
|
2177 |
newestInRepository := checkInDefinition getReposRevisionNumberBeforeCheckin. |
|
2178 |
newestInRepository isNil ifTrue:[ |
|
2179 |
self information:(checkInDefinition definitionObjectString, ' not exists in repository.'). |
|
2180 |
^true |
|
2181 |
]. |
|
2182 |
self getTemporaryWorkspaceFor:checkInDefinition. |
|
2183 |
self temporaryWorkSpace isNil ifTrue:[ |
|
2184 |
self perforceError raiseErrorString:('Error getting temporary workspace when check in ', checkInDefinition definitionObjectString, '.'). |
|
2185 |
^false. |
|
2186 |
]. |
|
2187 |
packagePath := Smalltalk packageDirectoryForPackageId:checkInDefinition package. |
|
2188 |
fullFilename := (packagePath construct:checkInDefinition packageDir) construct:checkInDefinition fileName. |
|
2189 |
tmpFilename := self getTemporaryFilenameFor:fullFilename pathName. |
|
2190 |
tmpFilename directory recursiveMakeDirectory. |
|
2191 |
||
2192 |
number := self getChangeListNumber. |
|
2193 |
number isNil ifTrue:[ |
|
2194 |
self perforceError raiseErrorString:('Error when getting a change list for ', checkInDefinition definitionObjectString, '.'). |
|
2195 |
^false |
|
2196 |
]. |
|
2197 |
perforceCommand := ('delete -c ' ,number printString, ' "', tmpFilename pathName, '"'). |
|
2198 |
outputStream := ReadWriteStream on:''. |
|
2199 |
errorStream := ReadWriteStream on:''. |
|
2200 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
|
2201 |
inputFrom:nil outputTo:outputStream |
|
2202 |
errorTo:errorStream |
|
2203 |
logHeader:('Error delete ', checkInDefinition definitionObjectString, '.'). |
|
2204 |
result ifFalse:[ |
|
2205 |
^ false |
|
2206 |
]. |
|
2207 |
result := self changeChangeDescriptionTo:checkInDefinition logMessage asStringCollection changeNumber:number printString. |
|
2208 |
doSubmit ifTrue:[ |
|
2209 |
result := self submitChangeNumber:number printString |
|
2210 |
]. |
|
2211 |
] ensure:[ |
|
2212 |
self activityNotification:''. |
|
2213 |
]. |
|
2214 |
^result |
|
2215 |
! |
|
2216 |
||
2217 |
deleteWorkSpaceFromServer |
|
2218 |
||
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2219 |
|perforceCommand outputStream errorStream result tmpWorkSpace| |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2220 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2221 |
tmpWorkSpace := self temporaryWorkSpace. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2222 |
tmpWorkSpace isNil ifTrue:[ ^true]. |
11532 | 2223 |
perforceCommand := ('client -df ', client). |
2224 |
outputStream := ReadWriteStream on:''. |
|
2225 |
errorStream := ReadWriteStream on:''. |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2226 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2227 |
inputFrom:nil outputTo:outputStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2228 |
errorTo:errorStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2229 |
logHeader:('delete client ', client). |
11532 | 2230 |
result ifFalse:[ |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2231 |
^ false |
11532 | 2232 |
]. |
2233 |
^true |
|
2234 |
! |
|
2235 |
||
2236 |
getChangeDespriptionInfoFor:changeNumber |
|
2237 |
||
2238 |
|valuePairs startLineIndex keyEndIndex changeContents cmd outputStream errorStream result keyValues beginLine endLine keyName keyValue| |
|
2239 |
||
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2240 |
self temporaryWorkSpace isNil ifTrue:[ |
16059 | 2241 |
self perforceError raiseErrorString:('Error getting temporary workspace when try to get change description for ', changeNumber printString, '.'). |
2242 |
^nil. |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2243 |
]. |
11532 | 2244 |
valuePairs := OrderedCollection new. |
2245 |
cmd := 'change -o ', (changeNumber ? ''). |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2246 |
outputStream := ReadWriteStream on:''. |
11532 | 2247 |
errorStream := ReadWriteStream on:''. |
2248 |
result := self temporaryWorkSpace executePerforceCommand:cmd |
|
16059 | 2249 |
inDirectory:self tempDirectory |
2250 |
inputFrom:nil |
|
2251 |
outputTo:outputStream |
|
2252 |
errorTo:errorStream |
|
2253 |
logHeader:('getting change description ', (changeNumber ? ''), '.'). |
|
11532 | 2254 |
result ifFalse:[ |
16059 | 2255 |
^ nil |
11532 | 2256 |
]. |
2257 |
changeContents := outputStream contents asStringCollection. |
|
2258 |
changeContents doWithIndex:[:aLine :index| |
|
16059 | 2259 |
startLineIndex isNil ifTrue:[ |
2260 |
(aLine isEmpty or:[(aLine startsWith:$#) or:[aLine first isSeparator]]) ifFalse:[ |
|
2261 |
keyEndIndex := aLine indexOf:$:. |
|
2262 |
keyEndIndex ~~ 0 ifTrue:[ |
|
2263 |
startLineIndex := index. |
|
2264 |
valuePairs add:(Array with:index with:nil with:(aLine copyTo:keyEndIndex - 1)). |
|
2265 |
]. |
|
2266 |
]. |
|
2267 |
] ifFalse:[ |
|
2268 |
(aLine isEmpty or:[aLine startsWith:$#]) ifTrue:[ |
|
2269 |
valuePairs last at:2 put:index. |
|
2270 |
startLineIndex := nil. |
|
2271 |
]. |
|
2272 |
]. |
|
11532 | 2273 |
]. |
2274 |
keyValues := Dictionary new. |
|
2275 |
valuePairs do:[:each| |
|
16059 | 2276 |
beginLine := each first. |
2277 |
endLine := each second. |
|
2278 |
keyName := each last. |
|
2279 |
(beginLine == (endLine - 1)) ifTrue:[ |
|
2280 |
keyValue := (changeContents at:beginLine) copyFrom:(keyName size + 2). |
|
2281 |
keyValue := (keyValue withoutLeadingSeparators withoutTrailingSeparators) asStringCollection. |
|
2282 |
] ifFalse:[ |
|
2283 |
keyValue := changeContents copyFrom:(beginLine + 1) to:(endLine - 1). |
|
2284 |
keyValue := keyValue collect:[:each | each withoutLeadingSeparators withoutTrailingSeparators]. |
|
2285 |
]. |
|
2286 |
keyValues at:keyName put:keyValue. |
|
11532 | 2287 |
]. |
2288 |
^ keyValues. |
|
2289 |
! |
|
2290 |
||
2291 |
getChangeListNumber |
|
2292 |
||
2293 |
|numbers| |
|
2294 |
||
2295 |
numbers := self getCurrentChangeListNumbers. |
|
2296 |
numbers notEmptyOrNil ifTrue:[ |
|
2297 |
^numbers first. |
|
2298 |
]. |
|
2299 |
self createChange ifTrue:[ |
|
2300 |
numbers := self getCurrentChangeListNumbers. |
|
2301 |
numbers notEmptyOrNil ifTrue:[ |
|
2302 |
^numbers first. |
|
2303 |
]. |
|
2304 |
||
2305 |
]. |
|
2306 |
^nil |
|
2307 |
! |
|
2308 |
||
2309 |
getCurrentChangeListNumbers |
|
2310 |
||
2311 |
|perforceCommand outputStream errorStream result pendingChangesOutput words numbers number| |
|
2312 |
||
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2313 |
self temporaryWorkSpace isNil ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2314 |
self perforceError raiseErrorString:('Error getting temporary workspace when try to get change numbers.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2315 |
^nil. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2316 |
]. |
11532 | 2317 |
perforceCommand := 'changes -s pending -u ', owner. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2318 |
outputStream := ReadWriteStream on:''. |
11532 | 2319 |
errorStream := ReadWriteStream on:''. |
2320 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2321 |
inDirectory:self tempDirectory |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2322 |
inputFrom:nil |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2323 |
outputTo:outputStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2324 |
errorTo:errorStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2325 |
doLog:false. |
11532 | 2326 |
result ifFalse:[ |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2327 |
^ nil |
11532 | 2328 |
]. |
2329 |
numbers := OrderedCollection new. |
|
2330 |
pendingChangesOutput := outputStream contents asStringCollection. |
|
2331 |
pendingChangesOutput do:[:eachLine| |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2332 |
words := eachLine asCollectionOfWords. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2333 |
words size > 1 ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2334 |
number := Number readFrom:(ReadStream on:(words at:2)) onError:nil. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2335 |
numbers add:number. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2336 |
]. |
11532 | 2337 |
]. |
2338 |
^numbers |
|
2339 |
! |
|
2340 |
||
2341 |
getFileStatForPathname:aPathname |
|
2342 |
||
2343 |
||
2344 |
|perforceCommand outputStream errorStream result fileStatDict endOfKeywordIndex keyWord keyValue| |
|
2345 |
||
2346 |
perforceCommand := ('fstat "' , aPathname, '"'). |
|
2347 |
outputStream := ReadWriteStream on:''. |
|
2348 |
errorStream := ReadWriteStream on:''. |
|
2349 |
result := self executePerforceCommand:perforceCommand inDirectory:self root |
|
2350 |
inputFrom:nil outputTo:outputStream |
|
2351 |
errorTo:errorStream |
|
2352 |
logHeader:('getting file status from ', aPathname, '.'). |
|
2353 |
result ifFalse:[ |
|
2354 |
^ nil |
|
2355 |
]. |
|
2356 |
fileStatDict := Dictionary new. |
|
2357 |
outputStream contents asStringCollection do:[:aLine| |
|
2358 |
endOfKeywordIndex := aLine indexOfSeparatorStartingAt:5. |
|
2359 |
keyWord := aLine copyFrom:5 to:(endOfKeywordIndex - 1). |
|
2360 |
keyValue := aLine copyFrom:endOfKeywordIndex + 1. |
|
2361 |
fileStatDict at:keyWord put:keyValue. |
|
2362 |
]. |
|
2363 |
^ fileStatDict |
|
2364 |
||
2365 |
" |
|
2366 |
| workSpace tempWorkSpace dict| |
|
2367 |
workSpace := PerforceSourceCodeManager getWorkSpaceForPackage:'applistx'. |
|
2368 |
tempWorkSpace := workSpace temporaryWorkSpace. |
|
2369 |
dict := tempWorkSpace getFileStatForPathname:'C:\Dokumente und Einstellungen\gds2180\Lokale Einstellungen\Temp\stx_tmp\st6120368\applistx\util\libDataType\ActionLQualifier.st'. |
|
2370 |
dict includesKey:'unresolved' |
|
2371 |
" |
|
2372 |
! |
|
2373 |
||
2374 |
getOpenChangeFor:checkInDefinition |
|
2375 |
||
2376 |
|numbers changeDescr files versionInfo| |
|
2377 |
||
2378 |
numbers := self getCurrentChangeListNumbers. |
|
2379 |
numbers notEmptyOrNil ifTrue:[ |
|
2380 |
numbers do:[:changeNumber| |
|
2381 |
changeDescr := self getChangeDespriptionInfoFor:changeNumber printString. |
|
2382 |
files := changeDescr at:#Files ifAbsent:[nil]. |
|
2383 |
files notNil ifTrue:[ |
|
2384 |
versionInfo := PerforceSourceCodeManager versionInfoClass fromRCSString:checkInDefinition getLocalRevisionString. |
|
2385 |
files do:[:aFileAndAction| |
|
2386 |
(aFileAndAction startsWith:versionInfo repositoryPathName) ifTrue:[ |
|
2387 |
^changeNumber |
|
2388 |
]. |
|
2389 |
]. |
|
2390 |
]. |
|
2391 |
]. |
|
2392 |
]. |
|
2393 |
^nil |
|
2394 |
! |
|
2395 |
||
2396 |
getTemporaryWorkspaceFor:checkInDefinition |
|
2397 |
" |
|
2398 |
create an temporary workspace for handle checkin |
|
2399 |
" |
|
2400 |
||
2401 |
|workSpaceName workSpaceDefinitionFilename ws perforceCommand result readStream directory |
|
2402 |
settingsTemporary myView outputStream errorStream lineStream clientSpec index words| |
|
2403 |
||
2404 |
directory := self tempDirectory. |
|
2405 |
workSpaceName := self temporaryClientName. |
|
2406 |
perforceCommand := 'clients -u ' , (self perforceSettings at:#user). |
|
2407 |
outputStream := ReadWriteStream on:''. |
|
2408 |
errorStream := ReadWriteStream on:''. |
|
2409 |
result := self executePerforceCommand:perforceCommand |
|
2410 |
inDirectory:directory pathName |
|
2411 |
inputFrom:nil |
|
2412 |
outputTo:outputStream |
|
2413 |
errorTo:errorStream |
|
2414 |
doLog:false |
|
2415 |
logHeader:('check for existing workspace client.'). |
|
2416 |
result ifFalse:[ |
|
2417 |
temporaryWorkSpace := nil. |
|
2418 |
]. |
|
19123 | 2419 |
index := |
2420 |
outputStream contents asStringCollection |
|
2421 |
findFirst:[:aLine| |
|
2422 |
words := aLine asCollectionOfWords. |
|
2423 |
words size > 1 and:[words second = workSpaceName] |
|
2424 |
]. |
|
2425 |
index == 0 ifTrue:[ |
|
11532 | 2426 |
temporaryWorkSpace := nil. |
2427 |
]. |
|
2428 |
temporaryWorkSpace isNil ifTrue:[ |
|
2429 |
directory exists ifFalse:[ |
|
2430 |
self perforceError raiseErrorString:('Perforce temporary workspace directory ', directory pathName, ' not exists.'). |
|
2431 |
^nil |
|
2432 |
]. |
|
2433 |
settingsTemporary := self perforceSettings copy. |
|
2434 |
settingsTemporary at:#client put:workSpaceName. |
|
2435 |
temporaryWorkSpace := self class newWorkSpaceForSettings:settingsTemporary. |
|
2436 |
temporaryWorkSpace root:directory asFilename pathName. |
|
2437 |
temporaryWorkSpace host:self host. |
|
2438 |
myView := self getViewForPackage:checkInDefinition package. |
|
2439 |
lineStream := WriteStream on:''. |
|
2440 |
lineStream nextPutAll:myView depot. |
|
2441 |
lineStream space. |
|
2442 |
lineStream nextPutAll:'//', workSpaceName, '/...'. |
|
2443 |
temporaryWorkSpace views add:(View newFromLine:lineStream contents workspace:temporaryWorkSpace). |
|
2444 |
workSpaceDefinitionFilename := directory asFilename construct:workSpaceName. |
|
2445 |
clientSpec := temporaryWorkSpace createWorkSpaceClientSpecFor:checkInDefinition. |
|
2446 |
ws := workSpaceDefinitionFilename writeStream. |
|
2447 |
ws nextPutAll:clientSpec. |
|
2448 |
ws close. |
|
2449 |
||
2450 |
readStream := ReadStream on:clientSpec. |
|
2451 |
perforceCommand := 'client -i < "', workSpaceDefinitionFilename pathName, '"'. |
|
2452 |
outputStream := ReadWriteStream on:''. |
|
2453 |
errorStream := ReadWriteStream on:''. |
|
2454 |
result := temporaryWorkSpace executePerforceCommand:perforceCommand |
|
2455 |
inDirectory:directory pathName |
|
2456 |
inputFrom:nil |
|
2457 |
outputTo:outputStream |
|
2458 |
errorTo:errorStream |
|
2459 |
doLog:false |
|
2460 |
logHeader:('writing temporary workspace definition.'). |
|
2461 |
result ifFalse:[ |
|
2462 |
temporaryWorkSpace := nil. |
|
2463 |
]. |
|
2464 |
]. |
|
2465 |
^temporaryWorkSpace |
|
2466 |
! |
|
2467 |
||
2468 |
mergeOrResolveConflictsForChangeNumber:aNumber |
|
2469 |
||
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2470 |
| tmpFilename perforceCommand outputStream errorStream result s |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2471 |
changesAsLogged inStream line changesDict chunksPart words mergedSource mySource |
11532 | 2472 |
localRevision resultSource definitionClass descriptionInfo resolveFiles depotPath localPath checkInDefinition fileStatDict| |
2473 |
||
2474 |
self temporaryWorkSpace isNil ifTrue:[ |
|
16876 | 2475 |
self perforceError raiseErrorString:('Error getting temporary workspace when try to merge or resolve conflicts for ', aNumber printString, '.'). |
2476 |
^false. |
|
11532 | 2477 |
]. |
2478 |
descriptionInfo := (self getChangeDespriptionInfoFor:aNumber printString). |
|
2479 |
descriptionInfo isNil ifTrue:[ |
|
16876 | 2480 |
^false. |
11532 | 2481 |
]. |
2482 |
resolveFiles := descriptionInfo at:#Files ifAbsent:nil. |
|
2483 |
resolveFiles isNil ifTrue:[ |
|
16876 | 2484 |
^false. |
11532 | 2485 |
]. |
2486 |
resolveFiles do:[:aFileLine| |
|
16876 | 2487 |
depotPath := (aFileLine copyTo:((aFileLine lastIndexOf:$#) - 1 )) withoutTrailingSeparators. |
2488 |
localPath := self temporaryWorkSpace getLocalPathForDepotPath:depotPath. |
|
2489 |
fileStatDict := self temporaryWorkSpace getFileStatForPathname:localPath. |
|
2490 |
(fileStatDict includesKey:'unresolved') ifTrue:[ |
|
2491 |
definitionClass := Smalltalk at:(localPath asFilename withoutSuffix baseName asSymbol) ifAbsent:nil. |
|
2492 |
checkInDefinition := PerforceSourceCodeManager getCheckInDefinitionForClass:definitionClass. |
|
2493 |
localRevision := checkInDefinition getLocalRevisionNumber. |
|
2494 |
tmpFilename := localPath asFilename. |
|
2495 |
perforceCommand := ('resolve -af "' , tmpFilename pathName, '"'). |
|
2496 |
outputStream := ReadWriteStream on:''. |
|
2497 |
errorStream := ReadWriteStream on:''. |
|
2498 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
|
2499 |
inputFrom:nil outputTo:outputStream |
|
2500 |
errorTo:errorStream |
|
2501 |
logHeader:('resolving ', tmpFilename pathName, '.'). |
|
2502 |
result ifFalse:[ |
|
2503 |
^ false |
|
2504 |
]. |
|
2505 |
"check for conflicts" |
|
2506 |
changesAsLogged := StringCollection new. |
|
2507 |
inStream := ReadStream on:(outputStream contents). |
|
2508 |
||
2509 |
[inStream atEnd not] whileTrue:[ |
|
2510 |
line:= inStream nextLine. |
|
2511 |
line notNil ifTrue:[ |
|
2512 |
(line startsWith:'Diff chunks:') ifTrue:[ |
|
2513 |
changesAsLogged add:line. |
|
2514 |
changesDict := Dictionary new. |
|
2515 |
chunksPart := line copyFrom:('Diff chunks:' size + 1). |
|
2516 |
(chunksPart asCollectionOfSubstringsSeparatedBy:$+) do:[:eachElement| |
|
2517 |
words := eachElement asCollectionOfWords. |
|
2518 |
changesDict at:words second asSymbol put:words first asNumber. |
|
2519 |
]. |
|
2520 |
]. |
|
2521 |
]. |
|
2522 |
]. |
|
2523 |
s := WriteStream on:''. |
|
2524 |
PerforceSourceCodeManager fileOutSourceCodeOf:definitionClass on:s. |
|
2525 |
mergedSource := tmpFilename readStream contents asString. |
|
2526 |
mySource := s contents asString. |
|
2527 |
resultSource := self askForMergedSource:mergedSource |
|
2528 |
localSource:mySource |
|
2529 |
changesDict:changesDict |
|
2530 |
haveRevision:(fileStatDict at:'haveRev' ifAbsent:nil) |
|
2531 |
changesAsLogged:changesAsLogged |
|
2532 |
pathName:tmpFilename pathName |
|
2533 |
definitionClass:definitionClass. |
|
2534 |
resultSource isNil ifTrue:[ |
|
2535 |
^false. |
|
2536 |
]. |
|
2537 |
"now we have a merge - lets get latest revision and write on it " |
|
2538 |
perforceCommand := ('revert "' , tmpFilename pathName, '"'). |
|
2539 |
outputStream := ReadWriteStream on:''. |
|
2540 |
errorStream := ReadWriteStream on:''. |
|
2541 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
|
2542 |
inputFrom:nil outputTo:outputStream |
|
2543 |
errorTo:errorStream |
|
2544 |
logHeader:('revert after resolving ', tmpFilename pathName, '.'). |
|
2545 |
result ifFalse:[ |
|
2546 |
^ false |
|
2547 |
]. |
|
2548 |
||
2549 |
tmpFilename remove. |
|
2550 |
||
2551 |
perforceCommand := ('sync -f "' , tmpFilename pathName, '"'). |
|
2552 |
outputStream := ReadWriteStream on:''. |
|
2553 |
errorStream := ReadWriteStream on:''. |
|
2554 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
|
2555 |
inputFrom:nil outputTo:outputStream |
|
2556 |
errorTo:errorStream |
|
2557 |
logHeader:('sync after resolving ', tmpFilename pathName, '.'). |
|
2558 |
result ifFalse:[ |
|
2559 |
^ false |
|
2560 |
]. |
|
2561 |
||
2562 |
perforceCommand := ('edit -c ', aNumber printString, ' "' , tmpFilename pathName, '"'). |
|
2563 |
outputStream := ReadWriteStream on:''. |
|
2564 |
errorStream := ReadWriteStream on:''. |
|
2565 |
result := self temporaryWorkSpace executePerforceCommand:perforceCommand inDirectory:self temporaryWorkSpace root |
|
2566 |
inputFrom:nil outputTo:outputStream |
|
2567 |
errorTo:errorStream |
|
2568 |
logHeader:('edit after resolving ', tmpFilename pathName, '.'). |
|
2569 |
result ifFalse:[ |
|
2570 |
^ false |
|
2571 |
]. |
|
2572 |
||
2573 |
"write my result" |
|
2574 |
resultSource notNil ifTrue:[ |
|
2575 |
s := tmpFilename writeStream. |
|
2576 |
s nextPutAll:resultSource. |
|
2577 |
s close. |
|
2578 |
]. |
|
2579 |
]. |
|
11532 | 2580 |
]. |
2581 |
^true |
|
2582 |
! |
|
2583 |
||
2584 |
releaseWorkSpace |
|
2585 |
||
2586 |
temporaryWorkSpace notNil ifTrue:[ |
|
2587 |
temporaryWorkSpace deleteWorkSpaceFromServer. |
|
2588 |
]. |
|
2589 |
tempDirectory notNil ifTrue:[ |
|
2590 |
tempDirectory recursiveRemove. |
|
2591 |
]. |
|
2592 |
! |
|
2593 |
||
2594 |
revisionLogOf:clsOrNil |
|
14665
9cc738d8e4e7
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
14333
diff
changeset
|
2595 |
fromRevision:firstRev toRevision:lastRef numberOfRevisions:numRevisions |
9cc738d8e4e7
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
14333
diff
changeset
|
2596 |
fileName:classFileName directory:packageDir module:aPackage |
9cc738d8e4e7
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
14333
diff
changeset
|
2597 |
|
9cc738d8e4e7
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
14333
diff
changeset
|
2598 |
"actually do return a revisionLog. The main worker method." |
11532 | 2599 |
|
2600 |
|atEnd line inHeaderInfo info record revisionRecords headerOnly msg revArg infoAndLogString elements |
|
2601 |
foundView outputStream errorStream inStream packagePath fullFilename depotPath perforceCommand result labelLineElements tags label revision| |
|
2602 |
||
2603 |
[ |
|
2604 |
revArg := ''. |
|
2605 |
headerOnly := false. |
|
2606 |
(firstRev notNil or:[lastRef notNil]) ifTrue:[ |
|
2607 |
(firstRev == 0 and:[lastRef == 0]) ifTrue:[ |
|
2608 |
headerOnly := true. |
|
2609 |
] |
|
2610 |
]. |
|
2611 |
foundView := self getViewForPackage:aPackage. |
|
2612 |
headerOnly ifTrue:[ |
|
2613 |
msg := 'fetching revision info ' |
|
2614 |
] ifFalse:[ |
|
2615 |
msg := 'reading revision log ' |
|
2616 |
]. |
|
2617 |
clsOrNil isNil ifTrue:[ |
|
2618 |
foundView notNil ifTrue:[ |
|
2619 |
msg := msg , 'in ', foundView local. |
|
2620 |
]. |
|
2621 |
] ifFalse:[ |
|
2622 |
msg := msg , 'of ', clsOrNil name. |
|
2623 |
]. |
|
2624 |
self activityNotification:msg,'...'. |
|
2625 |
packagePath := Smalltalk packageDirectoryForPackageId:aPackage. |
|
2626 |
fullFilename := (packagePath construct:packageDir) construct:classFileName. |
|
2627 |
depotPath := foundView getDepotPathForLocalPath:fullFilename pathName. |
|
2628 |
perforceCommand := ('filelog "' , depotPath, '"'). |
|
2629 |
outputStream := ReadWriteStream on:''. |
|
2630 |
errorStream := ReadWriteStream on:''. |
|
2631 |
result := self executePerforceCommand:perforceCommand inDirectory:self root |
|
2632 |
inputFrom:nil outputTo:outputStream |
|
2633 |
errorTo:errorStream |
|
2634 |
logHeader:('getting filelog ', depotPath, '.'). |
|
2635 |
result ifFalse:[ |
|
2636 |
^ nil |
|
2637 |
]. |
|
2638 |
||
2639 |
"/ |
|
2640 |
"/ read the commands pipe output and extract the container info |
|
2641 |
"/ |
|
2642 |
info := IdentityDictionary new. |
|
2643 |
inHeaderInfo := true. |
|
2644 |
revisionRecords := OrderedCollection new. |
|
2645 |
info at:#revisions put:revisionRecords. |
|
2646 |
inStream := ReadStream on:(outputStream contents). |
|
2647 |
[inHeaderInfo and:[inStream atEnd not]] whileTrue:[ |
|
2648 |
line:= inStream nextLine. |
|
2649 |
line notNil ifTrue:[ |
|
2650 |
|gotIt| |
|
2651 |
||
2652 |
gotIt := false. |
|
2653 |
infoAndLogString := line asCollectionOfSubstringsSeparatedBy:$'. |
|
2654 |
elements := infoAndLogString size. |
|
2655 |
elements > 1 ifTrue:[ |
|
2656 |
record := self readRevisionLogEntryFromString:line. |
|
2657 |
((record at:#state ifAbsent:'') = 'delete') ifTrue:[ |
|
2658 |
info at:#newestRevision put:#deleted. |
|
2659 |
] ifFalse:[ |
|
2660 |
info at:#newestRevision put:(record at:#revision). |
|
2661 |
]. |
|
2662 |
info at:#numberOfRevisions put:((record at:#revision) asNumber). |
|
2663 |
revisionRecords add:record. |
|
2664 |
inHeaderInfo := false |
|
2665 |
]. |
|
2666 |
] |
|
2667 |
]. |
|
2668 |
||
2669 |
info isEmpty ifTrue:[ |
|
2670 |
('PerforceSourceCodeManager [warning]: no log for ', depotPath) errorPrintCR. |
|
2671 |
^ nil |
|
2672 |
]. |
|
2673 |
||
2674 |
"/ strip selected revisions from the total-revisions entry |
|
2675 |
headerOnly ifFalse:[ |
|
2676 |
"/ |
|
2677 |
"/ continue to read the commands pipe output |
|
2678 |
"/ and extract revision info records |
|
2679 |
"/ |
|
2680 |
atEnd := false. |
|
2681 |
[atEnd or:[inStream atEnd]] whileFalse:[ |
|
2682 |
record := self readRevisionLogEntryFromStream:inStream. |
|
2683 |
record isNil ifTrue:[ |
|
2684 |
atEnd := true. |
|
2685 |
] ifFalse:[ |
|
2686 |
revisionRecords add:record. |
|
2687 |
]. |
|
2688 |
(numRevisions notNil and:[revisionRecords size >= numRevisions]) ifTrue:[ |
|
2689 |
atEnd := true |
|
2690 |
] |
|
2691 |
]. |
|
2692 |
]. |
|
2693 |
] ensure:[ |
|
2694 |
outputStream notNil ifTrue:[outputStream close]. |
|
2695 |
self activityNotification:nil. |
|
2696 |
]. |
|
2697 |
perforceCommand := ('labels "' , depotPath, '"'). |
|
2698 |
outputStream := ReadWriteStream on:''. |
|
2699 |
errorStream := ReadWriteStream on:''. |
|
2700 |
result := self executePerforceCommand:perforceCommand inDirectory:self root |
|
2701 |
inputFrom:nil outputTo:outputStream |
|
2702 |
errorTo:errorStream |
|
2703 |
logHeader:('getting labels ', depotPath, '.'). |
|
2704 |
result ifFalse:[ |
|
2705 |
^ nil |
|
2706 |
]. |
|
2707 |
inStream := ReadStream on:(outputStream contents). |
|
2708 |
tags := Dictionary new. |
|
2709 |
[inStream atEnd not] whileTrue:[ |
|
2710 |
line:= inStream nextLine. |
|
2711 |
line notEmptyOrNil ifTrue:[ |
|
2712 |
labelLineElements := line asCollectionOfWords. |
|
2713 |
elements := labelLineElements size. |
|
2714 |
elements > 1 ifTrue:[ |
|
2715 |
label := labelLineElements second withoutSeparators. |
|
2716 |
revision := self getRevisionForLabel:label depotPath:depotPath. |
|
2717 |
tags at:(labelLineElements second withoutSeparators) put:revision. |
|
2718 |
]. |
|
2719 |
] |
|
2720 |
]. |
|
2721 |
info at:#symbolicNames put:tags. |
|
2722 |
||
2723 |
^ info |
|
2724 |
! |
|
2725 |
||
16806 | 2726 |
setSymbolicName:symbolicNameArg revision:rev overWrite:overWriteBool pathes:pathsInRepository |
11532 | 2727 |
"set a symbolicName for revision rev. |
2728 |
If rev is nil, set it for the head (most recent) revision. |
|
2729 |
If rev is 0, delete the symbolic name. |
|
2730 |
If overWriteBool is true, the symbolicName will be changed, even if it has already been set. |
|
2731 |
If overWriteBool is false, an error will be raised if symbolicName has already been set. |
|
2732 |
||
2733 |
If filename is nil, the symbolicName for a whole package is set. |
|
16806 | 2734 |
If multiple paths are given, the revision MUST be nil." |
11532 | 2735 |
|
2736 |
|argumentString result errorStream moduleDirs symbolicName perforceCommand outputStream| |
|
2737 |
||
16806 | 2738 |
symbolicName := (symbolicNameArg includes:Character space) |
11532 | 2739 |
ifTrue:[ '"',symbolicNameArg,'"' ] |
2740 |
ifFalse:[ symbolicNameArg ]. |
|
2741 |
||
16806 | 2742 |
pathsInRepository size > 1 ifTrue:[ |
2743 |
self assert:(rev isNil or:[rev == 0]) "revision must be nil (for head) or 0 (for delete) with multiple paths" |
|
11532 | 2744 |
]. |
2745 |
||
16806 | 2746 |
moduleDirs := pathsInRepository |
11532 | 2747 |
collect:[:pathInRepository | |
2748 |
(pathInRepository asCollectionOfSubstringsSeparatedByAny:'/\') first. |
|
2749 |
]. |
|
2750 |
moduleDirs do:[:moduleDir | |
|
16806 | 2751 |
|pathsInModule pathsInModuleAsArgument| |
2752 |
||
2753 |
pathsInModule := pathsInRepository |
|
11532 | 2754 |
select:[:pathInRepository | |
2755 |
|moduleOfThisPath| |
|
2756 |
||
2757 |
moduleOfThisPath := (pathInRepository asCollectionOfSubstringsSeparatedByAny:'/\') first. |
|
2758 |
moduleOfThisPath = moduleDir |
|
2759 |
]. |
|
2760 |
||
2761 |
rev = 0 ifTrue:[ |
|
2762 |
argumentString := ' -d '. |
|
2763 |
] ifFalse:[ |
|
2764 |
argumentString := ' -r ', (rev ? 'HEAD'). |
|
2765 |
overWriteBool ifTrue:[ |
|
2766 |
argumentString := argumentString, ' -F' |
|
2767 |
]. |
|
2768 |
]. |
|
2769 |
||
16806 | 2770 |
pathsInModuleAsArgument := pathsInModule |
11532 | 2771 |
collect:[:eachPath | |
2772 |
(eachPath includes:Character space) ifTrue:[ |
|
2773 |
'"',eachPath,'"' |
|
2774 |
] ifFalse:[ |
|
2775 |
eachPath |
|
2776 |
]. |
|
2777 |
]. |
|
16806 | 2778 |
pathsInModuleAsArgument := pathsInModuleAsArgument asStringCollection asStringWith:Character space. |
2779 |
||
2780 |
self activityNotification:'setting symbolic name for: ', pathsInModuleAsArgument. |
|
11532 | 2781 |
|
2782 |
self information:'Implementation not finished yet'. |
|
2783 |
^self. |
|
2784 |
||
16806 | 2785 |
perforceCommand := ('label "' , pathsInRepository, '"'). |
11532 | 2786 |
outputStream := ReadWriteStream on:''. |
2787 |
errorStream := ReadWriteStream on:''. |
|
16806 | 2788 |
result := self executePerforceCommand:perforceCommand inDirectory:self root |
2789 |
inputFrom:nil outputTo:outputStream |
|
11532 | 2790 |
errorTo:errorStream |
16806 | 2791 |
logHeader:('set label ', pathsInRepository, '.'). |
11532 | 2792 |
result ifFalse:[ |
2793 |
^ nil |
|
2794 |
]. |
|
2795 |
]. |
|
2796 |
||
2797 |
" |
|
2798 |
self setSymbolicName:'stable' revision:nil overWrite:false path:'stx/libbasic/Array.st' |
|
2799 |
self setSymbolicName:'stable' revision:nil overWrite:true path:'stx/libbasic/Array.st' |
|
2800 |
||
16806 | 2801 |
self |
2802 |
setSymbolicName:'test1' |
|
2803 |
revision:nil |
|
2804 |
overWrite:true |
|
11532 | 2805 |
path:'bosch/dapasx/datenbasis/DAPASX__HierarchicalList.st' |
2806 |
||
16806 | 2807 |
self |
2808 |
setSymbolicName:'test2' |
|
2809 |
revision:nil |
|
2810 |
overWrite:true |
|
2811 |
pathes:#( 'bosch/dapasx/datenbasis/DAPASX__HierarchicalList.st' |
|
11532 | 2812 |
'bosch/dapasx/datenbasis/DAPASX__ProjectSearch.st' ) |
2813 |
||
16806 | 2814 |
self |
2815 |
setSymbolicName:'test2' |
|
2816 |
revision:0 |
|
2817 |
overWrite:true |
|
2818 |
pathes:#( 'bosch/dapasx/datenbasis/DAPASX__HierarchicalList.st' |
|
11532 | 2819 |
'bosch/dapasx/datenbasis/DAPASX__ProjectSearch.st' ) |
2820 |
" |
|
2821 |
||
2822 |
"Created: / 12-09-2006 / 12:36:44 / cg" |
|
2823 |
! |
|
2824 |
||
2825 |
streamFor:checkInDefinition revision:revision cache:doCache |
|
2826 |
"extract a classes source code and return an open readStream on it. |
|
2827 |
A revision of nil selects the current (in image) revision. |
|
2828 |
The classes source code is extracted using the revision and the sourceCodeInfo, |
|
2829 |
which itself is extracted from the classes packageString." |
|
2830 |
||
2831 |
|cacheIt cacheDir classFileName fullName cachedSourceFilename cacheSubDir cachedFile tempdir checkoutName |
|
2832 |
checkoutNameLocal revMsg fullTempName fullCachedName stream tempFile outStream |
|
2833 |
line modulDir lineNr result outputStream errorStream inStream cls module packageDir packagePath fullFilename perforceCommand| |
|
2834 |
||
2835 |
cacheIt := doCache. |
|
2836 |
(cacheIt and:[revision ~~ #newest and:[revision notNil]]) ifTrue:[ |
|
2837 |
(cacheDir := PerforceSourceCodeManager sourceCacheDirectory) isNil ifTrue:[ |
|
2838 |
'PerforceSourceCodeManager [warning]: no source cache directory' errorPrintCR. |
|
2839 |
] |
|
2840 |
]. |
|
2841 |
self getTemporaryWorkspaceFor:checkInDefinition. |
|
2842 |
cls := checkInDefinition definitionClass. |
|
2843 |
classFileName := checkInDefinition fileName. |
|
2844 |
classFileName isNil ifTrue:[classFileName := cls classBaseFilename]. |
|
2845 |
||
2846 |
(classFileName endsWith:',v') ifTrue:[ |
|
12702
2759bbb8d06b
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
11959
diff
changeset
|
2847 |
classFileName := classFileName copyButLast:2. |
11532 | 2848 |
]. |
2849 |
(classFileName endsWith:'.st') ifTrue:[ |
|
2850 |
cls notNil ifTrue:[ |
|
12702
2759bbb8d06b
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
11959
diff
changeset
|
2851 |
classFileName := classFileName copyButLast:3. |
11532 | 2852 |
] |
2853 |
]. |
|
2854 |
module := checkInDefinition package. |
|
2855 |
packageDir := checkInDefinition packageDir. |
|
2856 |
fullName := module , '/' , packageDir , '/' , classFileName. |
|
2857 |
cls notNil ifTrue:[ |
|
2858 |
fullName := fullName , '.st'. |
|
2859 |
]. |
|
2860 |
||
2861 |
(revision isNil or:[revision == #newest]) ifTrue:[ |
|
2862 |
cachedSourceFilename := classFileName, '_p4'. |
|
2863 |
revMsg := ''. |
|
2864 |
] ifFalse:[ |
|
2865 |
cachedSourceFilename := classFileName , '_p4_' , revision. |
|
2866 |
revMsg := ' (' , revision , ')'. |
|
2867 |
]. |
|
2868 |
||
2869 |
cacheDir notNil ifTrue:[ |
|
2870 |
cacheSubDir := cacheDir construct:module. |
|
2871 |
cacheSubDir := cacheSubDir construct:packageDir. |
|
2872 |
cachedFile := cacheSubDir construct:cachedSourceFilename. |
|
2873 |
cachedFile exists ifTrue:[ |
|
2874 |
^ cachedFile readStream |
|
2875 |
]. |
|
2876 |
]. |
|
2877 |
||
2878 |
"/ |
|
2879 |
"/ first, create a temporary work tree |
|
2880 |
"/ Do not make module and package directories, their existence cause cvs checkout to fail in server mode |
|
2881 |
"/ |
|
2882 |
tempdir := self tempDirectory. |
|
2883 |
||
2884 |
||
2885 |
"/ |
|
2886 |
"/ check it out there |
|
2887 |
"/ |
|
2888 |
checkoutName := fullName. |
|
2889 |
||
2890 |
modulDir := module asFilename construct:packageDir. |
|
2891 |
checkoutNameLocal := modulDir constructString:(fullName asFilename baseName). |
|
2892 |
||
2893 |
self activityNotification:'checking out source ' , checkoutName , revMsg. |
|
2894 |
||
2895 |
packagePath := Smalltalk packageDirectoryForPackageId:checkInDefinition package. |
|
2896 |
fullFilename := (packagePath construct:checkInDefinition packageDir) construct:checkInDefinition fileName. |
|
2897 |
fullTempName := self getTemporaryFilenameFor:fullFilename pathName. |
|
2898 |
||
2899 |
perforceCommand := ('print "' , fullFilename pathName, '#', revision, '"'). |
|
2900 |
outputStream := ReadWriteStream on:''. |
|
2901 |
errorStream := ReadWriteStream on:''. |
|
2902 |
result := self executePerforceCommand:perforceCommand inDirectory:self root |
|
2903 |
inputFrom:nil outputTo:outputStream |
|
2904 |
errorTo:errorStream |
|
2905 |
logHeader:('get contents of ', fullFilename pathName, ' for revision ', revision, '.'). |
|
2906 |
result ifFalse:[ |
|
2907 |
^ nil |
|
2908 |
]. |
|
2909 |
errorStream contents notEmpty ifTrue:[ |
|
2910 |
^nil |
|
2911 |
]. |
|
19396 | 2912 |
OpenError handle:[:ex| |
11532 | 2913 |
('PerforceSourceCodeManager [error]: can not create ', fullTempName pathName) errorPrintCR. |
2914 |
^ nil. |
|
2915 |
] do:[ |
|
2916 |
fullTempName directory recursiveMakeDirectory. |
|
2917 |
outStream := fullTempName writeStream. |
|
2918 |
]. |
|
2919 |
lineNr := 1. |
|
2920 |
inStream := ReadStream on:(outputStream contents). |
|
2921 |
[inStream atEnd not] whileTrue:[ |
|
2922 |
line:= inStream nextLine. |
|
2923 |
line notNil ifTrue:[ |
|
19142 | 2924 |
lineNr == 1 ifTrue:[ |
11532 | 2925 |
] ifFalse:[ |
2926 |
outStream nextPutLine:line. |
|
2927 |
]. |
|
2928 |
]. |
|
2929 |
lineNr := lineNr + 1. |
|
2930 |
]. |
|
2931 |
outStream close. |
|
2932 |
||
2933 |
(cacheSubDir isNil) ifTrue:[ |
|
2934 |
cacheIt := false |
|
2935 |
] ifFalse:[ |
|
2936 |
cacheSubDir recursiveMakeDirectory. |
|
2937 |
fullCachedName := cacheSubDir constructString:cachedSourceFilename. |
|
2938 |
]. |
|
2939 |
(cacheIt |
|
2940 |
and:[cachedFile notNil |
|
2941 |
and:[fullTempName exists]]) |
|
2942 |
ifTrue:[ |
|
12725
93efe8fda21c
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12702
diff
changeset
|
2943 |
(OsError catch:[ |
11532 | 2944 |
fullTempName moveTo:fullCachedName |
2945 |
]) ifTrue:[ |
|
2946 |
('PerforceSourceCodeManager [error]: failed to rename ', fullTempName pathName, ' to ', cachedSourceFilename) errorPrintCR. |
|
2947 |
^ nil |
|
2948 |
]. |
|
2949 |
fullCachedName asFilename exists ifTrue:[ |
|
2950 |
stream := fullCachedName asFilename readStream. |
|
2951 |
]. |
|
2952 |
] ifFalse:[ |
|
2953 |
checkInDefinition fileName = 'extensions.st' ifTrue:[ |
|
2954 |
self activityNotification:'Not cached - please check your settings and/or the version method in the projectDefinition.'. |
|
2955 |
] ifFalse:[ |
|
2956 |
self activityNotification:'Not cached - please check your settings.'. |
|
2957 |
]. |
|
2958 |
OperatingSystem isUNIXlike ifFalse:[ |
|
2959 |
"/ cannot remove files which are still open ... |
|
2960 |
"/ sigh - need a delete-on-close flag in FileStream. |
|
2961 |
"/ |
|
2962 |
tempFile := Filename newTemporary. |
|
2963 |
fullTempName copyTo:tempFile. |
|
2964 |
stream := tempFile readStream. |
|
2965 |
stream notNil ifTrue:[ |
|
2966 |
stream removeOnClose:true. |
|
2967 |
]. |
|
2968 |
] ifTrue:[ |
|
2969 |
stream := fullTempName readStream. |
|
2970 |
] |
|
2971 |
]. |
|
2972 |
||
2973 |
^ stream |
|
2974 |
! |
|
2975 |
||
2976 |
submit |
|
2977 |
||
2978 |
|numbers| |
|
2979 |
||
2980 |
numbers := self getCurrentChangeListNumbers. |
|
2981 |
numbers isEmptyOrNil ifTrue:[ |
|
2982 |
^false |
|
2983 |
]. |
|
2984 |
numbers do:[:aNumber| |
|
2985 |
(self submitChangeNumber:aNumber) ifFalse:[ |
|
2986 |
^false |
|
2987 |
]. |
|
2988 |
]. |
|
2989 |
^true |
|
2990 |
! |
|
2991 |
||
2992 |
submitChangeNumber:changeNumber |
|
2993 |
||
2994 |
|cmd outputStream errorStream result changeListDescription infoDialog logMsg| |
|
2995 |
||
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2996 |
|
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2997 |
self temporaryWorkSpace isNil ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2998 |
self perforceError raiseErrorString:('Error getting temporary workspace when try to submot ', changeNumber printString, '.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
2999 |
^false. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3000 |
]. |
11532 | 3001 |
changeListDescription := self getChangeDespriptionInfoFor:changeNumber printString. |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3002 |
infoDialog := PerforceSourceCodeManager submitInfoDialogClass |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3003 |
getCheckinInfoFor:'Perforce submit message check' |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3004 |
initialAnswer:((changeListDescription at:#Description ifAbsent:'') copy) |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3005 |
withFileList:(changeListDescription at:#Files ifAbsent:''). |
11532 | 3006 |
infoDialog notNil ifTrue:[ |
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3007 |
logMsg := infoDialog logMessage. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3008 |
(changeListDescription at:#Description ifAbsent:'') ~= logMsg asStringCollection ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3009 |
self changeChangeDescriptionTo:logMsg asStringCollection changeNumber:changeNumber printString |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3010 |
]. |
11532 | 3011 |
]. |
3012 |
cmd := ('submit -c ', changeNumber printString). |
|
3013 |
outputStream := ReadWriteStream on:''. |
|
3014 |
errorStream := ReadWriteStream on:''. |
|
3015 |
result := self temporaryWorkSpace executePerforceCommand:cmd |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3016 |
inDirectory:self tempDirectory |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3017 |
inputFrom:nil |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3018 |
outputTo:outputStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3019 |
errorTo:errorStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3020 |
doLog:false. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3021 |
result ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3022 |
result := self mergeOrResolveConflictsForChangeNumber:changeNumber. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3023 |
result ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3024 |
cmd := ('submit -c ', changeNumber printString). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3025 |
outputStream := ReadWriteStream on:''. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3026 |
errorStream := ReadWriteStream on:''. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3027 |
result := self temporaryWorkSpace executePerforceCommand:cmd |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3028 |
inDirectory:self tempDirectory |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3029 |
inputFrom:nil |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3030 |
outputTo:outputStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3031 |
errorTo:errorStream |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3032 |
logHeader:('submit change ', changeNumber printString, ' after resolve.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3033 |
result ifFalse:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3034 |
^ false |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3035 |
]. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3036 |
]. |
11532 | 3037 |
]. |
3038 |
^true |
|
3039 |
! ! |
|
3040 |
||
3041 |
!PerforceSourceCodeManagerUtilities::WorkSpace methodsFor:'basic administration'! |
|
3042 |
||
3043 |
initialRevisionInfo:checkInDefinition |
|
3044 |
"return a string usable as initial revision string" |
|
3045 |
||
3046 |
|version workSpace foundView packagePath fullFilename depotPath| |
|
3047 |
||
3048 |
checkInDefinition definitionClass isPrivate ifTrue:[ |
|
3049 |
PerforceSourceCodeManager reportError:'refuse to get revision for private classes.'. |
|
3050 |
^ nil. |
|
3051 |
]. |
|
3052 |
||
3053 |
"/ |
|
3054 |
"/ first, create a temporary work tree |
|
3055 |
"/ |
|
3056 |
"/ tempdir := checkInDefinition tempDirectory. |
|
3057 |
||
3058 |
||
3059 |
workSpace := PerforceSourceCodeManager getWorkSpaceForPackage:(checkInDefinition packageString). |
|
3060 |
workSpace isNil ifTrue:[ |
|
3061 |
('PerforceSourceCodeManager [error]: failed to create workspace for', checkInDefinition definitionObjectString) errorPrintCR. |
|
3062 |
^ nil |
|
3063 |
]. |
|
3064 |
checkInDefinition workSpace:workSpace. |
|
3065 |
version := PerforceSourceCodeManager versionInfoClass new. |
|
3066 |
foundView := workSpace getViewForPackage:checkInDefinition package. |
|
3067 |
packagePath := Smalltalk packageDirectoryForPackageId:checkInDefinition package. |
|
3068 |
fullFilename := (packagePath construct:checkInDefinition packageDir) construct:checkInDefinition fileName. |
|
3069 |
depotPath := foundView getDepotPathForLocalPath:fullFilename pathName. |
|
3070 |
||
3071 |
version repositoryPathName:depotPath. |
|
3072 |
version user:workSpace owner. |
|
3073 |
" |
|
3074 |
s := CharacterWriteStream on:(String basicNew:40). |
|
3075 |
Date today printOn:s format:'%d-%m-%y' language:nil. |
|
3076 |
version date:s contents. |
|
3077 |
s := CharacterWriteStream on:(String basicNew:40). |
|
3078 |
Timestamp now printOn:s format:'%h-%m-%s.%i'. |
|
3079 |
version time:s contents. |
|
3080 |
" |
|
3081 |
version revision:'1'. |
|
3082 |
^ version. |
|
3083 |
||
3084 |
" |
|
3085 |
self initialRevisionStringFor:RTDBInspectorStartup inModule:'applistx' directory:'util/rtdb' container:'RTDBInterfaceInspector.st' |
|
3086 |
" |
|
3087 |
! |
|
3088 |
||
3089 |
initialRevisionStringFor:checkInDefinition |
|
3090 |
"return a string usable as initial revision string" |
|
3091 |
||
3092 |
|info| |
|
3093 |
||
3094 |
info := self initialRevisionInfo:checkInDefinition. |
|
3095 |
info notNil ifTrue:[ |
|
3096 |
^info getVersionString |
|
3097 |
]. |
|
3098 |
^nil |
|
3099 |
" |
|
3100 |
self initialRevisionStringFor:RTDBInspectorStartup inModule:'applistx' directory:'util/rtdb' container:'RTDBInterfaceInspector.st' |
|
3101 |
" |
|
3102 |
! |
|
3103 |
||
3104 |
nextRevisionStringFor:checkInDefinition |
|
3105 |
||
3106 |
|versionInfo s newestRevisionNumber versionMethod versionString| |
|
3107 |
||
3108 |
versionMethod := checkInDefinition definitionClass findVersionMethodOfManager:PerforceSourceCodeManager. |
|
3109 |
versionMethod notNil ifTrue:[ |
|
3110 |
versionString := (versionMethod valueWithReceiver:(checkInDefinition definitionClass theNonMetaclass) arguments:#()). |
|
3111 |
versionString notNil ifTrue:[ |
|
3112 |
versionInfo := PerforceSourceCodeManager versionInfoClass fromRCSString:versionString. |
|
3113 |
]. |
|
3114 |
]. |
|
3115 |
versionInfo isNil ifTrue:[ |
|
3116 |
versionInfo := self initialRevisionInfo:checkInDefinition. |
|
3117 |
] ifFalse:[ |
|
3118 |
versionInfo user:checkInDefinition workSpace owner. |
|
3119 |
s := CharacterWriteStream on:(String basicNew:40). |
|
3120 |
Date today printOn:s format:'%d-%m-%y' language:nil. |
|
3121 |
versionInfo date:s contents. |
|
3122 |
s := CharacterWriteStream on:(String basicNew:40). |
|
3123 |
Timestamp now printOn:s format:'%h-%m-%s.%i'. |
|
3124 |
versionInfo time:s contents. |
|
3125 |
]. |
|
3126 |
versionInfo isNil ifTrue:[ |
|
3127 |
^nil. |
|
3128 |
]. |
|
3129 |
newestRevisionNumber := checkInDefinition getReposRevisionNumberBeforeCheckin. |
|
3130 |
newestRevisionNumber isNil ifTrue:[ |
|
3131 |
^nil. |
|
3132 |
]. |
|
3133 |
versionInfo revision:((newestRevisionNumber + 1) printString). |
|
3134 |
^versionInfo getVersionString |
|
3135 |
! ! |
|
3136 |
||
3137 |
!PerforceSourceCodeManagerUtilities::WorkSpace methodsFor:'command execution'! |
|
3138 |
||
17506 | 3139 |
executePerforceCommand:perforceCommand inDirectory:dirArg |
3140 |
inputFrom:inputStream outputTo:outputStream |
|
3141 |
errorTo:errorStream |
|
11532 | 3142 |
"execute command and prepend perforce command name and global options. |
3143 |
execute command in the dirArg directory. |
|
17506 | 3144 |
The doLog argument, if false suppresses a logEntry to be added |
11532 | 3145 |
in the cvs log file (used when reading / extracting history)" |
3146 |
||
17506 | 3147 |
^self executePerforceCommand:perforceCommand inDirectory:dirArg |
3148 |
inputFrom:inputStream outputTo:outputStream |
|
11532 | 3149 |
errorTo:errorStream |
3150 |
doLog:true |
|
17506 | 3151 |
|
3152 |
"Modified (comment): / 16-05-2017 / 17:20:11 / mawalch" |
|
11532 | 3153 |
! |
3154 |
||
17506 | 3155 |
executePerforceCommand:perforceCommand inDirectory:dirArg |
3156 |
inputFrom:inputStream outputTo:outputStream |
|
11532 | 3157 |
errorTo:errorStream |
3158 |
doLog:doLog |
|
3159 |
"execute command and prepend perforce command name and global options. |
|
3160 |
execute command in the dirArg directory. |
|
17506 | 3161 |
The doLog argument, if false suppresses a logEntry to be added |
11532 | 3162 |
in the cvs log file (used when reading / extracting history)" |
3163 |
||
17506 | 3164 |
^self executePerforceCommand:perforceCommand inDirectory:dirArg |
3165 |
inputFrom:inputStream outputTo:outputStream |
|
11532 | 3166 |
errorTo:errorStream |
3167 |
doLog:doLog |
|
3168 |
logHeader:nil |
|
17506 | 3169 |
|
3170 |
"Modified (comment): / 16-05-2017 / 17:20:29 / mawalch" |
|
11532 | 3171 |
! |
3172 |
||
17506 | 3173 |
executePerforceCommand:perforceCommand inDirectory:dirArg |
3174 |
inputFrom:inputStream outputTo:outputStream |
|
11532 | 3175 |
errorTo:errorStream |
3176 |
doLog:doLog |
|
3177 |
logHeader:logHeader |
|
3178 |
"execute command and prepend perforce command name and global options. |
|
3179 |
execute command in the dirArg directory. |
|
17506 | 3180 |
The doLog argument, if false suppresses a logEntry to be added |
11532 | 3181 |
in the cvs log file (used when reading / extracting history)" |
3182 |
||
3183 |
|command rslt pathOfDir errorString timeout errorMsgStream executeStream| |
|
3184 |
||
3185 |
dirArg notNil ifTrue:[ |
|
3186 |
pathOfDir := dirArg asFilename pathName. |
|
3187 |
]. |
|
3188 |
||
3189 |
command := self getCommandOptionsForCommand:perforceCommand. |
|
3190 |
Processor isDispatching ifFalse:[ |
|
3191 |
rslt := OperatingSystem executeCommand:command |
|
3192 |
inputFrom:inputStream |
|
3193 |
outputTo:outputStream |
|
3194 |
errorTo:errorStream |
|
3195 |
auxFrom:nil |
|
3196 |
inDirectory:pathOfDir |
|
3197 |
lineWise:true |
|
3198 |
onError:[:status| false]. |
|
3199 |
] ifTrue:[ |
|
3200 |
PerforceCommandSemaphore critical:[ |
|
3201 |
|p | |
|
3202 |
||
3203 |
p := [ |
|
3204 |
rslt := OperatingSystem executeCommand:command |
|
3205 |
inputFrom:inputStream |
|
3206 |
outputTo:outputStream |
|
3207 |
errorTo:errorStream |
|
3208 |
auxFrom:nil |
|
3209 |
inDirectory:pathOfDir |
|
3210 |
lineWise:true |
|
3211 |
onError:[:status| false]. |
|
3212 |
] fork. |
|
3213 |
||
17506 | 3214 |
timeout := (p waitUntilTerminatedWithTimeout:300). |
11532 | 3215 |
timeout ifTrue:[ |
3216 |
('PerforceSourceCodeManager [info]: command timeout: ' , command) errorPrintCR. |
|
3217 |
rslt := false. |
|
3218 |
errorString := 'Perforce command timeout'. |
|
3219 |
] ifFalse:[ |
|
3220 |
rslt ifFalse:[ |
|
3221 |
errorString := ('PerforceSourceCodeManager [info]: command failed: ' , command). |
|
3222 |
]. |
|
3223 |
]. |
|
3224 |
]. |
|
3225 |
]. |
|
3226 |
||
3227 |
PerforceSourceCodeManager verboseSourceCodeAccess == true ifTrue:[ |
|
3228 |
executeStream := WriteStream on:''. |
|
13926 | 3229 |
executeStream nextPutAll:Timestamp now printString. |
11532 | 3230 |
executeStream cr. |
3231 |
executeStream nextPutAll:('Command <', command, '>'). |
|
3232 |
executeStream cr. |
|
3233 |
executeStream nextPutAll:('StdErr Output: <', errorStream contents, '>'). |
|
3234 |
executeStream cr. |
|
3235 |
executeStream nextPutAll:('StdOut Output: <', outputStream contents, '>'). |
|
3236 |
executeStream cr. |
|
3237 |
executeStream nextPutAll:('##############################'). |
|
3238 |
Transcript showCR:executeStream contents. |
|
3239 |
]. |
|
3240 |
rslt ifFalse:[ |
|
3241 |
doLog ifTrue:[ |
|
3242 |
errorMsgStream := WriteStream on:''. |
|
3243 |
logHeader notNil ifTrue:[ |
|
3244 |
errorMsgStream nextPutAll:'Error '. |
|
3245 |
errorMsgStream nextPutAll:logHeader. |
|
3246 |
errorMsgStream cr. |
|
3247 |
]. |
|
3248 |
timeout ifTrue:[ |
|
3249 |
errorMsgStream nextPutAll:('Timeout command <', command, '>'). |
|
3250 |
errorMsgStream cr. |
|
3251 |
] ifFalse:[ |
|
3252 |
errorMsgStream nextPutAll:('Command <', command, '>'). |
|
3253 |
errorMsgStream cr. |
|
3254 |
errorMsgStream nextPutAll:('Error output: ', errorStream contents). |
|
3255 |
outputStream contents notEmpty ifTrue:[ |
|
3256 |
errorMsgStream nextPutAll:('Output: ', outputStream contents). |
|
3257 |
]. |
|
3258 |
]. |
|
3259 |
self perforceError raiseErrorString:errorMsgStream contents. |
|
3260 |
SourceCodeManagerError isHandled ifTrue:[ |
|
3261 |
SourceCodeManagerError raiseErrorString:errorMsgStream contents. |
|
3262 |
]. |
|
3263 |
]. |
|
3264 |
]. |
|
3265 |
^ rslt. |
|
17506 | 3266 |
|
3267 |
"Modified (comment): / 16-05-2017 / 17:20:42 / mawalch" |
|
11532 | 3268 |
! |
3269 |
||
17506 | 3270 |
executePerforceCommand:perforceCommand inDirectory:dirArg |
3271 |
inputFrom:inputStream outputTo:outputStream |
|
3272 |
errorTo:errorStream |
|
11532 | 3273 |
logHeader:logHeader |
3274 |
"execute command and prepend perforce command name and global options. |
|
3275 |
execute command in the dirArg directory. |
|
17506 | 3276 |
The doLog argument, if false suppresses a logEntry to be added |
11532 | 3277 |
in the cvs log file (used when reading / extracting history)" |
3278 |
||
17506 | 3279 |
^self executePerforceCommand:perforceCommand inDirectory:dirArg |
3280 |
inputFrom:inputStream outputTo:outputStream |
|
11532 | 3281 |
errorTo:errorStream |
3282 |
doLog:true |
|
3283 |
logHeader:logHeader. |
|
17506 | 3284 |
|
3285 |
"Modified (comment): / 16-05-2017 / 17:20:53 / mawalch" |
|
11532 | 3286 |
! |
3287 |
||
3288 |
getCommandOptionsForCommand:perforceCommand |
|
3289 |
||
3290 |
|commandStream executable port user password clientString| |
|
3291 |
||
3292 |
commandStream := WriteStream on:''. |
|
3293 |
executable := PerforceSourceCodeManager perforceExecutable. |
|
3294 |
(executable includes:Character space) ifTrue:[ |
|
3295 |
commandStream nextPut:$". |
|
3296 |
commandStream nextPutAll:executable. |
|
3297 |
commandStream nextPut:$". |
|
3298 |
] ifFalse:[ |
|
3299 |
commandStream nextPutAll:executable. |
|
3300 |
]. |
|
3301 |
commandStream space. |
|
3302 |
port := self perforceSettings at:#port ifAbsent:nil. |
|
3303 |
port notNil ifTrue:[ |
|
3304 |
commandStream space. |
|
3305 |
commandStream nextPutAll:'-p '. |
|
3306 |
commandStream nextPutAll:port. |
|
3307 |
commandStream space. |
|
3308 |
]. |
|
3309 |
clientString := self perforceSettings at:#client ifAbsent:nil. |
|
3310 |
clientString notNil ifTrue:[ |
|
3311 |
commandStream space. |
|
3312 |
commandStream nextPutAll:'-c '. |
|
3313 |
commandStream nextPutAll:clientString. |
|
3314 |
commandStream space. |
|
3315 |
]. |
|
3316 |
user := self perforceSettings at:#user ifAbsent:nil. |
|
3317 |
user notNil ifTrue:[ |
|
3318 |
commandStream space. |
|
3319 |
commandStream nextPutAll:'-u '. |
|
3320 |
commandStream nextPutAll:user. |
|
3321 |
commandStream space. |
|
3322 |
]. |
|
3323 |
password := self perforceSettings at:#password ifAbsent:nil. |
|
3324 |
password notNil ifTrue:[ |
|
3325 |
commandStream space. |
|
3326 |
commandStream nextPutAll:'-P '. |
|
3327 |
commandStream nextPutAll:password. |
|
3328 |
commandStream space. |
|
3329 |
]. |
|
3330 |
commandStream nextPutAll:perforceCommand. |
|
3331 |
||
3332 |
^ commandStream contents. |
|
3333 |
! ! |
|
3334 |
||
3335 |
!PerforceSourceCodeManagerUtilities::WorkSpace methodsFor:'dialogs & helpers'! |
|
3336 |
||
3337 |
checkinTroubleDialog:title message:message log:log abortable:abortable option:optionTitle |
|
3338 |
"trouble checking in - open a dialog" |
|
3339 |
||
3340 |
^ self |
|
3341 |
checkinTroubleDialog:title |
|
3342 |
message:message |
|
3343 |
log:log |
|
3344 |
abortable:abortable |
|
3345 |
option:optionTitle |
|
3346 |
option2:nil |
|
3347 |
||
3348 |
"Created: 10.12.1995 / 17:34:33 / cg" |
|
3349 |
"Modified: 12.9.1996 / 02:39:06 / cg" |
|
3350 |
! |
|
3351 |
||
3352 |
checkinTroubleDialog:title message:message log:log abortable:abortable option:optionTitle option2:optionTitle2 |
|
3353 |
^self |
|
3354 |
checkinTroubleDialog:title |
|
3355 |
message:message |
|
3356 |
log:log |
|
3357 |
abortable:abortable |
|
3358 |
option:optionTitle |
|
3359 |
option2:optionTitle2 |
|
3360 |
option3:nil |
|
3361 |
! |
|
3362 |
||
3363 |
checkinTroubleDialog:title message:message log:log abortable:abortable option:optionTitle option2:optionTitle2 option3:optionTitle3 |
|
3364 |
"trouble checking in - open a dialog" |
|
3365 |
||
3366 |
|l box list listView optionPressed option2Pressed option3Pressed| |
|
3367 |
||
3368 |
l := log collect:[:line | line withTabsExpanded]. |
|
3369 |
list := SelectionInList with:l. |
|
3370 |
||
3371 |
box := Dialog new. |
|
3372 |
box label:(title). |
|
3373 |
||
3374 |
(box addTextLabel:message) borderWidth:0. |
|
3375 |
||
3376 |
l asString notEmptyOrNil ifTrue:[ |
|
3377 |
listView := SelectionInListView on:list. |
|
3378 |
listView disable. |
|
3379 |
listView height:(listView heightOfContents max:250). |
|
3380 |
box addComponent:(HVScrollableView forView:listView miniScrollerH:true) tabable:false. |
|
3381 |
box addVerticalSpace. |
|
3382 |
]. |
|
3383 |
||
3384 |
abortable ifTrue:[ |
|
3385 |
box addAbortButton |
|
3386 |
]. |
|
3387 |
optionTitle notNil ifTrue:[ |
|
3388 |
box addOkButton:(Button label:optionTitle action:[optionPressed := true. box hide]). |
|
3389 |
]. |
|
3390 |
optionTitle2 notNil ifTrue:[ |
|
3391 |
box addOkButton:(Button label:optionTitle2 action:[option2Pressed := true. box hide]). |
|
3392 |
]. |
|
3393 |
optionTitle3 notNil ifTrue:[ |
|
3394 |
box addOkButton:(Button label:optionTitle3 action:[option3Pressed := true. box hide]). |
|
3395 |
]. |
|
3396 |
box addOkButton. |
|
3397 |
||
3398 |
box extent:(box preferredExtent). |
|
3399 |
box minExtent:box extent. |
|
3400 |
box maxExtent:box extent. |
|
3401 |
||
3402 |
box open. |
|
3403 |
box destroy. |
|
3404 |
optionPressed == true ifTrue:[^ #option]. |
|
3405 |
option2Pressed == true ifTrue:[^ #option2]. |
|
3406 |
option3Pressed == true ifTrue:[^ #option3]. |
|
3407 |
^ box accepted |
|
3408 |
||
3409 |
" |
|
3410 |
| changesAsLogged | |
|
3411 |
changesAsLogged := OrderedCollection new. |
|
3412 |
1 to:10 do:[:each| |
|
3413 |
changesAsLogged add:('Hallo', each printString). |
|
3414 |
]. |
|
3415 |
changesAsLogged := OrderedCollection new. |
|
3416 |
self checkinTroubleDialog:'Version conflict' |
|
3417 |
message:'Message Message Message Message Message Message Message Message Message Message Message Message Message Message' |
|
3418 |
log:changesAsLogged |
|
3419 |
abortable:false |
|
3420 |
option:'show conflicts' |
|
3421 |
option2:'resolve conflicts' |
|
3422 |
" |
|
3423 |
! |
|
3424 |
||
3425 |
diffTextComment |
|
3426 |
||
3427 |
|ws| |
|
3428 |
||
3429 |
ws := WriteStream on:''. |
|
3430 |
ws nextPutLine:'"/ ***************************************************************'. |
|
3431 |
ws nextPutLine:'"/ This text contains your current versions code (blue)'. |
|
3432 |
ws nextPutLine:'"/ merged with the conflicting code as found in the repository (red) which resulted'. |
|
3433 |
ws nextPutLine:'"/ from some other checkin.'. |
|
3434 |
ws nextPutLine:'"/ Each such conflict is surrounded by green text (like this paragraph).'. |
|
3435 |
ws nextPutLine:'"/ '. |
|
3436 |
ws nextPutLine:'"/ Please have a look at ALL the conflicts and fix things as appropriate.'. |
|
3437 |
ws nextPutLine:'"/ Delete the green lines as a confirmation - I will not checkin the changed text,'. |
|
3438 |
ws nextPutLine:'"/ unless no more green parts are present. This includes this comment at the top.'. |
|
3439 |
ws nextPutLine:'"/ ***************************************************************'. |
|
3440 |
^ ws contents |
|
3441 |
! |
|
3442 |
||
3443 |
getRevisionForLabel:label depotPath:depotPath |
|
3444 |
||
3445 |
||
3446 |
|perforceCommand outputStream errorStream result inStream line depotAndRevision| |
|
3447 |
||
3448 |
perforceCommand := ('files "@' , label, '"'). |
|
3449 |
outputStream := ReadWriteStream on:''. |
|
3450 |
errorStream := ReadWriteStream on:''. |
|
3451 |
result := self executePerforceCommand:perforceCommand inDirectory:self root |
|
3452 |
inputFrom:nil outputTo:outputStream |
|
3453 |
errorTo:errorStream |
|
3454 |
logHeader:('getting revision for label ', label, '.'). |
|
3455 |
result ifFalse:[ |
|
3456 |
^ nil |
|
3457 |
]. |
|
3458 |
inStream := ReadStream on:(outputStream contents). |
|
3459 |
[inStream atEnd not] whileTrue:[ |
|
3460 |
line:= inStream nextLine. |
|
3461 |
line notEmptyOrNil ifTrue:[ |
|
3462 |
(line startsWith:depotPath) ifTrue:[ |
|
3463 |
depotAndRevision := line asCollectionOfWords first. |
|
3464 |
depotAndRevision := depotAndRevision asCollectionOfSubstringsSeparatedBy:$#. |
|
3465 |
^ depotAndRevision second |
|
3466 |
]. |
|
3467 |
]. |
|
3468 |
]. |
|
3469 |
^nil |
|
3470 |
! |
|
3471 |
||
3472 |
messageForChangesInClass:class revision:revisionNumber |
|
3473 |
||
3474 |
|msgStream| |
|
3475 |
||
3476 |
msgStream := WriteStream on:''. |
|
3477 |
msgStream nextPutAll:'The source of '; nextPutAll:class className; nextPutAll:'has been changed in the meanwhile as listed below.'. |
|
3478 |
msgStream cr. |
|
3479 |
msgStream nextPutAll:'If you continue, your new changes (based upon rev. '; nextPutAll:revisionNumber printString; nextPutAll:') will be MERGED'. |
|
3480 |
msgStream nextPutAll:'into the newest revision. This will combine the other version with your changes'. |
|
3481 |
msgStream nextPutAll:'into a new common revision which may be different from both.'. |
|
3482 |
msgStream nextPutAll:'Although this is a nice feature, it may fail to create the expected result in certain situations.'. |
|
3483 |
msgStream cr. |
|
3484 |
msgStream nextPutAll:'You should carefully check the result - by comparing the current version with the'. |
|
3485 |
msgStream nextPutAll:'most recent version in the repository. If that does not contain an acceptable version,'. |
|
3486 |
msgStream nextPutAll:'change methods as required and check in again.'. |
|
3487 |
msgStream nextPutAll:'Be aware, that after that, the actual repository version is different from your current classes,'. |
|
3488 |
msgStream nextPutAll:'and you should update your class from the repository.'. |
|
3489 |
msgStream cr. |
|
3490 |
msgStream nextPutAll:'Continue ?'. |
|
3491 |
^ msgStream contents |
|
3492 |
! |
|
3493 |
||
3494 |
messageForConflictsInClass:definitionClass revision:revisionNumber |
|
3495 |
||
3496 |
|msgStream| |
|
3497 |
||
3498 |
msgStream := WriteStream on:''. |
|
3499 |
msgStream nextPutAll:'The source of '; nextPutAll:definitionClass className; nextPutAll:' has been changed in the meanwhile as listed below.'. |
|
3500 |
msgStream cr. |
|
3501 |
msgStream nextPutAll:'Your new changes (based upon rev. '; nextPutAll:revisionNumber printString; nextPutAll:') CONFLICT with those changes'. |
|
3502 |
msgStream cr. |
|
3503 |
msgStream nextPutAll:'You should fix things by comparing your class with the most recent repository version'. |
|
3504 |
msgStream nextPutAll:'and change your methods avoiding conflicts. The checkin again.'. |
|
3505 |
msgStream cr. |
|
3506 |
^ msgStream contents |
|
3507 |
! |
|
3508 |
||
3509 |
messageForNoChangesInClass:class |
|
3510 |
||
3511 |
|msgStream| |
|
3512 |
||
3513 |
msgStream := WriteStream on:''. |
|
3514 |
msgStream nextPutAll:'The source of '; nextPutAll:class className; nextPutAll:'has been changed in the meanwhile as listed below.'. |
|
3515 |
msgStream cr. |
|
3516 |
msgStream nextPutAll:'I have merged your version with the newest repository version,'. |
|
3517 |
msgStream nextPutAll:'and found no differences between the result and your current version'. |
|
3518 |
msgStream nextPutAll:'(i.e. your version seemed up-to-date).'. |
|
3519 |
^ msgStream contents |
|
3520 |
! |
|
3521 |
||
3522 |
updatedRevisionStringOf:aClass forRevision:newRevision with:originalVersionString |
|
3523 |
"update a revision string" |
|
3524 |
||
3525 |
|versionInfo packageID module foundView packagePath fullFilename depotPath sourceInfo classFileName| |
|
3526 |
||
3527 |
originalVersionString isEmptyOrNil ifTrue:[ |
|
3528 |
packageID := PackageId from:aClass package. |
|
3529 |
module := packageID module. |
|
3530 |
foundView := self getViewForPackage:module. |
|
3531 |
packagePath := Smalltalk packageDirectoryForPackageId:module. |
|
3532 |
sourceInfo := PerforceSourceCodeManager sourceInfoOfClass:aClass. |
|
3533 |
sourceInfo isNil ifTrue:[ |
|
3534 |
PerforceSourceCodeManager reportError:('no sourceInfo for class: ' , aClass name). |
|
3535 |
^ nil |
|
3536 |
]. |
|
3537 |
classFileName := PerforceSourceCodeManager containerFromSourceInfo:sourceInfo. |
|
3538 |
fullFilename := (packagePath construct:packageID directory) construct:classFileName. |
|
3539 |
depotPath := foundView getDepotPathForLocalPath:fullFilename pathName. |
|
3540 |
||
3541 |
versionInfo := PerforceSourceCodeManager versionInfoClass fromRepositoryPathName:depotPath. |
|
3542 |
] ifFalse:[ |
|
3543 |
versionInfo := PerforceSourceCodeManager versionInfoClass fromRCSString:originalVersionString. |
|
3544 |
]. |
|
3545 |
versionInfo revision:newRevision printString. |
|
3546 |
^ versionInfo getVersionString. |
|
3547 |
||
3548 |
||
3549 |
||
3550 |
" |
|
3551 |
self updatedRevisionStringOf:nil |
|
3552 |
forRevision:'6' |
|
3553 |
with:'$','Header','$' |
|
3554 |
" |
|
3555 |
! ! |
|
3556 |
||
3557 |
!PerforceSourceCodeManagerUtilities::WorkSpace methodsFor:'initialization'! |
|
3558 |
||
3559 |
initialize |
|
3560 |
||
3561 |
PerforceCommandSemaphore := Semaphore new:10. |
|
3562 |
! ! |
|
3563 |
||
3564 |
!PerforceSourceCodeManagerUtilities::WorkSpace methodsFor:'queries'! |
|
3565 |
||
3566 |
getDepotPathForLocalPath:aFilename |
|
3567 |
|view| |
|
3568 |
||
3569 |
view := self getViewForPath:aFilename. |
|
3570 |
view isNil ifTrue:[ |
|
3571 |
^nil |
|
3572 |
]. |
|
3573 |
^view getDepotPathForLocalPath:aFilename |
|
3574 |
! |
|
3575 |
||
3576 |
getLocalPathForDepotPath:depotPath |
|
3577 |
||
3578 |
|view| |
|
3579 |
||
3580 |
view := self getViewForDepotPath:depotPath. |
|
3581 |
view notNil ifTrue:[ |
|
3582 |
^view getLocalPathForDepotPath:depotPath. |
|
3583 |
]. |
|
3584 |
^nil |
|
3585 |
" |
|
3586 |
| workSpace tempWorkSpace | |
|
3587 |
workSpace := PerforceSourceCodeManager getWorkSpaceForPackage:'applistx'. |
|
3588 |
tempWorkSpace := workSpace temporaryWorkSpace. |
|
3589 |
tempWorkSpace getLocalPathForDepotPath:'//depot/applistx/util/libDataType/ActionLQualifier.st' |
|
3590 |
" |
|
3591 |
! |
|
3592 |
||
3593 |
getTemporaryFilenameFor:aFilename |
|
3594 |
||
3595 |
|myView checkInPart fullTempFilename| |
|
3596 |
||
3597 |
myView := self getViewForPath:aFilename. |
|
3598 |
self temporaryWorkSpace isNil ifTrue:[ |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3599 |
self perforceError raiseErrorString:('Error getting temporary workspace when try to get temporaryFilename.'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3600 |
^nil. |
11532 | 3601 |
]. |
3602 |
self temporaryWorkSpace views do:[:aView| |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3603 |
myView depot = aView depot ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3604 |
checkInPart := PerforceSourceCodeManager getTrailungPathNameFrom:aFilename with:myView localPathName. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3605 |
fullTempFilename := aView localPathName asFilename construct:checkInPart. |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3606 |
^fullTempFilename |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3607 |
]. |
11532 | 3608 |
]. |
3609 |
^nil |
|
3610 |
! |
|
3611 |
||
3612 |
getTemporaryViewForPackage:aPackage |
|
3613 |
||
3614 |
|myView| |
|
3615 |
||
3616 |
myView := self getViewForPackage:aPackage. |
|
3617 |
self temporaryWorkSpace isNil ifTrue:[ |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3618 |
self perforceError raiseErrorString:('Error getting temporary workspace when try to get temporary view'). |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3619 |
^nil. |
11532 | 3620 |
]. |
3621 |
self temporaryWorkSpace views do:[:aView| |
|
12893
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3622 |
myView depot = aView depot ifTrue:[ |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3623 |
^ aView |
61328b650b79
class: PerforceSourceCodeManagerUtilities
Claus Gittinger <cg@exept.de>
parents:
12725
diff
changeset
|
3624 |
]. |
11532 | 3625 |
]. |
3626 |
! |
|
3627 |
||
3628 |
getViewForDepotPath:depotPath |
|
3629 |
||
3630 |
|myHostName| |
|
3631 |
||
3632 |
myHostName := OperatingSystem getHostName. |
|
3633 |
(myHostName endsWith:OperatingSystem getDomainName) ifTrue:[ |
|
3634 |
myHostName := myHostName copyTo:(myHostName size - (OperatingSystem getDomainName size + 1)). |
|
3635 |
]. |
|
3636 |
||
3637 |
(myHostName asLowercase startsWith:(self host asLowercase)) ifFalse:[ |
|
3638 |
self perforceError raiseErrorString:('Client ', (perforceSettings at:#client), ' is made for host ', self host, ' and not for ', myHostName). |
|
3639 |
^ nil |
|
3640 |
]. |
|
3641 |
self views do:[:aView | |
|
3642 |
(aView hasViewForDepotPath:depotPath) ifTrue:[ |
|
3643 |
^aView |
|
3644 |
]. |
|
3645 |
]. |
|
3646 |
self perforceError raiseErrorString:('Client ', (perforceSettings at:#client), ' have no View for depot path ', depotPath). |
|
3647 |
^ nil |
|
3648 |
! |
|
3649 |
||
3650 |
getViewForPackage:aPackage |
|
3651 |
||
3652 |
|locPackage packagePath| |
|
3653 |
||
3654 |
aPackage isNil ifTrue:[ |
|
3655 |
locPackage := Smalltalk package. |
|
3656 |
] ifFalse:[ |
|
3657 |
locPackage := aPackage. |
|
3658 |
]. |
|
3659 |
packagePath := self packageDirectoryForPackageId:locPackage. |
|
3660 |
packagePath notNil ifTrue:[ |
|
3661 |
packagePath := packagePath pathName. |
|
3662 |
] ifFalse:[ |
|
3663 |
self perforceError raiseErrorString:('no package path for ', aPackage printString). |
|
3664 |
^nil |
|
3665 |
]. |
|
3666 |
^self getViewForPath:packagePath |
|
3667 |
||
3668 |
" |
|
3669 |
PerforceSourceCodeManager perforceWorkspaces first value getViewForPackage:'applistx:application/rtdbInspector/builder' |
|
3670 |
" |
|
3671 |
! |
|
3672 |
||
3673 |
getViewForPath:aPathName |
|
3674 |
||
3675 |
|myHostName| |
|
3676 |
||
3677 |
myHostName := OperatingSystem getHostName. |
|
3678 |
(myHostName endsWith:OperatingSystem getDomainName) ifTrue:[ |
|
3679 |
myHostName := myHostName copyTo:(myHostName size - (OperatingSystem getDomainName size + 1)). |
|
3680 |
]. |
|
3681 |
||
3682 |
(myHostName asLowercase startsWith:(self host asLowercase)) ifFalse:[ |
|
3683 |
self perforceError raiseErrorString:('Client ', (perforceSettings at:#client), ' is made for host ', self host, ' and not for ', myHostName). |
|
3684 |
^ nil |
|
3685 |
]. |
|
3686 |
self views do:[:aView | |
|
3687 |
(aView hasViewForPath:aPathName) ifTrue:[ |
|
3688 |
^aView |
|
3689 |
]. |
|
3690 |
]. |
|
3691 |
self perforceError raiseErrorString:('Client ', (perforceSettings at:#client), ' have no View for path ', aPathName). |
|
3692 |
^ nil |
|
3693 |
! |
|
3694 |
||
3695 |
hasViewForPackage:aPackage |
|
3696 |
||
3697 |
^(self getViewForPackage:aPackage) notNil |
|
3698 |
! |
|
3699 |
||
3700 |
hasViewForPath:aPathName |
|
3701 |
||
3702 |
^(self getViewForPath:aPathName) notNil |
|
3703 |
! |
|
3704 |
||
3705 |
packageDirectoryForPackageId:package |
|
3706 |
||
3707 |
^self packageDirectoryForPackageId:package checkParents:true |
|
3708 |
||
3709 |
" |
|
3710 |
PerforceSourceCodeManager perforceWorkspaces first value getViewForPackage:'applisddtx:application/rtdbInspector/builder' |
|
3711 |
" |
|
3712 |
! |
|
3713 |
||
3714 |
packageDirectoryForPackageId:package checkParents:checkParents |
|
3715 |
||
3716 |
|locPackage packagePath| |
|
3717 |
||
3718 |
locPackage := package copyReplaceAll:$: with:$/. |
|
3719 |
[ packagePath isNil ] whileTrue:[ |
|
3720 |
packagePath := Smalltalk packageDirectoryForPackageId:locPackage. |
|
3721 |
packagePath notNil ifTrue:[ |
|
3722 |
^packagePath |
|
3723 |
]. |
|
3724 |
locPackage := locPackage asFilename directoryName. |
|
3725 |
]. |
|
3726 |
^nil |
|
3727 |
||
3728 |
" |
|
3729 |
PerforceSourceCodeManager perforceWorkspaces first value getViewForPackage:'applisddtx:application/rtdbInspector/builder' |
|
3730 |
" |
|
3731 |
! |
|
3732 |
||
3733 |
perforceError |
|
3734 |
||
3735 |
^ PerforceSourceCodeManager perforceError |
|
3736 |
! |
|
3737 |
||
3738 |
perforceSettingsString |
|
3739 |
||
3740 |
^ PerforceSourceCodeManager getStringFromPerforceSettings:self perforceSettings |
|
3741 |
! |
|
3742 |
||
3743 |
readRevisionLogEntryFromStream:inStream |
|
3744 |
"read and parse a single revision info-entry from the cvs log output. |
|
3745 |
Return nil on end. |
|
3746 |
||
3747 |
The returned information is a structure (IdentityDictionary) |
|
3748 |
filled with: |
|
3749 |
#revision -> the revision string |
|
3750 |
#author -> who checked that revision into the repository |
|
3751 |
#date -> when was it checked in |
|
3752 |
#state -> the RCS state |
|
3753 |
#logMessage -> the checkIn log message |
|
3754 |
" |
|
3755 |
||
3756 |
|revLine1 atEnd| |
|
3757 |
||
3758 |
atEnd := false. |
|
3759 |
||
3760 |
revLine1 := inStream nextLine. |
|
3761 |
^ self readRevisionLogEntryFromString:revLine1. |
|
3762 |
! |
|
3763 |
||
3764 |
readRevisionLogEntryFromString:revLine1 |
|
3765 |
"read and parse a single revision info-entry from the cvs log output. |
|
3766 |
Return nil on end. |
|
3767 |
||
3768 |
The returned information is a structure (IdentityDictionary) |
|
3769 |
filled with: |
|
3770 |
#revision -> the revision string |
|
3771 |
#author -> who checked that revision into the repository |
|
3772 |
#date -> when was it checked in |
|
3773 |
#state -> the RCS state |
|
3774 |
#logMessage -> the checkIn log message |
|
3775 |
" |
|
3776 |
||
3777 |
| record revisionLineElements noOfRevisionLineElements posText| |
|
3778 |
||
3779 |
(revLine1 notNil) ifTrue:[ |
|
3780 |
record := IdentityDictionary new. |
|
3781 |
revisionLineElements := revLine1 asCollectionOfWords. |
|
3782 |
noOfRevisionLineElements := revisionLineElements size. |
|
3783 |
noOfRevisionLineElements > 1 ifTrue:[ |
|
3784 |
record at:#revision put:((revisionLineElements at:2) copyFrom:2). |
|
3785 |
]. |
|
3786 |
noOfRevisionLineElements > 8 ifTrue:[ |
|
3787 |
record at:#author put:(revisionLineElements at:9). |
|
3788 |
]. |
|
3789 |
noOfRevisionLineElements > 6 ifTrue:[ |
|
3790 |
record at:#date put:(revisionLineElements at:7). |
|
3791 |
]. |
|
3792 |
noOfRevisionLineElements > 4 ifTrue:[ |
|
3793 |
record at:#state put:(revisionLineElements at:5). |
|
3794 |
]. |
|
3795 |
noOfRevisionLineElements > 10 ifTrue:[ |
|
3796 |
posText := 0. |
|
3797 |
1 to:9 do:[:ele| posText := posText + (revisionLineElements at:ele) size + 1]. |
|
3798 |
record at:#logMessage put:(revLine1 copyFrom:posText). |
|
3799 |
]. |
|
3800 |
]. |
|
3801 |
^record. |
|
3802 |
! |
|
3803 |
||
3804 |
temporaryClientName |
|
3805 |
||
3806 |
^ 'stxCheckinWorkSpace_', self owner, self host. |
|
3807 |
! ! |
|
3808 |
||
3809 |
!PerforceSourceCodeManagerUtilities::WorkSpace methodsFor:'read'! |
|
3810 |
||
3811 |
getDefinitionFromServer |
|
3812 |
|cmd myBaseDirectory outputStream errorStream rslt clients inStream line words| |
|
3813 |
||
3814 |
cmd := 'clients -u ' , (self perforceSettings at:#user). |
|
18738 | 3815 |
myBaseDirectory := Filename currentDirectory pathName. |
11532 | 3816 |
outputStream := WriteStream on:''. |
3817 |
errorStream := WriteStream on:''. |
|
3818 |
rslt := self |
|
3819 |
executePerforceCommand:cmd |
|
3820 |
inDirectory:myBaseDirectory |
|
3821 |
inputFrom:nil |
|
3822 |
outputTo:outputStream |
|
3823 |
errorTo:errorStream |
|
3824 |
logHeader:('getting workspaces '). |
|
3825 |
rslt ifFalse:[ |
|
3826 |
self perforceError raiseErrorString:(outputStream contents, errorStream contents). |
|
3827 |
^false |
|
3828 |
]. |
|
3829 |
clients := OrderedCollection new. |
|
3830 |
inStream := ReadStream on:(outputStream contents). |
|
3831 |
[ inStream atEnd not ] whileTrue:[ |
|
3832 |
line := inStream nextLine. |
|
3833 |
line notEmptyOrNil ifTrue:[ |
|
3834 |
words := line asCollectionOfWords. |
|
3835 |
words size > 1 ifTrue:[ |
|
3836 |
clients add:(words at:2). |
|
3837 |
]. |
|
3838 |
]. |
|
3839 |
]. |
|
3840 |
(clients includes:(self perforceSettings at:#client ifAbsent:nil)) ifFalse:[ |
|
3841 |
self perforceError raiseErrorString:('No workspace ', (self perforceSettings at:#client ifAbsent:'?'), ' for user ', (self perforceSettings at:#user ifAbsent:'?'), ' on ', (self perforceSettings at:#port ifAbsent:'?'), ' available.'). |
|
3842 |
]. |
|
3843 |
||
3844 |
cmd := 'client -o'. |
|
3845 |
myBaseDirectory := (Filename currentDirectory asAbsoluteFilename) pathName. |
|
3846 |
outputStream reset. |
|
3847 |
errorStream reset. |
|
3848 |
rslt := self |
|
3849 |
executePerforceCommand:cmd |
|
3850 |
inDirectory:myBaseDirectory |
|
3851 |
inputFrom:nil |
|
3852 |
outputTo:outputStream |
|
3853 |
errorTo:errorStream |
|
3854 |
logHeader:('getting empty workspace definition '). |
|
3855 |
rslt ifFalse:[ |
|
3856 |
self perforceError raiseErrorString:(outputStream contents, errorStream contents). |
|
3857 |
^false |
|
3858 |
]. |
|
3859 |
inStream := ReadStream on:(outputStream contents). |
|
3860 |
self getWorkSpaceFromClientSpecFrom:inStream. |
|
3861 |
^true |
|
3862 |
||
3863 |
" |
|
3864 |
(PerforceSourceCodeManager getWorkSpaceForPackage:'applistx') getDefinitionFromServer |
|
3865 |
" |
|
18738 | 3866 |
|
3867 |
"Modified: / 11-04-2019 / 18:07:11 / Stefan Vogel" |
|
11532 | 3868 |
! |
3869 |
||
3870 |
getWorkSpaceFromClientSpecFrom:inStream |
|
3871 |
" |
|
3872 |
get the workspace definition from perforce client command output |
|
3873 |
" |
|
3874 |
||
3875 |
|line nextKey | |
|
3876 |
||
3877 |
[inStream atEnd not] whileTrue:[ |
|
3878 |
line:= inStream nextLine. |
|
3879 |
line notEmptyOrNil ifTrue:[ |
|
3880 |
line first = $# ifFalse:[ |
|
3881 |
(line startsWith:'Owner:') ifTrue:[ |
|
3882 |
self owner:line asCollectionOfWords second. |
|
3883 |
]. |
|
3884 |
(line startsWith:'Host:') ifTrue:[ |
|
3885 |
self host:line asCollectionOfWords second. |
|
3886 |
]. |
|
3887 |
(line startsWith:'Client:') ifTrue:[ |
|
3888 |
self client:(line asCollectionOfWords second). |
|
3889 |
]. |
|
3890 |
(line startsWith:'Root:') ifTrue:[ |
|
3891 |
self root:((line copyFrom:('Root:' size + 1)) withoutLeadingSeparators). |
|
3892 |
]. |
|
3893 |
(line startsWith:'View:') ifTrue:[ |
|
3894 |
nextKey := false. |
|
3895 |
[nextKey not and:[inStream atEnd not]] whileTrue:[ |
|
3896 |
line:= inStream nextLine. |
|
3897 |
line notEmptyOrNil ifTrue:[ |
|
3898 |
line first isSeparator ifTrue:[ |
|
3899 |
self views add:(View newFromLine:line workspace:self). |
|
3900 |
] ifFalse:[ |
|
3901 |
nextKey := true. |
|
3902 |
]. |
|
3903 |
]. |
|
3904 |
]. |
|
3905 |
]. |
|
3906 |
]. |
|
3907 |
]. |
|
3908 |
]. |
|
3909 |
! |
|
3910 |
||
3911 |
newWorkSpaceFor:settingsString |
|
3912 |
settingsString isNil ifTrue:[ |
|
3913 |
^ nil |
|
3914 |
]. |
|
3915 |
self perforceSettings:(PerforceSourceCodeManager |
|
3916 |
getPerforceSettingsFromString:settingsString). |
|
3917 |
self getDefinitionFromServer ifTrue:[ |
|
3918 |
^self |
|
3919 |
]. |
|
3920 |
^nil |
|
3921 |
! |
|
3922 |
||
3923 |
newWorkSpaceForSettings:settingsDict |
|
3924 |
||
3925 |
settingsDict isNil ifTrue:[ |
|
3926 |
self perforceError raiseErrorString:('nil settings when creating workspace'). |
|
3927 |
^ self |
|
3928 |
]. |
|
3929 |
self perforceSettings:settingsDict. |
|
3930 |
! ! |
|
3931 |
||
3932 |
!PerforceSourceCodeManagerUtilities::WorkSpace::View class methodsFor:'instance creation'! |
|
3933 |
||
3934 |
newFromLine:aLine workspace:aWorkspaceDefinition |
|
3935 |
||
3936 |
|instance| |
|
3937 |
||
3938 |
instance := self new. |
|
3939 |
instance newFromLine:aLine. |
|
3940 |
instance workspace:aWorkspaceDefinition. |
|
3941 |
^instance |
|
3942 |
! ! |
|
3943 |
||
3944 |
!PerforceSourceCodeManagerUtilities::WorkSpace::View methodsFor:'accessing'! |
|
3945 |
||
3946 |
depot |
|
3947 |
^ depot |
|
3948 |
! |
|
3949 |
||
3950 |
depot:something |
|
3951 |
depot := something. |
|
3952 |
! |
|
3953 |
||
3954 |
local |
|
3955 |
^ local |
|
3956 |
! |
|
3957 |
||
3958 |
local:something |
|
3959 |
local := something. |
|
3960 |
! |
|
3961 |
||
3962 |
type |
|
3963 |
||
3964 |
" there special types for views |
|
3965 |
+ for added to the same directory |
|
3966 |
- exclude this view |
|
3967 |
and standard view |
|
3968 |
" |
|
3969 |
||
3970 |
^ type |
|
3971 |
! |
|
3972 |
||
3973 |
type:something |
|
3974 |
type := something. |
|
3975 |
! |
|
3976 |
||
3977 |
workspace |
|
3978 |
^ workspace |
|
3979 |
! |
|
3980 |
||
3981 |
workspace:something |
|
3982 |
workspace := something. |
|
3983 |
! ! |
|
3984 |
||
3985 |
!PerforceSourceCodeManagerUtilities::WorkSpace::View methodsFor:'queries'! |
|
3986 |
||
3987 |
getDepotPathForLocalPath:aFilename |
|
3988 |
|depotPath restPath unixRestPath| |
|
3989 |
||
3990 |
(self hasViewForPath:aFilename) ifFalse:[ |
|
3991 |
^nil |
|
3992 |
]. |
|
3993 |
depotPath := depot. |
|
3994 |
(depot endsWith:'...') ifTrue:[ |
|
3995 |
depotPath := depot copyTo:(depot size - 3). |
|
3996 |
] ifFalse:[ |
|
3997 |
depotPath := depot. |
|
3998 |
]. |
|
3999 |
restPath := PerforceSourceCodeManager getTrailungPathNameFrom:aFilename with:self localPathName. |
|
4000 |
unixRestPath := (UnixFilename fromComponents:(restPath asFilename components)) pathName. |
|
4001 |
depotPath := depotPath, unixRestPath. |
|
4002 |
^depotPath. |
|
4003 |
! |
|
4004 |
||
4005 |
getLocalPathForDepotPath:depotPath |
|
4006 |
|viewDepotPath restPath| |
|
4007 |
||
4008 |
(self hasViewForDepotPath:depotPath) ifFalse:[ |
|
4009 |
^nil |
|
4010 |
]. |
|
4011 |
viewDepotPath := depot. |
|
4012 |
(depot endsWith:'...') ifTrue:[ |
|
4013 |
viewDepotPath := depot copyTo:(depot size - 3). |
|
4014 |
] ifFalse:[ |
|
4015 |
viewDepotPath := depot. |
|
4016 |
]. |
|
4017 |
restPath := PerforceSourceCodeManager getTrailungPathNameFrom:depotPath with:viewDepotPath. |
|
4018 |
^ (self localPathName asFilename construct:restPath) pathName. |
|
4019 |
! |
|
4020 |
||
4021 |
hasViewForDepotPath:depotPath |
|
4022 |
||
4023 |
|viewDepotPath| |
|
4024 |
||
4025 |
depotPath isEmptyOrNil ifTrue:[ |
|
4026 |
^ false. |
|
4027 |
]. |
|
4028 |
viewDepotPath := depot. |
|
4029 |
(depot endsWith:'...') ifTrue:[ |
|
4030 |
viewDepotPath := depot copyTo:(depot size - 3). |
|
4031 |
] ifFalse:[ |
|
4032 |
viewDepotPath := depot. |
|
4033 |
]. |
|
4034 |
(PerforceSourceCodeManager path:depotPath hasSamePrefixLikePath:viewDepotPath) ifFalse:[ |
|
4035 |
^false |
|
4036 |
]. |
|
4037 |
^true |
|
4038 |
! |
|
4039 |
||
4040 |
hasViewForPath:aPathname |
|
4041 |
||
4042 |
aPathname isEmptyOrNil ifTrue:[ |
|
4043 |
^ false. |
|
4044 |
]. |
|
4045 |
(PerforceSourceCodeManager path:aPathname hasSamePrefixLikePath:self localPathName) ifFalse:[ |
|
4046 |
^false |
|
4047 |
]. |
|
4048 |
^true |
|
4049 |
! |
|
4050 |
||
4051 |
localPathName |
|
4052 |
||
4053 |
|indexOfClientString localPathName| |
|
4054 |
||
4055 |
(local endsWith:'...') ifTrue:[ |
|
4056 |
localPathName := local copyTo:(local size -3). |
|
4057 |
] ifFalse:[ |
|
4058 |
localPathName := local. |
|
4059 |
]. |
|
4060 |
indexOfClientString := local findString:workspace client. |
|
4061 |
indexOfClientString == 0 ifTrue:[ |
|
4062 |
^workspace root. |
|
4063 |
]. |
|
4064 |
localPathName := workspace root asFilename construct:(localPathName copyFrom:(indexOfClientString + workspace client size)). |
|
4065 |
^localPathName pathName |
|
4066 |
! ! |
|
4067 |
||
4068 |
!PerforceSourceCodeManagerUtilities::WorkSpace::View methodsFor:'reading'! |
|
4069 |
||
4070 |
newFromLine:aLine |
|
4071 |
||
4072 |
|words firstIndex secondIndex theLine| |
|
4073 |
||
4074 |
theLine := aLine withoutLeadingSeparators. |
|
4075 |
theLine := theLine withoutTrailingSeparators. |
|
4076 |
theLine isEmpty ifTrue:[ |
|
4077 |
^self |
|
4078 |
]. |
|
4079 |
theLine first == $+ ifTrue:[ |
|
4080 |
type := #+. |
|
4081 |
theLine := theLine copyFrom:2. |
|
4082 |
]. |
|
4083 |
theLine first == $- ifTrue:[ |
|
4084 |
type := #-. |
|
4085 |
theLine := theLine copyFrom:2. |
|
4086 |
]. |
|
4087 |
(theLine includes:$") ifTrue:[ |
|
4088 |
"oops we have space directories search for quotes" |
|
4089 |
||
4090 |
firstIndex := theLine indexOf:$" startingAt:1. |
|
4091 |
firstIndex == 1 ifTrue:[ |
|
4092 |
secondIndex := theLine indexOf:$" startingAt:firstIndex + 1. |
|
4093 |
depot := theLine copyFrom:firstIndex + 1 to:secondIndex - 1. |
|
4094 |
firstIndex := theLine indexOf:$" startingAt:secondIndex + 1. |
|
4095 |
secondIndex := theLine indexOf:$" startingAt:firstIndex + 1. |
|
4096 |
local := theLine copyFrom:firstIndex + 1 to:secondIndex - 1. |
|
4097 |
] ifFalse:[ |
|
4098 |
depot := (theLine copyTo:firstIndex - 1) withoutTrailingSeparators. |
|
4099 |
local := theLine copyFrom:firstIndex + 1 to:(theLine size - 1). |
|
4100 |
]. |
|
4101 |
] ifFalse:[ |
|
4102 |
words := theLine asCollectionOfWords. |
|
4103 |
depot := words first. |
|
4104 |
local := words second. |
|
4105 |
]. |
|
4106 |
||
4107 |
" |
|
4108 |
View newFromLine:ws contents. |
|
4109 |
" |
|
4110 |
! ! |
|
4111 |
||
4112 |
!PerforceSourceCodeManagerUtilities class methodsFor:'documentation'! |
|
4113 |
||
4114 |
version |
|
16059 | 4115 |
^ '$Header$' |
11532 | 4116 |
! |
4117 |
||
4118 |
version_CVS |
|
16059 | 4119 |
^ '$Header$' |
11532 | 4120 |
! ! |
12702
2759bbb8d06b
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
11959
diff
changeset
|
4121 |