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