2
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
MCAncestry subclass:#MCVersionInfo
|
|
4 |
instanceVariableNames:'id name message date time author'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
700
|
7 |
category:'SCM-Monticello-Versioning'
|
2
|
8 |
!
|
|
9 |
|
|
10 |
MCVersionInfo comment:'Adds to the record of ancestry, other identifying details.'
|
|
11 |
!
|
|
12 |
|
|
13 |
|
|
14 |
!MCVersionInfo class methodsFor:'as yet unclassified'!
|
|
15 |
|
|
16 |
name: vName id: id message: message date: date time: time author: author ancestors: ancestors
|
|
17 |
^ self
|
|
18 |
name: vName
|
|
19 |
id: id
|
|
20 |
message: message
|
|
21 |
date: date
|
|
22 |
time: time
|
|
23 |
author: author
|
|
24 |
ancestors: ancestors
|
|
25 |
stepChildren: #()
|
|
26 |
!
|
|
27 |
|
|
28 |
name: vName id: id message: message date: date time: time author: author ancestors: ancestors stepChildren: stepChildren
|
|
29 |
^ self new
|
|
30 |
initializeWithName: vName
|
|
31 |
id: id
|
|
32 |
message: message
|
|
33 |
date: date
|
|
34 |
time: time
|
|
35 |
author: author
|
|
36 |
ancestors: ancestors
|
|
37 |
stepChildren: stepChildren
|
|
38 |
! !
|
|
39 |
|
|
40 |
!MCVersionInfo methodsFor:'accessing'!
|
|
41 |
|
|
42 |
message
|
|
43 |
^ message ifNil: ['']
|
|
44 |
!
|
|
45 |
|
|
46 |
name
|
|
47 |
^ name ifNil: ['<working copy>']
|
|
48 |
!
|
|
49 |
|
|
50 |
summary
|
|
51 |
^ String streamContents:
|
|
52 |
[:s |
|
|
53 |
s
|
|
54 |
nextPutAll: self summaryHeader; cr; cr;
|
|
55 |
nextPutAll: self message.
|
|
56 |
]
|
|
57 |
!
|
|
58 |
|
|
59 |
summaryHeader
|
466
|
60 |
^ String streamContents:
|
|
61 |
[:s |
|
|
62 |
s
|
|
63 |
nextPutAll: 'Name: '; nextPutAll: self name; cr.
|
|
64 |
date ifNotNil:
|
|
65 |
[s
|
|
66 |
nextPutAll: 'Author: '; nextPutAll: author; cr;
|
|
67 |
nextPutAll: 'Time: '; nextPutAll: date asString, ', ', time asString; cr].
|
|
68 |
id ifNotNil:
|
|
69 |
[s nextPutAll: 'UUID: '; nextPutAll: id printString; cr].
|
|
70 |
s
|
|
71 |
nextPutAll: 'Ancestors: '; nextPutAll: self ancestorString.
|
|
72 |
self stepChildren isEmpty ifFalse:
|
|
73 |
[s cr; nextPutAll: 'Backported From: '; nextPutAll: self stepChildrenString].
|
|
74 |
]
|
|
75 |
|
|
76 |
"Modified: / 05-09-2011 / 09:07:31 / cg"
|
2
|
77 |
!
|
|
78 |
|
|
79 |
timeStamp
|
532
|
80 |
Smalltalk isSmalltalkX ifTrue:[
|
|
81 |
^ Timestamp fromDate: date andTime: time
|
|
82 |
].
|
|
83 |
^ TimeStamp date: date time: time
|
|
84 |
|
|
85 |
"Modified: / 02-12-2011 / 14:36:15 / cg"
|
2
|
86 |
!
|
|
87 |
|
|
88 |
timeString
|
|
89 |
^ date asString, ', ', time asString
|
|
90 |
! !
|
|
91 |
|
|
92 |
!MCVersionInfo methodsFor:'comparing'!
|
|
93 |
|
|
94 |
= other
|
|
95 |
^ other species = self species
|
|
96 |
and: [other hasID: id]
|
|
97 |
!
|
|
98 |
|
|
99 |
hash
|
|
100 |
^ id hash
|
|
101 |
! !
|
|
102 |
|
|
103 |
!MCVersionInfo methodsFor:'converting'!
|
|
104 |
|
|
105 |
asDictionary
|
|
106 |
^ Dictionary new
|
|
107 |
at: #name put: name;
|
|
108 |
at: #id put: id;
|
|
109 |
at: #message put: message;
|
|
110 |
at: #date put: date;
|
|
111 |
at: #time put: time;
|
|
112 |
at: #author put: author;
|
|
113 |
at: #ancestors put: (self ancestors collect: [:a | a asDictionary]);
|
|
114 |
yourself
|
|
115 |
! !
|
|
116 |
|
|
117 |
!MCVersionInfo methodsFor:'initialize-release'!
|
|
118 |
|
|
119 |
initializeWithName: vName id: aUUID message: aString date: aDate time: aTime author: initials ancestors: aCollection stepChildren: stepCollection
|
|
120 |
name _ vName.
|
|
121 |
id _ aUUID.
|
|
122 |
message _ aString.
|
|
123 |
date _ aDate.
|
|
124 |
time _ aTime.
|
|
125 |
author _ initials.
|
|
126 |
ancestors _ aCollection.
|
|
127 |
stepChildren _ stepCollection
|
|
128 |
! !
|
|
129 |
|
|
130 |
!MCVersionInfo methodsFor:'pillaging'!
|
|
131 |
|
|
132 |
author
|
|
133 |
^ author
|
|
134 |
!
|
|
135 |
|
|
136 |
date
|
|
137 |
^ date
|
|
138 |
!
|
|
139 |
|
|
140 |
id
|
|
141 |
^ id
|
|
142 |
!
|
|
143 |
|
|
144 |
time
|
|
145 |
^ time
|
|
146 |
! !
|
|
147 |
|
|
148 |
!MCVersionInfo methodsFor:'printing'!
|
|
149 |
|
|
150 |
printOn: aStream
|
|
151 |
super printOn: aStream.
|
|
152 |
aStream nextPut: $(; nextPutAll: self name; nextPut: $)
|
|
153 |
|
|
154 |
! !
|
|
155 |
|
|
156 |
!MCVersionInfo methodsFor:'private'!
|
|
157 |
|
|
158 |
hasID: aUUID
|
|
159 |
^ id = aUUID
|
|
160 |
! !
|
|
161 |
|
|
162 |
!MCVersionInfo class methodsFor:'documentation'!
|
|
163 |
|
|
164 |
version
|
700
|
165 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCVersionInfo.st,v 1.4 2012-09-11 21:30:28 cg Exp $'
|
2
|
166 |
! !
|