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