[squeak-dev] The Trunk: Monticello-nice.694.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Feb 13 16:10:48 UTC 2019

Nicolas Cellier uploaded a new version of Monticello to project The Trunk:

==================== Summary ====================

Name: Monticello-nice.694
Author: nice
Time: 13 February 2019, 5:10:42.293481 pm
UUID: 32251c33-6f20-4c4f-8e6b-b0bb32019731
Ancestors: Monticello-tpr.693

Warn about false ancestors thru bold-red-UI

A false ancestor is a package that has same name-author.versionNumber than a true ancestor, but not the same id (UUID).
Generally, its contents will be different from the true ancestor.
It is vital to know this information, particularly when browsing an inbox, otherwise we could override a true ancestor when moving/copying this package to repository that already contains the true one.

Right now, the warning is only for selected version in the versionList.
It's because the list is built from version names only and ignore ids.
Most actions will operate on selected version though, so it's better than nothing.

=============== Diff against Monticello-tpr.693 ===============

Item was changed:
  MCVersionInspector subclass: #MCRepositoryInspector
+ 	instanceVariableNames: 'repository packageNames versionNames selectedPackage selectedVersion order versionInfo loaded newer inherited inheritedId'
- 	instanceVariableNames: 'repository packageNames versionNames selectedPackage selectedVersion order versionInfo loaded newer inherited'
  	classVariableNames: 'BrowseBranchedVersionsSeparately Order'
  	poolDictionaries: ''
  	category: 'Monticello-UI'!

Item was changed:
  ----- Method: MCRepositoryInspector>>identifyLoadedAndInherited: (in category 'morphic ui') -----
  identifyLoadedAndInherited: aMCWorkingCopy 
  	| seen |
  	seen := Set new.
  	aMCWorkingCopy ancestors do:
  		[ : ancestor | loaded add: ancestor versionName.
  		seen add: ancestor.
  		ancestor ancestorsDoWhileTrue:
  			[ : heir | (seen includes: heir)
  				ifTrue: [ false ]
  					[ inherited add: heir versionName.
+ 					inheritedId add: heir id.
  					seen add: heir.
  					true ] ] ]!

Item was changed:
  ----- Method: MCRepositoryInspector>>initializeEmphasis (in category 'initialize-release') -----
  	inherited := Set new.
+ 	inheritedId := Set new.
  	loaded := Set new!

Item was added:
+ ----- Method: MCRepositoryInspector>>selectedVersionIsFalseAncestor (in category 'testing') -----
+ selectedVersionIsFalseAncestor
+ 	"Answer true if selectedVersion is a false ancestor of working copy.
+ 	An ancestor of working copy that has same name, but not same id is a false ancestor!!"
+ 	^(selectedVersion notNil
+ 			and: [(inherited includes: selectedVersion versionName)
+ 					and: [(inheritedId includes: self versionInfo id) not]])!

Item was added:
+ ----- Method: MCRepositoryInspector>>summary (in category 'morphic ui') -----
+ summary
+ 	self selectedVersionIsFalseAncestor
+ 		ifTrue: [^ (Text string: 'Beware, this is a false ancestor whose name conflicts with a true one\' withCRs attributes: {TextColor red. TextEmphasis bold})
+ 				, super summary].
+ 	^ super summary!

Item was changed:
  ----- Method: MCRepositoryInspector>>versionHighlight: (in category 'morphic ui') -----
+ versionHighlight: aMCVersionName 
- versionHighlight: aMCVersionName
  	inherited ifNil: [inherited := #()].
+ 	inheritedId ifNil: [inheritedId := #()].
+ 	(selectedVersion notNil
+ 			and: [selectedVersion = aMCVersionName
+ 					and: [self selectedVersionIsFalseAncestor]])
+ 		ifTrue: ["False ancestor might be dangerous, signal them in red"
+ 			^ Text string: aMCVersionName attributes: {TextColor red. TextEmphasis bold}].
+ 	^ Text
- 	^Text
  		string: aMCVersionName
+ 		attribute: (TextEmphasis new
+ 				emphasisCode: ((loaded includes: aMCVersionName)
+ 						ifTrue: ["underlined" 4]
+ 						ifFalse: [(inherited includes: aMCVersionName)
+ 								ifTrue: [0]
+ 								ifFalse: ["bold" 1]]))!
- 		attribute: (TextEmphasis new emphasisCode: (
- 			((loaded includes: aMCVersionName) ifTrue: [ 4 "underlined" ]
- 				ifFalse: [ (inherited includes: aMCVersionName)
- 					ifTrue: [ 0 ]
- 					ifFalse: [ 1 "bold" ] ])))!

Item was changed:
  ----- Method: MCRepositoryInspector>>versionSelection: (in category 'morphic ui') -----
  versionSelection: aNumber 
  	selectedVersion := version := nil.
  	aNumber isZero ifFalse: [ selectedVersion := (self versionList at: aNumber) asString ].
+ 	self selectedVersionIsFalseAncestor ifTrue: [self changed: #versionList].
  		 changed: #versionSelection ;
  		 changed: #summary ;
  		 changed: #hasVersion!

More information about the Squeak-dev mailing list