author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 30 Nov 2012 21:42:46 +0000 | |
changeset 115 | b1ed2d29054b |
parent 88 | 1ad71a063a20 |
child 210 | 54a73fa50d40 |
permissions | -rw-r--r-- |
36 | 1 |
"{ Package: 'stx:libscm/mercurial' }" |
2 |
||
3 |
Singleton subclass:#HGStatus |
|
4 |
instanceVariableNames:'' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
7 |
category:'SCM-Mercurial-Core' |
|
8 |
! |
|
9 |
||
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
10 |
HGStatus subclass:#Added |
36 | 11 |
instanceVariableNames:'' |
12 |
classVariableNames:'' |
|
13 |
poolDictionaries:'' |
|
14 |
privateIn:HGStatus |
|
15 |
! |
|
16 |
||
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
17 |
HGStatus subclass:#Clean |
36 | 18 |
instanceVariableNames:'' |
19 |
classVariableNames:'' |
|
20 |
poolDictionaries:'' |
|
21 |
privateIn:HGStatus |
|
22 |
! |
|
23 |
||
88 | 24 |
HGStatus subclass:#Copied |
25 |
instanceVariableNames:'source' |
|
26 |
classVariableNames:'' |
|
27 |
poolDictionaries:'' |
|
28 |
privateIn:HGStatus |
|
29 |
! |
|
30 |
||
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
31 |
HGStatus subclass:#Ignored |
36 | 32 |
instanceVariableNames:'' |
33 |
classVariableNames:'' |
|
34 |
poolDictionaries:'' |
|
35 |
privateIn:HGStatus |
|
36 |
! |
|
37 |
||
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
38 |
HGStatus subclass:#Missing |
36 | 39 |
instanceVariableNames:'' |
40 |
classVariableNames:'' |
|
41 |
poolDictionaries:'' |
|
42 |
privateIn:HGStatus |
|
43 |
! |
|
44 |
||
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
45 |
HGStatus subclass:#Modified |
36 | 46 |
instanceVariableNames:'' |
47 |
classVariableNames:'' |
|
48 |
poolDictionaries:'' |
|
49 |
privateIn:HGStatus |
|
50 |
! |
|
51 |
||
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
52 |
HGStatus subclass:#NotTracked |
36 | 53 |
instanceVariableNames:'' |
54 |
classVariableNames:'' |
|
55 |
poolDictionaries:'' |
|
56 |
privateIn:HGStatus |
|
57 |
! |
|
58 |
||
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
59 |
HGStatus subclass:#Removed |
36 | 60 |
instanceVariableNames:'' |
61 |
classVariableNames:'' |
|
62 |
poolDictionaries:'' |
|
63 |
privateIn:HGStatus |
|
64 |
! |
|
65 |
||
66 |
||
67 |
!HGStatus class methodsFor:'instance creation'! |
|
68 |
||
69 |
forCode: aCharacter |
|
70 |
self allSubclasses do:[:cls| |
|
71 |
cls code == aCharacter ifTrue:[ ^ cls theOnlyInstance ] |
|
72 |
]. |
|
73 |
self error:'Invalid status code: ', aCharacter |
|
74 |
||
75 |
"Created: / 23-10-2012 / 10:56:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
76 |
! |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
77 |
|
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
78 |
theOnlyInstance |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
79 |
theOnlyInstance isNil ifTrue:[ |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
80 |
Lock critical:[ |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
81 |
theOnlyInstance isNil ifTrue:[ |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
82 |
theOnlyInstance := self new |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
83 |
]. |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
84 |
] |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
85 |
]. |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
86 |
^ theOnlyInstance. |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
87 |
|
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
37
diff
changeset
|
88 |
"Created: / 09-11-2012 / 12:04:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
36 | 89 |
! ! |
90 |
||
91 |
!HGStatus class methodsFor:'accessing'! |
|
92 |
||
93 |
code |
|
94 |
"Return one-char code as used by 'hg status' command, |
|
95 |
i.e., $A for added, $!! for missing, ..." |
|
96 |
||
97 |
^self subclassResponsibility |
|
98 |
||
99 |
"Created: / 22-10-2012 / 21:27:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
88 | 100 |
"Modified: / 21-11-2012 / 01:10:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
36 | 101 |
! ! |
102 |
||
103 |
!HGStatus class methodsFor:'accessing-statuses'! |
|
104 |
||
105 |
added |
|
106 |
^ Added theOnlyInstance |
|
107 |
||
108 |
"Created: / 23-10-2012 / 09:56:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
109 |
! |
|
110 |
||
111 |
clean |
|
112 |
^ Clean theOnlyInstance |
|
113 |
||
114 |
"Created: / 23-10-2012 / 09:56:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
115 |
! |
|
116 |
||
88 | 117 |
copied |
118 |
^ Copied new |
|
119 |
||
120 |
"Created: / 21-11-2012 / 01:04:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
121 |
! |
|
122 |
||
36 | 123 |
ignored |
124 |
^ Ignored theOnlyInstance |
|
125 |
||
126 |
"Created: / 23-10-2012 / 09:57:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
127 |
! |
|
128 |
||
129 |
missing |
|
130 |
^ Missing theOnlyInstance |
|
131 |
||
132 |
"Created: / 23-10-2012 / 09:56:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
133 |
! |
|
134 |
||
135 |
notTracked |
|
136 |
^ NotTracked theOnlyInstance |
|
137 |
||
138 |
"Created: / 23-10-2012 / 09:57:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
139 |
! |
|
140 |
||
141 |
removed |
|
142 |
^ Removed theOnlyInstance |
|
143 |
||
144 |
"Created: / 23-10-2012 / 09:56:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
145 |
! ! |
|
146 |
||
147 |
!HGStatus methodsFor:'accessing'! |
|
148 |
||
149 |
code |
|
150 |
^ self class code |
|
151 |
! |
|
152 |
||
153 |
name |
|
154 |
"Return a human-readable name of the status code, |
|
155 |
i.e., 'modified', 'ignored', ..." |
|
156 |
||
157 |
^self class nameWithoutPrefix asLowercase |
|
158 |
||
159 |
"Created: / 22-10-2012 / 21:26:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
160 |
"Modified: / 23-10-2012 / 09:58:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
161 |
! ! |
|
162 |
||
163 |
!HGStatus methodsFor:'testing'! |
|
164 |
||
165 |
isAdded |
|
166 |
^ false |
|
167 |
! |
|
168 |
||
169 |
isClean |
|
170 |
^ false |
|
171 |
! |
|
172 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
173 |
isCleanOrIgnored |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
174 |
^ false |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
175 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
176 |
"Created: / 15-11-2012 / 01:29:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
177 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
178 |
|
88 | 179 |
isCopied |
180 |
^ false |
|
181 |
||
182 |
"Created: / 21-11-2012 / 01:07:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
183 |
! |
|
184 |
||
36 | 185 |
isIgnored |
186 |
^ false |
|
187 |
! |
|
188 |
||
189 |
isMissing |
|
190 |
^ false |
|
191 |
! |
|
192 |
||
193 |
isModified |
|
194 |
^ false |
|
195 |
! |
|
196 |
||
197 |
isNotTracked |
|
198 |
^ false |
|
199 |
! |
|
200 |
||
201 |
isRemoved |
|
202 |
^ false |
|
88 | 203 |
! |
204 |
||
205 |
isUntracked |
|
206 |
^ self isNotTracked |
|
207 |
||
208 |
"Created: / 21-11-2012 / 00:57:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
36 | 209 |
! ! |
210 |
||
211 |
!HGStatus::Added class methodsFor:'accessing'! |
|
212 |
||
213 |
code |
|
214 |
"Return one-char code as used by 'hg status' command, |
|
215 |
i.e., $A for added, $!! for missing, ..." |
|
216 |
||
217 |
^ $A |
|
218 |
||
219 |
"Modified: / 23-10-2012 / 09:57:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
220 |
! ! |
|
221 |
||
222 |
!HGStatus::Added methodsFor:'testing'! |
|
223 |
||
224 |
isAdded |
|
225 |
^ true |
|
226 |
! ! |
|
227 |
||
228 |
!HGStatus::Clean class methodsFor:'accessing'! |
|
229 |
||
230 |
code |
|
231 |
"Return one-char code as used by 'hg status' command, |
|
232 |
i.e., $A for added, $!! for missing, ..." |
|
233 |
||
234 |
^ $C |
|
235 |
||
236 |
"Modified: / 23-10-2012 / 09:57:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
237 |
! ! |
|
238 |
||
239 |
!HGStatus::Clean methodsFor:'testing'! |
|
240 |
||
241 |
isClean |
|
242 |
^ true |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
243 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
244 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
245 |
isCleanOrIgnored |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
246 |
^ true |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
247 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
248 |
"Created: / 15-11-2012 / 01:29:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
36 | 249 |
! ! |
250 |
||
88 | 251 |
!HGStatus::Copied class methodsFor:'accessing'! |
252 |
||
253 |
code |
|
254 |
^Character space |
|
255 |
||
256 |
"Created: / 21-11-2012 / 01:10:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
257 |
! ! |
|
258 |
||
259 |
!HGStatus::Copied methodsFor:'accessing'! |
|
260 |
||
261 |
code |
|
262 |
"Return one-char code as used by 'hg status' command, |
|
263 |
i.e., $A for added, $!! for missing, ..." |
|
264 |
||
265 |
^Character space |
|
266 |
||
267 |
"Created: / 22-10-2012 / 21:27:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
268 |
"Modified: / 21-11-2012 / 01:10:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
269 |
! |
|
270 |
||
271 |
source |
|
272 |
^ source |
|
273 |
! |
|
274 |
||
275 |
source:something |
|
276 |
source := something. |
|
277 |
! ! |
|
278 |
||
279 |
!HGStatus::Copied methodsFor:'testing'! |
|
280 |
||
281 |
isCopied |
|
282 |
^ true |
|
283 |
||
284 |
"Created: / 21-11-2012 / 01:07:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
285 |
! ! |
|
286 |
||
36 | 287 |
!HGStatus::Ignored class methodsFor:'accessing'! |
288 |
||
289 |
code |
|
290 |
"Return one-char code as used by 'hg status' command, |
|
291 |
i.e., $A for added, $!! for missing, ..." |
|
292 |
||
293 |
^ $I |
|
294 |
||
295 |
"Modified: / 23-10-2012 / 09:57:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
296 |
! ! |
|
297 |
||
298 |
!HGStatus::Ignored methodsFor:'testing'! |
|
299 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
300 |
isCleanOrIgnored |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
301 |
^ true |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
302 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
303 |
"Created: / 15-11-2012 / 01:30:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
304 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
305 |
|
36 | 306 |
isIgnored |
307 |
^ true |
|
308 |
! ! |
|
309 |
||
310 |
!HGStatus::Missing class methodsFor:'accessing'! |
|
311 |
||
312 |
code |
|
313 |
"Return one-char code as used by 'hg status' command, |
|
314 |
i.e., $A for added, $!! for missing, ..." |
|
315 |
||
316 |
^ $!! |
|
317 |
||
318 |
"Modified: / 23-10-2012 / 09:57:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
319 |
! ! |
|
320 |
||
321 |
!HGStatus::Missing methodsFor:'testing'! |
|
322 |
||
323 |
isMissing |
|
324 |
^ true |
|
325 |
! ! |
|
326 |
||
327 |
!HGStatus::Modified class methodsFor:'accessing'! |
|
328 |
||
329 |
code |
|
330 |
"Return one-char code as used by 'hg status' command, |
|
331 |
i.e., $A for added, $!! for missing, ..." |
|
332 |
||
333 |
^ $M |
|
334 |
||
335 |
"Modified: / 23-10-2012 / 09:57:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
336 |
! ! |
|
337 |
||
338 |
!HGStatus::Modified methodsFor:'testing'! |
|
339 |
||
340 |
isModified |
|
341 |
^ true |
|
342 |
! ! |
|
343 |
||
344 |
!HGStatus::NotTracked class methodsFor:'accessing'! |
|
345 |
||
346 |
code |
|
347 |
"Return one-char code as used by 'hg status' command, |
|
348 |
i.e., $A for added, $!! for missing, ..." |
|
349 |
||
350 |
^ $? |
|
351 |
||
352 |
"Modified: / 23-10-2012 / 09:58:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
353 |
! ! |
|
354 |
||
355 |
!HGStatus::NotTracked methodsFor:'testing'! |
|
356 |
||
357 |
isNotTracked |
|
358 |
^ true |
|
359 |
! ! |
|
360 |
||
361 |
!HGStatus::Removed class methodsFor:'accessing'! |
|
362 |
||
363 |
code |
|
364 |
"Return one-char code as used by 'hg status' command, |
|
365 |
i.e., $A for added, $!! for missing, ..." |
|
366 |
||
367 |
^ $R |
|
368 |
||
369 |
"Modified: / 23-10-2012 / 11:24:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
370 |
! ! |
|
371 |
||
372 |
!HGStatus::Removed methodsFor:'testing'! |
|
373 |
||
374 |
isRemoved |
|
375 |
^ true |
|
376 |
! ! |
|
377 |
||
378 |
!HGStatus class methodsFor:'documentation'! |
|
379 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
380 |
version_HG |
115
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
381 |
|
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
382 |
^ '$Changeset: <not expanded> $' |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
383 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
384 |
|
36 | 385 |
version_SVN |
88 | 386 |
^ '§Id:: §' |
36 | 387 |
! ! |