132
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
MCTool subclass:#MCVersionInspector
|
|
4 |
instanceVariableNames:'version'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
702
|
7 |
category:'SCM-Monticello-UI'
|
132
|
8 |
!
|
|
9 |
|
788
|
10 |
!MCVersionInspector class methodsFor:'documentation'!
|
|
11 |
|
|
12 |
documentation
|
|
13 |
"
|
|
14 |
I am a tool that visually represents an MCVersion.
|
|
15 |
|
|
16 |
While I can be opened on anMCVersion, you've probably seen me most often
|
|
17 |
after saving a package in the Monticello Browser.
|
|
18 |
|
|
19 |
I have buttons to perform common version-related actions - like browsing,
|
|
20 |
loading, and viewing changes. In my main text area, I display the following
|
|
21 |
information about my version - name, author, timestamp, UUID, ancestors and
|
|
22 |
log message.
|
|
23 |
"
|
|
24 |
! !
|
132
|
25 |
|
|
26 |
!MCVersionInspector methodsFor:'as yet unclassified'!
|
|
27 |
|
|
28 |
adopt
|
|
29 |
(self confirm:
|
|
30 |
'Modifying ancestry can be dangerous unless you know
|
|
31 |
what you are doing. Are you sure you want to adopt
|
|
32 |
',self version info name, ' as an ancestor of your working copy?')
|
|
33 |
ifTrue: [self version adopt]
|
|
34 |
!
|
|
35 |
|
|
36 |
browse
|
|
37 |
self version browse
|
|
38 |
!
|
|
39 |
|
|
40 |
changes
|
|
41 |
(MCPatchBrowser forPatch: self version changes)
|
|
42 |
showLabelled: 'Changes from ', self version info name
|
|
43 |
!
|
|
44 |
|
|
45 |
diff
|
|
46 |
| ancestorVersion |
|
|
47 |
self pickAncestor ifNotNilDo:
|
|
48 |
[:ancestor |
|
|
49 |
ancestorVersion _ self version workingCopy repositoryGroup versionWithInfo: ancestor.
|
|
50 |
(self version asDiffAgainst: ancestorVersion) open]
|
|
51 |
!
|
|
52 |
|
|
53 |
hasVersion
|
|
54 |
^version notNil
|
|
55 |
!
|
|
56 |
|
|
57 |
history
|
|
58 |
(MCVersionHistoryBrowser new ancestry: self versionInfo) show
|
|
59 |
!
|
|
60 |
|
|
61 |
load
|
|
62 |
Cursor wait showWhile: [self version load]
|
|
63 |
!
|
|
64 |
|
|
65 |
merge
|
|
66 |
self version merge
|
|
67 |
!
|
|
68 |
|
|
69 |
save
|
|
70 |
self pickRepository ifNotNilDo:
|
|
71 |
[:ea |
|
|
72 |
ea storeVersion: self version]
|
|
73 |
!
|
|
74 |
|
|
75 |
summary
|
|
76 |
^self hasVersion
|
|
77 |
ifTrue: [ self versionSummary ]
|
|
78 |
ifFalse: [ String new ]
|
|
79 |
!
|
|
80 |
|
|
81 |
version
|
|
82 |
^ version
|
|
83 |
!
|
|
84 |
|
|
85 |
version: aVersion
|
|
86 |
version _ aVersion
|
|
87 |
!
|
|
88 |
|
|
89 |
versionInfo
|
|
90 |
^ self version info
|
|
91 |
!
|
|
92 |
|
|
93 |
versionSummary
|
|
94 |
^ self version summary
|
|
95 |
! !
|
|
96 |
|
|
97 |
!MCVersionInspector methodsFor:'morphic ui'!
|
|
98 |
|
|
99 |
buttonSpecs
|
|
100 |
^ #((Browse browse 'Browse this version' hasVersion)
|
|
101 |
(History history 'Browse the history of this version' hasVersion)
|
|
102 |
(Changes changes 'Browse the changes this version would make to the
|
|
103 |
image' hasVersion)
|
|
104 |
(Load load 'Load this version into the image' hasVersion)
|
|
105 |
(Merge merge 'Merge this version into the image' hasVersion)
|
|
106 |
(Adopt adopt 'Adopt this version as an ancestor of your working copy'
|
|
107 |
hasVersion)
|
|
108 |
(Copy save 'Copy this version to another repository' hasVersion)
|
|
109 |
(Diff diff 'Create an equivalent version based on an earlier release'
|
|
110 |
hasVersion))
|
|
111 |
!
|
|
112 |
|
|
113 |
defaultExtent
|
|
114 |
^ 400@200
|
|
115 |
!
|
|
116 |
|
|
117 |
defaultLabel
|
|
118 |
^ 'Version: ', self version info name
|
|
119 |
!
|
|
120 |
|
|
121 |
pickAncestor
|
|
122 |
| index versions |
|
|
123 |
versions _ self version info breadthFirstAncestors.
|
|
124 |
index _ (PopUpMenu labelArray: (versions collect: [:ea | ea name]))
|
|
125 |
startUpWithCaption: 'Ancestor:'.
|
|
126 |
^ index = 0 ifFalse: [versions at: index]
|
|
127 |
!
|
|
128 |
|
|
129 |
pickRepository
|
|
130 |
| index |
|
|
131 |
index _ (PopUpMenu labelArray: (self repositories collect: [:ea | ea description]))
|
|
132 |
startUpWithCaption: 'Repository:'.
|
|
133 |
^ index = 0 ifFalse: [self repositories at: index]
|
|
134 |
!
|
|
135 |
|
|
136 |
repositories
|
|
137 |
^ MCRepositoryGroup default repositories
|
|
138 |
!
|
|
139 |
|
|
140 |
widgetSpecs
|
|
141 |
^ #(
|
|
142 |
((buttonRow) (0 0 1 0) (0 0 0 30))
|
|
143 |
((textMorph: summary) (0 0 1 1) (0 30 0 0))
|
|
144 |
)
|
|
145 |
! !
|
|
146 |
|
|
147 |
!MCVersionInspector class methodsFor:'documentation'!
|
|
148 |
|
|
149 |
version
|
788
|
150 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCVersionInspector.st,v 1.3 2013-05-15 10:49:35 cg Exp $'
|
132
|
151 |
! !
|
788
|
152 |
|