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