118
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCVersionNotification
|
|
4 |
instanceVariableNames:'version ancestor repository changes'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
705
|
7 |
category:'SCM-Monticello-Repositories'
|
118
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCVersionNotification class methodsFor:'as yet unclassified'!
|
|
12 |
|
|
13 |
version: aVersion repository: aRepository
|
|
14 |
^ self basicNew initializeWithVersion: aVersion repository: aRepository
|
|
15 |
! !
|
|
16 |
|
|
17 |
!MCVersionNotification methodsFor:'as yet unclassified'!
|
|
18 |
|
|
19 |
fromAddress
|
|
20 |
^ 'monticello@beta4.com'
|
|
21 |
!
|
|
22 |
|
|
23 |
initializeWithVersion: aVersion repository: aRepository
|
194
|
24 |
version := aVersion.
|
|
25 |
repository := aRepository.
|
|
26 |
ancestor := repository closestAncestorVersionFor: version info ifNone: [].
|
|
27 |
changes := ancestor
|
118
|
28 |
ifNil: [#()]
|
|
29 |
ifNotNil: [(version snapshot patchRelativeToBase: ancestor snapshot) operations asSortedCollection]
|
|
30 |
!
|
|
31 |
|
|
32 |
messageText
|
|
33 |
^ String streamContents:
|
|
34 |
[:s |
|
|
35 |
s nextPutAll: 'Committed to repository: ', repository description; cr; cr.
|
|
36 |
s nextPutAll: version summary.
|
|
37 |
changes isEmpty ifFalse:
|
|
38 |
[s cr; cr.
|
|
39 |
s nextPutAll: '-----------------------------------------------------'; cr.
|
|
40 |
s nextPutAll: 'Changes since ', ancestor info name, ':'; cr.
|
|
41 |
changes do:
|
|
42 |
[:ea |
|
|
43 |
s cr; nextPutAll: ea summary; cr.
|
|
44 |
s nextPutAll: ea sourceString]]]
|
|
45 |
!
|
|
46 |
|
|
47 |
messageTo: aString
|
|
48 |
| message |
|
194
|
49 |
message := MailMessage empty.
|
118
|
50 |
message setField: 'from' toString: self fromAddress.
|
|
51 |
message setField: 'to' toString: aString.
|
|
52 |
message setField: 'subject' toString: '[MC] ', version info name.
|
|
53 |
message body: (MIMEDocument contentType: 'text/plain' content: self messageText).
|
|
54 |
^ message
|
|
55 |
!
|
|
56 |
|
|
57 |
notify: aString
|
|
58 |
| message |
|
194
|
59 |
message := self messageTo: aString.
|
118
|
60 |
SMTPClient
|
|
61 |
deliverMailFrom: message from
|
|
62 |
to: (Array with: message to)
|
|
63 |
text: message text
|
|
64 |
usingServer: MailSender smtpServer
|
|
65 |
! !
|
|
66 |
|
|
67 |
!MCVersionNotification class methodsFor:'documentation'!
|
|
68 |
|
280
|
69 |
version
|
705
|
70 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCVersionNotification.st,v 1.4 2012-09-11 21:30:56 cg Exp $'
|
280
|
71 |
!
|
|
72 |
|
194
|
73 |
version_CVS
|
705
|
74 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCVersionNotification.st,v 1.4 2012-09-11 21:30:56 cg Exp $'
|
194
|
75 |
!
|
|
76 |
|
|
77 |
version_SVN
|
|
78 |
^ '§Id: MCVersionNotification.st 5 2010-08-29 07:30:29Z vranyj1 §'
|
118
|
79 |
! !
|