author | fm |
Thu, 08 Oct 2009 13:55:50 +0200 | |
changeset 277 | 01d66aafa065 |
parent 261 | 75c53415380b |
child 412 | ce79b10f0c0b |
permissions | -rw-r--r-- |
77 | 1 |
"{ Package: 'cvut:stx/goodies/libsvn' }" |
2 |
||
3 |
"{ NameSpace: SVN }" |
|
4 |
||
5 |
FileoutLikeTask subclass:#UpdateTask |
|
261 | 6 |
instanceVariableNames:'revision notifications updates conflicts resolution loadChangeSet |
7 |
mergeDiffSet updateChangeSet' |
|
77 | 8 |
classVariableNames:'' |
9 |
poolDictionaries:'' |
|
10 |
category:'SVN-Tasks' |
|
11 |
! |
|
12 |
||
13 |
||
14 |
!UpdateTask methodsFor:'accessing'! |
|
15 |
||
16 |
revision |
|
17 |
^ revision |
|
18 |
||
19 |
"Modified: / 09-04-2009 / 09:39:42 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
20 |
! |
|
21 |
||
22 |
revision:aRevision |
|
23 |
revision := aRevision. |
|
24 |
loadChangeSet := mergeDiffSet := updateChangeSet := nil. |
|
25 |
||
26 |
"Modified: / 23-03-2009 / 18:40:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
27 |
! ! |
|
28 |
||
29 |
!UpdateTask methodsFor:'executing'! |
|
30 |
||
31 |
do |
|
32 |
" |
|
33 |
Perform whole task" |
|
34 |
||
35 |
self assert: revision notNil message: 'No revision specified'. |
|
36 |
self doUpdateWorkingCopy doApplyMergedChangeSet |
|
37 |
||
38 |
"Modified: / 09-04-2009 / 09:40:28 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
39 |
! |
|
40 |
||
41 |
doApplyResolutions |
|
42 |
self do: |
|
43 |
[resolution isNilOrEmptyCollection ifFalse: |
|
44 |
[(Class updateChangeFileQuerySignal , Class updateChangeListQuerySignal) |
|
45 |
answer: false |
|
46 |
do: |
|
47 |
[resolution withIndexDo: |
|
48 |
[:change :index | |
|
49 |
change apply. |
|
50 |
SVN::ProgressNotification |
|
51 |
notify: 'Applying changes' |
|
52 |
progress: (100 / resolution size) * index ] ] ]. |
|
53 |
self doCompileSvnRevisionNrMethod: true] |
|
54 |
||
55 |
"Created: / 23-03-2009 / 18:36:32 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
56 |
"Modified: / 17-08-2009 / 19:39:17 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
57 |
! |
|
58 |
||
59 |
doUpdateWorkingCopy |
|
60 |
self do: |
|
61 |
[ self workingCopy ensureIsValid. |
|
62 |
self |
|
63 |
doRevert; |
|
64 |
doFileOutAll; |
|
65 |
doUpdate; |
|
66 |
doLoadChanges ] |
|
67 |
||
68 |
"Created: / 23-03-2009 / 18:35:06 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
69 |
"Modified: / 17-08-2009 / 19:01:45 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
70 |
! ! |
|
71 |
||
72 |
!UpdateTask methodsFor:'executing - private'! |
|
73 |
||
74 |
doLoadChanges |
|
75 |
updates := ChangeSet new. |
|
76 |
conflicts := ChangeSet::DiffSet new. |
|
77 |
notifications do: [:each | self doLoadChangesFor: each ]. |
|
78 |
||
79 |
"Modified: / 18-08-2009 / 08:59:11 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
80 |
! |
|
81 |
||
82 |
doLoadChangesFor: aWCActionNotify |
|
83 |
||
84 |
"We should process only notifications for source |
|
85 |
and/or conflicted entries" |
|
86 |
||
87 |
(aWCActionNotify action isConflict or: |
|
88 |
[aWCActionNotify entry isSourceFileEntry]) |
|
89 |
ifTrue:[aWCActionNotify processUsing: self] |
|
90 |
||
91 |
"Created: / 18-08-2009 / 08:59:10 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
92 |
"Modified: / 27-08-2009 / 08:57:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
93 |
! |
|
94 |
||
95 |
doRevert |
|
96 |
SVN::ActivityNotification notify: 'Reverting local changes'. |
|
97 |
(RevertCommand new) |
|
98 |
workingCopy: self workingCopy path; |
|
99 |
paths: (ProgrammingLanguage |
|
100 |
allCollect: [:lang | '*.' , lang sourceFileSuffix ]); |
|
101 |
execute. |
|
102 |
! |
|
103 |
||
104 |
doUpdate |
|
105 |
SVN::ActivityNotification |
|
106 |
notify: 'Updating working copy to revision ' , self revision printString. |
|
107 |
notifications := (UpdateCommand new) |
|
108 |
workingCopy: self workingCopy; |
|
109 |
revision: self revision; |
|
110 |
execute |
|
111 |
||
112 |
"Modified: / 19-08-2009 / 12:22:49 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
113 |
! ! |
|
114 |
||
115 |
!UpdateTask methodsFor:'private'! |
|
116 |
||
117 |
filterChangeSet: aChangeSet |
|
118 |
" |
|
119 |
Removes changes for methods that are not interesting |
|
120 |
(such as version methods & autogenerated package description |
|
121 |
methods)" |
|
122 |
||
123 |
| changesToRemove | |
|
124 |
||
125 |
changesToRemove := aChangeSet |
|
126 |
select: [:change | change isForGeneratedSubject ]. |
|
127 |
aChangeSet removeAll: changesToRemove. |
|
128 |
^ aChangeSet |
|
129 |
||
130 |
"Created: / 08-04-2009 / 09:53:49 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
131 |
! ! |
|
132 |
||
133 |
!UpdateTask methodsFor:'processing - private'! |
|
134 |
||
135 |
processAddedEntry: entry |
|
136 |
||
137 |
entry sourceLanguage isSmalltalk |
|
138 |
ifTrue: |
|
139 |
[updates addAll: |
|
140 |
(ChangeSet fromStream: entry readStream) ] |
|
141 |
ifFalse: |
|
142 |
[self error:'Non smalltalk source not yet supported'] |
|
143 |
||
144 |
"Created: / 27-08-2009 / 08:54:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
145 |
"Modified: / 27-08-2009 / 10:37:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
146 |
! |
|
147 |
||
148 |
processDeletedEntry: entry |
|
149 |
||
150 |
entry sourceLanguage isSmalltalk ifTrue: |
|
151 |
[entry path = 'extensions.st' ifTrue:[self halt"not yet finished"]. |
|
152 |
self halt.] |
|
153 |
||
154 |
"Created: / 27-08-2009 / 09:56:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
155 |
! ! |
|
156 |
||
157 |
!UpdateTask class methodsFor:'documentation'! |
|
158 |
||
159 |
version |
|
160 |
^ '$Header$' |
|
207 | 161 |
! |
162 |
||
163 |
version_CVS |
|
164 |
^ '$Header$' |
|
165 |
! |
|
166 |
||
167 |
version_SVN |
|
277
01d66aafa065
update #version_SVN with § as keyword expansion character
fm
parents:
261
diff
changeset
|
168 |
^'§Id: SVN__UpdateTask.st 113 2009-08-28 11:43:01Z vranyj1 §' |
77 | 169 |
! ! |