675
|
1 |
"
|
|
2 |
Copyright (c) 2007-2010 Jan Vrany
|
|
3 |
Copyright (c) 2009-2010 eXept Software AG
|
|
4 |
|
|
5 |
Permission is hereby granted, free of charge, to any person
|
|
6 |
obtaining a copy of this software and associated documentation
|
|
7 |
files (the 'Software'), to deal in the Software without
|
|
8 |
restriction, including without limitation the rights to use,
|
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10 |
copies of the Software, and to permit persons to whom the
|
|
11 |
Software is furnished to do so, subject to the following
|
|
12 |
conditions:
|
|
13 |
|
|
14 |
The above copyright notice and this permission notice shall be
|
|
15 |
included in all copies or substantial portions of the Software.
|
|
16 |
|
|
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
24 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
25 |
"
|
383
|
26 |
"{ Package: 'stx:libsvn' }"
|
49
|
27 |
|
|
28 |
"{ NameSpace: SVN }"
|
|
29 |
|
492
|
30 |
FileoutLikeTask subclass:#CommitTask
|
249
|
31 |
instanceVariableNames:'message'
|
49
|
32 |
classVariableNames:''
|
|
33 |
poolDictionaries:''
|
|
34 |
category:'SVN-Tasks'
|
|
35 |
!
|
|
36 |
|
675
|
37 |
!CommitTask class methodsFor:'documentation'!
|
|
38 |
|
|
39 |
copyright
|
|
40 |
"
|
|
41 |
Copyright (c) 2007-2010 Jan Vrany
|
|
42 |
Copyright (c) 2009-2010 eXept Software AG
|
|
43 |
|
|
44 |
Permission is hereby granted, free of charge, to any person
|
|
45 |
obtaining a copy of this software and associated documentation
|
|
46 |
files (the 'Software'), to deal in the Software without
|
|
47 |
restriction, including without limitation the rights to use,
|
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
49 |
copies of the Software, and to permit persons to whom the
|
|
50 |
Software is furnished to do so, subject to the following
|
|
51 |
conditions:
|
|
52 |
|
|
53 |
The above copyright notice and this permission notice shall be
|
|
54 |
included in all copies or substantial portions of the Software.
|
|
55 |
|
|
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
63 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
64 |
|
|
65 |
"
|
|
66 |
! !
|
|
67 |
|
|
68 |
!CommitTask class methodsFor:'others'!
|
|
69 |
|
|
70 |
version_CVS
|
|
71 |
^ '$ÂHeader: /cvs/stx/stx/libsvn/SVN__CommitTask.st,v 1.6 2009/10/19 12:52:48 fm Exp Â$'
|
|
72 |
! !
|
49
|
73 |
|
|
74 |
!CommitTask methodsFor:'accessing'!
|
|
75 |
|
675
|
76 |
message
|
492
|
77 |
|
675
|
78 |
message ifNil:[
|
|
79 |
| changedClasses changedMethods |
|
|
80 |
changedClasses := OrderedSet new.
|
|
81 |
changedMethods := OrderedSet new.
|
|
82 |
(ChangeSet current changesForPackage: package) do:
|
|
83 |
[:chg| | chgCls |
|
|
84 |
chg isClassChange ifTrue:
|
|
85 |
[(chgCls := chg changeClass theNonMetaclass) package == package
|
|
86 |
ifTrue:
|
|
87 |
[(classes isNil or:[classes includes: chgCls]) ifTrue:
|
|
88 |
[changedClasses add: chgCls]]
|
|
89 |
ifFalse:
|
|
90 |
[chg isMethodDefinitionChange ifTrue:
|
|
91 |
[changedMethods add: chg changeMethod]]]].
|
|
92 |
message := String streamContents:
|
|
93 |
[:s|
|
|
94 |
s cr.
|
|
95 |
changedClasses isEmpty ifFalse:
|
|
96 |
[s nextPutLine:'## Changed classes:'.
|
|
97 |
changedClasses do:
|
|
98 |
[:cls|s nextPutAll:'## ';nextPutAll: cls name; cr]].
|
|
99 |
changedMethods isEmpty ifFalse:
|
|
100 |
[s nextPutLine:'## Changed methods:'.
|
|
101 |
changedMethods do:
|
|
102 |
[:m|
|
|
103 |
s nextPutAll:'## '; nextPutAll: m mclass name;
|
|
104 |
nextPutAll:' >> #'; nextPutAll: m selector; cr]].
|
|
105 |
s nextPutLine:'##'.
|
|
106 |
s nextPutLine:'## Lines starting with ## will be removed'.
|
|
107 |
]].
|
|
108 |
^message.
|
49
|
109 |
|
675
|
110 |
"Modified: / 01-08-2010 / 13:02:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
49
|
111 |
!
|
|
112 |
|
|
113 |
message:aString
|
|
114 |
message := aString.
|
|
115 |
! !
|
|
116 |
|
|
117 |
!CommitTask methodsFor:'executing'!
|
|
118 |
|
|
119 |
do
|
|
120 |
self
|
675
|
121 |
doPrepareWorkingCopy;
|
|
122 |
doCommit
|
49
|
123 |
|
|
124 |
"Created: / 23-03-2009 / 11:15:37 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
125 |
"Modified: / 17-06-2009 / 10:16:37 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
126 |
!
|
|
127 |
|
|
128 |
doCommit
|
675
|
129 |
|containers commitInfo msg|
|
|
130 |
|
|
131 |
msg := ((message ? '<no commit message>') asStringCollection
|
|
132 |
reject: [:line|line size >= 2 and:[line first == $# and:[line second == $#]]])
|
|
133 |
asString.
|
49
|
134 |
|
675
|
135 |
self do:[
|
|
136 |
ActivityNotification notify:'Commiting ' , self package.
|
|
137 |
containers := self isSelectiveFileoutTask ifTrue:[
|
|
138 |
self containersToFileOut
|
|
139 |
] ifFalse:[ #() ].
|
|
140 |
self
|
|
141 |
synchronized:[
|
|
142 |
commitInfo := (CommitCommand new)
|
|
143 |
workingCopy:self workingCopy;
|
|
144 |
message: msg;
|
|
145 |
paths:containers;
|
|
146 |
execute.
|
|
147 |
"Update the working copy. We need svn info
|
|
148 |
to report commited revision"
|
|
149 |
(UpdateCommand new)
|
|
150 |
workingCopy:self workingCopy;
|
|
151 |
execute
|
|
152 |
].
|
|
153 |
self doCompileSvnRevisionNrMethod:true.
|
|
154 |
self doCompileSvnRepositoryUrlStringMethod.
|
|
155 |
ActivityNotification notify:'Shrinking changes'.
|
|
156 |
(ChangeSet current)
|
|
157 |
condenseChangesForPackage2:self package;
|
|
158 |
condenseChangesForExtensionsInPackage:self package;
|
|
159 |
flushChangedClassesCache;
|
|
160 |
yourself.
|
|
161 |
].
|
49
|
162 |
self workingCopy commited.
|
|
163 |
^ commitInfo
|
|
164 |
|
|
165 |
"Created: / 11-04-2008 / 09:20:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
166 |
"Modified: / 19-08-2009 / 12:27:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
675
|
167 |
"Modified: / 08-04-2011 / 15:58:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
49
|
168 |
!
|
|
169 |
|
675
|
170 |
doPrepareWorkingCopy
|
49
|
171 |
self do:[
|
675
|
172 |
self workingCopy ensureIsValid.
|
|
173 |
self doFileOutAll
|
49
|
174 |
]
|
|
175 |
|
|
176 |
"Created: / 11-04-2008 / 09:19:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
177 |
"Modified: / 17-08-2009 / 18:28:34 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
178 |
! !
|
|
179 |
|
|
180 |
!CommitTask class methodsFor:'documentation'!
|
|
181 |
|
|
182 |
version
|
675
|
183 |
^ '$Id$'
|
198
|
184 |
!
|
|
185 |
|
|
186 |
version_SVN
|
675
|
187 |
^ '§Id: SVN__CommitTask.st 350 2011-07-07 18:42:56Z vranyj1 §'
|
49
|
188 |
! !
|