author | Merge Script |
Thu, 07 Apr 2016 07:08:20 +0200 | |
branch | jv |
changeset 1009 | e25edee0d1e7 |
parent 1004 | e48adfaf3541 |
child 1109 | 4aad118c1257 |
permissions | -rw-r--r-- |
2 | 1 |
"{ Package: 'stx:goodies/monticello' }" |
2 |
||
1003
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
4 |
|
2 | 5 |
MCAncestry subclass:#MCVersionInfo |
6 |
instanceVariableNames:'id name message date time author' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
700 | 9 |
category:'SCM-Monticello-Versioning' |
2 | 10 |
! |
11 |
||
12 |
MCVersionInfo comment:'Adds to the record of ancestry, other identifying details.' |
|
13 |
! |
|
14 |
||
15 |
||
16 |
!MCVersionInfo class methodsFor:'as yet unclassified'! |
|
17 |
||
18 |
name: vName id: id message: message date: date time: time author: author ancestors: ancestors |
|
19 |
^ self |
|
20 |
name: vName |
|
21 |
id: id |
|
22 |
message: message |
|
23 |
date: date |
|
24 |
time: time |
|
25 |
author: author |
|
26 |
ancestors: ancestors |
|
27 |
stepChildren: #() |
|
28 |
! |
|
29 |
||
30 |
name: vName id: id message: message date: date time: time author: author ancestors: ancestors stepChildren: stepChildren |
|
31 |
^ self new |
|
32 |
initializeWithName: vName |
|
33 |
id: id |
|
34 |
message: message |
|
35 |
date: date |
|
36 |
time: time |
|
37 |
author: author |
|
38 |
ancestors: ancestors |
|
39 |
stepChildren: stepChildren |
|
40 |
! ! |
|
41 |
||
42 |
!MCVersionInfo methodsFor:'accessing'! |
|
43 |
||
1003
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
44 |
inspector2TabAncestry |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
45 |
<inspector2Tab> |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
46 |
|
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
47 |
^ (self newInspector2Tab) |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
48 |
label:'Ancestry'; |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
49 |
priority:50; |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
50 |
view: [ |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
51 |
| list view | |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
52 |
|
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
53 |
list := PluggableHierarchicalList new. |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
54 |
list childBlock: [ :parent | parent ancestors ]. |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
55 |
list labelBlock: [ :child | child name ]. |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
56 |
list root: self. |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
57 |
view := ScrollableView for:HierarchicalListView. |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
58 |
view useDefaultIcons: false. |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
59 |
view list: list. |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
60 |
view |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
61 |
]; |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
62 |
yourself |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
63 |
|
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
64 |
"Created: / 07-09-2015 / 15:38:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
65 |
! |
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
66 |
|
2 | 67 |
message |
68 |
^ message ifNil: [''] |
|
69 |
! |
|
70 |
||
71 |
name |
|
72 |
^ name ifNil: ['<working copy>'] |
|
73 |
! |
|
74 |
||
75 |
summary |
|
76 |
^ String streamContents: |
|
77 |
[:s | |
|
78 |
s |
|
79 |
nextPutAll: self summaryHeader; cr; cr; |
|
80 |
nextPutAll: self message. |
|
81 |
] |
|
82 |
! |
|
83 |
||
84 |
summaryHeader |
|
466 | 85 |
^ String streamContents: |
86 |
[:s | |
|
87 |
s |
|
88 |
nextPutAll: 'Name: '; nextPutAll: self name; cr. |
|
89 |
date ifNotNil: |
|
90 |
[s |
|
91 |
nextPutAll: 'Author: '; nextPutAll: author; cr; |
|
92 |
nextPutAll: 'Time: '; nextPutAll: date asString, ', ', time asString; cr]. |
|
93 |
id ifNotNil: |
|
94 |
[s nextPutAll: 'UUID: '; nextPutAll: id printString; cr]. |
|
95 |
s |
|
96 |
nextPutAll: 'Ancestors: '; nextPutAll: self ancestorString. |
|
97 |
self stepChildren isEmpty ifFalse: |
|
98 |
[s cr; nextPutAll: 'Backported From: '; nextPutAll: self stepChildrenString]. |
|
99 |
] |
|
100 |
||
101 |
"Modified: / 05-09-2011 / 09:07:31 / cg" |
|
2 | 102 |
! |
103 |
||
104 |
timeStamp |
|
532 | 105 |
Smalltalk isSmalltalkX ifTrue:[ |
106 |
^ Timestamp fromDate: date andTime: time |
|
107 |
]. |
|
108 |
^ TimeStamp date: date time: time |
|
109 |
||
110 |
"Modified: / 02-12-2011 / 14:36:15 / cg" |
|
2 | 111 |
! |
112 |
||
113 |
timeString |
|
114 |
^ date asString, ', ', time asString |
|
115 |
! ! |
|
116 |
||
117 |
!MCVersionInfo methodsFor:'comparing'! |
|
118 |
||
119 |
= other |
|
120 |
^ other species = self species |
|
121 |
and: [other hasID: id] |
|
122 |
! |
|
123 |
||
124 |
hash |
|
125 |
^ id hash |
|
126 |
! ! |
|
127 |
||
128 |
!MCVersionInfo methodsFor:'converting'! |
|
129 |
||
130 |
asDictionary |
|
131 |
^ Dictionary new |
|
132 |
at: #name put: name; |
|
133 |
at: #id put: id; |
|
134 |
at: #message put: message; |
|
135 |
at: #date put: date; |
|
136 |
at: #time put: time; |
|
137 |
at: #author put: author; |
|
138 |
at: #ancestors put: (self ancestors collect: [:a | a asDictionary]); |
|
139 |
yourself |
|
1004
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
140 |
! |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
141 |
|
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
142 |
fromLiteralArrayEncoding: encoding |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
143 |
name := encoding at: 3. |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
144 |
id := UUID fromString: (encoding at: 5). |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
145 |
date := Date readFrom:(encoding at: 7) format: '%y-%m-%d'. |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
146 |
time := Time readFrom:(encoding at: 9) format: '%H:%m:%s.%i'. |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
147 |
author := encoding at: 11. |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
148 |
message := (encoding at: 13) asStringWithSqueakLineEndings. |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
149 |
encoding size > 13 ifTrue:[ |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
150 |
ancestors := (encoding at: 15) collect:[ :e | e decodeAsLiteralArray ]. |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
151 |
]. |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
152 |
|
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
153 |
"Created: / 07-09-2015 / 17:36:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
154 |
"Modified: / 08-09-2015 / 00:02:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
155 |
! |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
156 |
|
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
157 |
literalArrayEncoding |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
158 |
^ self literalArrayEncodingWithAncestors: true |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
159 |
|
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
160 |
"Created: / 07-09-2015 / 17:23:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
161 |
! |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
162 |
|
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
163 |
literalArrayEncodingWithAncestors: withAncestors |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
164 |
| encoding | |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
165 |
encoding := Array new: 13 + (withAncestors ifTrue:[2] ifFalse:[0]). |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
166 |
encoding |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
167 |
at: 1 put: MCVersionInfo name; |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
168 |
at: 2 put: #name:; at: 3 put: name; |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
169 |
at: 4 put: #id:; at: 5 put: id printString; |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
170 |
at: 6 put: #date:; at: 7 put: (date printStringFormat:'%y-%m-%d'); |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
171 |
at: 8 put: #time:; at: 9 put: (time printStringFormat:'%H:%m:%s.%i'); |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
172 |
at:10 put: #author:; at: 11 put: author; |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
173 |
at:12 put: #message:; at: 13 put: (message asStringWithNativeLineEndings). |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
174 |
withAncestors ifTrue:[ |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
175 |
encoding at:14 put: #ancestors:; at: 15 put: (withAncestors ifTrue:[self ancestors collect:[ :e|e literalArrayEncodingWithAncestors: withAncestors ] as: Array] ifFalse:[ #() ]). |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
176 |
]. |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
177 |
^ encoding. |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
178 |
|
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
179 |
"Created: / 07-09-2015 / 17:22:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
180 |
"Modified: / 08-09-2015 / 00:00:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
181 |
! |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
182 |
|
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
183 |
literalArrayEncodingWithoutAncestors |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
184 |
^ self literalArrayEncodingWithAncestors: false |
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
185 |
|
e48adfaf3541
Added support for ancestry splicemaps.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1003
diff
changeset
|
186 |
"Created: / 07-09-2015 / 17:47:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2 | 187 |
! ! |
188 |
||
189 |
!MCVersionInfo methodsFor:'initialize-release'! |
|
190 |
||
191 |
initializeWithName: vName id: aUUID message: aString date: aDate time: aTime author: initials ancestors: aCollection stepChildren: stepCollection |
|
192 |
name _ vName. |
|
193 |
id _ aUUID. |
|
194 |
message _ aString. |
|
195 |
date _ aDate. |
|
196 |
time _ aTime. |
|
197 |
author _ initials. |
|
198 |
ancestors _ aCollection. |
|
199 |
stepChildren _ stepCollection |
|
200 |
! ! |
|
201 |
||
202 |
!MCVersionInfo methodsFor:'pillaging'! |
|
203 |
||
204 |
author |
|
205 |
^ author |
|
206 |
! |
|
207 |
||
208 |
date |
|
209 |
^ date |
|
210 |
! |
|
211 |
||
212 |
id |
|
213 |
^ id |
|
214 |
! |
|
215 |
||
216 |
time |
|
217 |
^ time |
|
218 |
! ! |
|
219 |
||
220 |
!MCVersionInfo methodsFor:'printing'! |
|
221 |
||
222 |
printOn: aStream |
|
223 |
super printOn: aStream. |
|
224 |
aStream nextPut: $(; nextPutAll: self name; nextPut: $) |
|
225 |
||
226 |
! ! |
|
227 |
||
228 |
!MCVersionInfo methodsFor:'private'! |
|
229 |
||
230 |
hasID: aUUID |
|
231 |
^ id = aUUID |
|
232 |
! ! |
|
233 |
||
234 |
!MCVersionInfo class methodsFor:'documentation'! |
|
235 |
||
236 |
version |
|
700 | 237 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCVersionInfo.st,v 1.4 2012-09-11 21:30:28 cg Exp $' |
2 | 238 |
! ! |
1003
0ebeea1cdeeb
Added MCWorkingAncestry>>ancestors:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
700
diff
changeset
|
239 |