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