author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 26 Mar 2014 15:17:29 +0000 | |
changeset 408 | 9b24602affa1 |
parent 389 | 1e2e6ce45878 |
child 471 | 44664f7f71c5 |
permissions | -rw-r--r-- |
44 | 1 |
" |
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
2 |
stx:libscm - a new source code management library for Smalltalk/X |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
3 |
Copyright (C) 2012-2013 Jan Vrany |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
4 |
|
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
5 |
This library is free software; you can redistribute it and/or |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
6 |
modify it under the terms of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
7 |
License as published by the Free Software Foundation; either |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
8 |
version 2.1 of the License. |
44 | 9 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
10 |
This library is distributed in the hope that it will be useful, |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
13 |
Lesser General Public License for more details. |
44 | 14 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
15 |
You should have received a copy of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
16 |
License along with this library; if not, write to the Free Software |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
17 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
44 | 18 |
" |
19 |
"{ Package: 'stx:libscm/common' }" |
|
20 |
||
21 |
SCMAbstractFileoutLikeTask subclass:#SCMAbstractCommitTask |
|
22 |
instanceVariableNames:'message paths' |
|
23 |
classVariableNames:'' |
|
24 |
poolDictionaries:'' |
|
25 |
category:'SCM-Common-StX-Tasks' |
|
26 |
! |
|
27 |
||
28 |
!SCMAbstractCommitTask class methodsFor:'documentation'! |
|
29 |
||
30 |
copyright |
|
31 |
" |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
32 |
stx:libscm - a new source code management library for Smalltalk/X |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
33 |
Copyright (C) 2012-2013 Jan Vrany |
44 | 34 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
35 |
This library is free software; you can redistribute it and/or |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
36 |
modify it under the terms of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
37 |
License as published by the Free Software Foundation; either |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
38 |
version 2.1 of the License. |
44 | 39 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
40 |
This library is distributed in the hope that it will be useful, |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
41 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
42 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
43 |
Lesser General Public License for more details. |
44 | 44 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
45 |
You should have received a copy of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
46 |
License along with this library; if not, write to the Free Software |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
282
diff
changeset
|
47 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
44 | 48 |
" |
49 |
! ! |
|
50 |
||
51 |
!SCMAbstractCommitTask methodsFor:'accessing'! |
|
52 |
||
53 |
message |
|
408
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
54 |
"Returns initial commit message" |
44 | 55 |
|
408
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
56 |
"/ NO, do not generate commit message based on changes in code. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
57 |
"/ Such commit message is completely useless!! |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
58 |
^ '' |
44 | 59 |
|
408
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
60 |
"/ message isNil ifTrue:[ |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
61 |
"/ self isPackageCommit ifTrue:[ |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
62 |
"/ message := String streamContents: [:s| |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
63 |
"/ | klasses methods msg | |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
64 |
"/ klasses := OrderedCollection streamContents:[:s|packages do:[:each | s nextPutAll: (self classesToFileOutFor: each) ]]. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
65 |
"/ methods := OrderedCollection streamContents:[:s|packages do:[:each | s nextPutAll: (self extensionMethodsToFileOutFor: each) ]]. . |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
66 |
"/ klasses do:[:cls| |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
67 |
"/ msg := SCMAbstractSourceCodeManager utilities goodInitialLogMessageForCheckinClassOfClass:cls. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
68 |
"/ msg notEmptyOrNil ifTrue: [ |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
69 |
"/ s nextPutAll: ' - '; nextPutLine: cls name. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
70 |
"/ msg asStringCollection do:[:line| |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
71 |
"/ s nextPutAll:' '; nextPutLine: line. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
72 |
"/ ] |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
73 |
"/ ]. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
74 |
"/ ]. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
75 |
"/ methods notEmptyOrNil ifTrue:[ |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
76 |
"/ s nextPutLine: ' - extensions'. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
77 |
"/ s nextPutLine: ' ...'. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
78 |
"/ ]. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
79 |
"/ ] |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
80 |
"/ ]. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
81 |
"/ ]. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
82 |
"/ ^message. |
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
83 |
|
9b24602affa1
Fix for issue #30 - Commit button is disabled even if commit message is not empty (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
389
diff
changeset
|
84 |
"Modified: / 26-03-2014 / 15:01:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 85 |
! |
86 |
||
87 |
message:aString |
|
88 |
message := aString. |
|
89 |
! |
|
90 |
||
91 |
paths |
|
92 |
^ paths |
|
93 |
! |
|
94 |
||
95 |
paths:aCollection |
|
96 |
paths := aCollection. |
|
97 |
! ! |
|
98 |
||
99 |
!SCMAbstractCommitTask methodsFor:'executing'! |
|
100 |
||
101 |
do |
|
102 |
self |
|
103 |
doPrepareWorkingCopy; |
|
104 |
doCommit |
|
105 |
||
106 |
"Created: / 23-03-2009 / 11:15:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
107 |
"Modified: / 17-06-2009 / 10:16:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
108 |
! |
|
109 |
||
110 |
doCommit |
|
56
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
111 |
|containers commitLabel msg | |
44 | 112 |
|
113 |
msg := ((message ? '<no commit message>') asStringCollection |
|
114 |
reject: [:line|line size >= 2 and:[line first == $# and:[line second == $#]]]) |
|
115 |
asString. |
|
116 |
||
117 |
self do:[ |
|
118 |
self isPackageCommit ifFalse:[ |
|
282
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
119 |
paths notEmptyOrNil ifTrue:[ |
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
120 |
commitLabel := paths size > 2 |
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
121 |
ifTrue:[((paths upTo: 2) asStringWith:', ') , (' and %1 others' bindWith: paths size - 3)] |
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
122 |
ifFalse:[paths asStringWith:', ']. |
44 | 123 |
] ifFalse:[ |
282
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
124 |
commitLabel := temporaryWorkingCopy pathName. |
44 | 125 |
]. |
126 |
containers := paths |
|
127 |
] ifTrue:[ |
|
282
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
128 |
commitLabel := (paths isEmptyOrNil or:[paths size > 2]) |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
129 |
ifTrue:[packages size == 1 ifTrue:[ packages anElement name ] ifFalse:[ packages first name , ', ...' ]] |
282
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
130 |
ifFalse:[paths asStringWith:', ']. |
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
131 |
containers := paths isEmptyOrNil |
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
132 |
ifTrue:[self isSelectiveFileoutTask |
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
133 |
ifTrue:[self containersToFileOut] |
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
134 |
ifFalse:[nil "Meaning - all modified files will be commited"]] |
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
135 |
ifFalse:[paths]. |
44 | 136 |
]. |
72
66345356fa65
Fix in SCMAbstractCommitTask>>doCommit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
68
diff
changeset
|
137 |
(containers isNil or:[containers notEmpty]) ifTrue: [ |
60 | 138 |
ActivityNotification notify:'Commiting ' , commitLabel. |
139 |
self doCommit: msg files: containers. |
|
140 |
]. |
|
56
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
141 |
ActivityNotification notify:'Shrinking changes'. |
282
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
142 |
self isPackageCommit ifTrue:[ |
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
143 |
self doShrinkChanges. |
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
144 |
]. |
44 | 145 |
]. |
282
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
146 |
self isPackageCommit ifTrue:[ |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
147 |
packages do:[:each | each isVirtual ifFalse: [ each commited ] ] |
282
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
148 |
]. |
44 | 149 |
|
150 |
"Created: / 11-04-2008 / 09:20:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
151 |
"Modified: / 19-08-2009 / 12:27:44 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
152 |
"Modified: / 14-03-2012 / 17:42:25 / jv" |
|
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
153 |
"Modified: / 27-02-2014 / 22:54:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
56
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
154 |
! |
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
155 |
|
44 | 156 |
doPrepareWorkingCopy |
157 |
||
158 |
self doPrepareWorkingCopy1. |
|
159 |
self doPrepareWorkingCopy2. |
|
160 |
||
161 |
"Created: / 11-04-2008 / 09:19:27 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
162 |
"Modified: / 17-08-2009 / 18:28:34 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
163 |
"Modified: / 07-10-2012 / 09:32:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
164 |
! |
|
165 |
||
166 |
doPrepareWorkingCopy1 |
|
167 |
||
168 |
self isPackageCommit ifTrue:[ |
|
169 |
self do:[ |
|
170 |
self doUpdateCode. |
|
171 |
] |
|
172 |
]. |
|
173 |
||
174 |
"Created: / 10-05-2012 / 17:08:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
175 |
! |
|
176 |
||
177 |
doPrepareWorkingCopy2 |
|
178 |
||
179 |
self isPackageCommit ifTrue:[ |
|
180 |
self do:[ |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
181 |
| p | |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
182 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
183 |
p := packages anElement. |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
184 |
p ensureTemporaryWorkingCopy. |
44 | 185 |
self doFileOut |
186 |
] |
|
187 |
]. |
|
188 |
||
189 |
"Created: / 10-05-2012 / 17:08:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
190 |
"Modified: / 21-02-2014 / 23:28:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
122
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
191 |
! ! |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
192 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
193 |
!SCMAbstractCommitTask methodsFor:'executing-private'! |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
194 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
195 |
doCommit: msg files: containers |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
196 |
"Actually commit the changes, To be overridden by subclasses" |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
197 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
198 |
self synchronized:[ |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
199 |
self halt: 'Have to be smart here!!!!!!'. |
122
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
200 |
self package workingCopy commit: msg files: containers. |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
201 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
202 |
"/ "Update the working copy. We need svn info |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
203 |
"/ to report commited revision" |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
204 |
"/ (UpdateCommand new) |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
205 |
"/ workingCopy:self workingCopy; |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
206 |
"/ execute |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
207 |
]. |
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
208 |
|
f72225c1f433
Adde parent/child relationship to SCMAbstractPackageModel
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
117
diff
changeset
|
209 |
"Created: / 15-11-2012 / 09:39:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
210 |
"Modified: / 21-02-2014 / 23:27:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 211 |
! |
212 |
||
213 |
doSanityChecks |
|
214 |
"Perform some sanity checks on the package |
|
215 |
(or individual classes and/or methods). |
|
216 |
Return a project checker. Use #problems to get the |
|
217 |
list of problems" |
|
218 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
219 |
| checker | |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
220 |
|
44 | 221 |
self isPackageCommit ifFalse:[ ^ nil ]. |
222 |
(ConfigurableFeatures includesFeature:#ProjectChecker) ifFalse:[ ^ nil ]. |
|
223 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
224 |
checker := ProjectChecker new. |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
225 |
packages do:[:each | each isVirtual ifFalse: [ checker package: each name ] ]. |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
226 |
|
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
227 |
checker |
44 | 228 |
classes: classes; |
229 |
methods: (extensionMethods = #() ifTrue:[nil] ifFalse:[extensionMethods]); |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
230 |
check. |
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
231 |
^ checker |
44 | 232 |
|
233 |
"Created: / 11-04-2008 / 09:19:27 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
234 |
"Modified: / 17-08-2009 / 18:28:34 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
235 |
"Created: / 13-02-2012 / 16:36:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
236 |
"Modified: / 27-02-2014 / 22:54:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
56
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
237 |
! |
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
238 |
|
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
239 |
doShrinkChanges |
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
240 |
|
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
241 |
"Do this only iff this is a package commit" |
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
242 |
self isPackageCommit ifTrue:[ |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
243 |
packages do:[:each | |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
244 |
each isVirtual ifFalse: [ |
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
245 |
(ChangeSet current) |
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
246 |
condenseChangesForPackageAfterCommit:each name; |
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
247 |
condenseChangesForExtensionsInPackage:each name; |
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
248 |
flushChangedClassesCache; |
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
249 |
yourself. |
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
250 |
] |
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
251 |
] |
56
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
252 |
]. |
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
253 |
|
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
254 |
"Created: / 15-11-2012 / 09:41:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
387
ebec1ef28839
Added notion if 'virtual' package
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
381
diff
changeset
|
255 |
"Modified: / 27-02-2014 / 22:54:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 256 |
! ! |
257 |
||
389
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
258 |
!SCMAbstractCommitTask methodsFor:'queries'! |
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
259 |
|
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
260 |
isCommitingAllChangedPackages |
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
261 |
"Return true, if package group contain all changed packages |
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
262 |
of given repository, false otherwise." |
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
263 |
|
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
264 |
^ packages containsAllChangedPackages |
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
265 |
|
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
266 |
"Created: / 03-03-2014 / 00:12:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
267 |
! ! |
1e2e6ce45878
Added new warning to commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
387
diff
changeset
|
268 |
|
44 | 269 |
!SCMAbstractCommitTask methodsFor:'testing'! |
270 |
||
271 |
isPackageCommit |
|
272 |
"Returns true iff this task is for a package |
|
273 |
(or part of it). False if this is ad-hoc commit task - |
|
274 |
for example ad-hoc commit from a file browser" |
|
275 |
||
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
276 |
^ packages notEmpty" and:[paths isEmptyOrNil]" |
44 | 277 |
|
278 |
"Modified: / 14-03-2012 / 17:27:17 / jv" |
|
381
3dde2b867931
SCMAbstractFileoutLikeTask refactored to support multiple packages.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
279 |
"Modified: / 21-02-2014 / 22:54:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
44 | 280 |
! ! |
281 |
||
282 |
!SCMAbstractCommitTask class methodsFor:'documentation'! |
|
283 |
||
284 |
version_GIT |
|
285 |
"Never, ever change this method. Ask JV or CG why" |
|
286 |
^thisContext method mclass theNonMetaclass instVarNamed: #revision |
|
287 |
! |
|
288 |
||
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
289 |
version_HG |
114
8b27cb46af9a
version_HG changed to return String.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
290 |
|
8b27cb46af9a
version_HG changed to return String.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
85
diff
changeset
|
291 |
^ '$Changeset: <not expanded> $' |
53
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
292 |
! |
8043f7b6f41a
- More common code refactored
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
44
diff
changeset
|
293 |
|
44 | 294 |
version_SVN |
56
c183805e5eb1
Few hacks to make Mercurial commits working.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
53
diff
changeset
|
295 |
^ '§Id:: §' |
44 | 296 |
! ! |
282
fb71143ed353
Fixes for commiting from filebrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
122
diff
changeset
|
297 |