Marcel Taeumel uploaded a new version of Monticello to project The Trunk: http://source.squeak.org/trunk/Monticello-mt.798.mcz
==================== Summary ====================
Name: Monticello-mt.798 Author: mt Time: 4 October 2023, 4:39:21.695674 pm UUID: 2e5abee7-4f0b-574b-b73b-35dbf29826eb Ancestors: Monticello-mt.797
Adds support for protocol-renaming as proactive "modified" indication for working copies. While this may be a false-positive for empty message categories, one usually renames non-empty ones and thus needs to commit something.
(BTW: There are some recategorizations in MCConflict that were forgotten exactly due to not informing working copies about protocol-renaming. There might be more.)
=============== Diff against Monticello-mt.797 ===============
Item was changed: + ----- Method: MCConflict>>chooseLocal (in category 'resolving') ----- - ----- Method: MCConflict>>chooseLocal (in category 'resolving ') ----- chooseLocal chooseRemote := false!
Item was changed: + ----- Method: MCConflict>>chooseNewer (in category 'resolving') ----- - ----- Method: MCConflict>>chooseNewer (in category 'resolving ') ----- chooseNewer self isLocalNewer ifTrue: [ self chooseLocal ] ifFalse: [ self isRemoteNewer ifTrue: [ self chooseRemote ]]!
Item was changed: + ----- Method: MCConflict>>chooseOlder (in category 'resolving') ----- - ----- Method: MCConflict>>chooseOlder (in category 'resolving ') ----- chooseOlder self isRemoteNewer ifTrue: [ self chooseLocal ] ifFalse: [ self isLocalNewer ifTrue: [ self chooseRemote ]]!
Item was changed: + ----- Method: MCConflict>>chooseRemote (in category 'resolving') ----- - ----- Method: MCConflict>>chooseRemote (in category 'resolving ') ----- chooseRemote chooseRemote := true!
Item was changed: + ----- Method: MCConflict>>chooseSameAST (in category 'resolving') ----- - ----- Method: MCConflict>>chooseSameAST (in category 'resolving ') ----- chooseSameAST | fromSrc toSrc | (self definition isNil or: [self definition isMethodDefinition not]) ifTrue: [^ self]. fromSrc := (Parser new parse: operation fromSource class: nil class) generate decompile asString. toSrc := (Parser new parse: operation toSource class: nil class) generate decompile asString. fromSrc = toSrc ifTrue: [self chooseLocal].!
Item was changed: + ----- Method: MCConflict>>clearChoice (in category 'resolving') ----- - ----- Method: MCConflict>>clearChoice (in category 'resolving ') ----- clearChoice chooseRemote := nil!
Item was changed: ----- Method: MCPackageManager class>>classMoved: (in category 'system changes') ----- classMoved: anEvent + "Inform managers about old class category. Pass on to #classModified to inform managers about new/current class category." + + self + managersForCategory: anEvent oldCategory + do: [:mgr| mgr modified: true]. + + self classModified: anEvent.! - self classModified: anEvent. - self managersForCategory: anEvent oldCategory do:[:mgr| mgr modified: true].!
Item was added: + ----- Method: MCPackageManager class>>isExtensionCategory: (in category 'system changes - support') ----- + isExtensionCategory: methodCategory + + ^ methodCategory isEmptyOrNil not and: [methodCategory first == $*]!
Item was changed: + ----- Method: MCPackageManager class>>managersForCategory:do: (in category 'system changes - support') ----- - ----- Method: MCPackageManager class>>managersForCategory:do: (in category 'system changes') ----- managersForCategory: aSystemCategory do: aBlock "Got to be careful here - we might get method categories where capitalization is problematic." | cat foundOne index | foundOne := false. cat := aSystemCategory ifNil:[^nil]. "yes this happens; for example in eToy projects" "first ask PackageInfos, their package name might not match the category" self registry do: [:mgr | (mgr packageInfo includesSystemCategory: aSystemCategory) ifTrue: [ aBlock value: mgr. foundOne := true. ] ]. foundOne ifTrue: [^self]. ["Loop over categories until we found a matching one" self registry at: (MCPackage named: cat) ifPresent:[:mgr| aBlock value: mgr. foundOne := true. ]. index := cat lastIndexOf: $-. index > 0]whileTrue:[ "Step up to next level package" cat := cat copyFrom: 1 to: index-1. ]. foundOne ifFalse:[ "Create a new (but only top-level)" aBlock value: (MCWorkingCopy forPackage: (MCPackage named: (aSystemCategory copyUpTo: $-) capitalized)). ].!
Item was changed: + ----- Method: MCPackageManager class>>managersForClass:category:do: (in category 'system changes - support') ----- - ----- Method: MCPackageManager class>>managersForClass:category:do: (in category 'system changes') ----- managersForClass: aClass category: methodCategory do: aBlock + + (self isExtensionCategory: methodCategory) + ifTrue: [self managersForExtensionCategory: methodCategory do: aBlock] + ifFalse: [self managersForClass: aClass do: aBlock].! - (methodCategory isEmptyOrNil or:[methodCategory first ~= $*]) ifTrue:[ - "Not an extension method" - ^self managersForClass: aClass do: aBlock. - ]. - self managersForCategory: methodCategory allButFirst do: aBlock.!
Item was changed: + ----- Method: MCPackageManager class>>managersForClass:do: (in category 'system changes - support') ----- - ----- Method: MCPackageManager class>>managersForClass:do: (in category 'system changes') ----- managersForClass: aClass do: aBlock
self registry do: [:mgr | (mgr packageInfo includesClass: aClass) ifTrue: [aBlock value: mgr]]!
Item was changed: + ----- Method: MCPackageManager class>>managersForClass:selector:do: (in category 'system changes - support') ----- - ----- Method: MCPackageManager class>>managersForClass:selector:do: (in category 'system changes') ----- managersForClass: aClass selector: aSelector do: aBlock ^self managersForClass: aClass category: (aClass organization categoryOfElement: aSelector) do: aBlock!
Item was added: + ----- Method: MCPackageManager class>>managersForExtensionCategory:do: (in category 'system changes - support') ----- + managersForExtensionCategory: methodCategory do: aBlock + + self managersForCategory: methodCategory allButFirst do: aBlock.!
Item was changed: ----- Method: MCPackageManager class>>methodMoved: (in category 'system changes') ----- methodMoved: anEvent + "Inform managers about old method protocol. Pass on to #methodModified: to inform managers about new/current method protocol." + + self + managersForClass: anEvent itemClass + category: anEvent oldCategory + do: [:mgr | mgr modified: true]. + - self managersForClass: anEvent itemClass category: anEvent oldCategory do:[:mgr| mgr modified: true]. self methodModified: anEvent.!
Item was added: + ----- Method: MCPackageManager class>>protocolRenamed: (in category 'system changes') ----- + protocolRenamed: anEvent + "Inform managers about old and new name for method protocol." + + self + managersForClass: anEvent itemClass + category: anEvent oldName + do: [:mgr | mgr modified: true]. + + self + managersForClass: anEvent itemClass + category: anEvent newName + do: [:mgr | mgr modified: true].!
Item was changed: + ----- Method: MCPackageManager class>>registerForNotifications (in category 'system changes - support') ----- - ----- Method: MCPackageManager class>>registerForNotifications (in category 'system changes') ----- registerForNotifications Smalltalk at: #SystemChangeNotifier ifPresent: [:cls| cls uniqueInstance noMoreNotificationsFor: self. self reregisterForNotificationsWith: cls uniqueInstance]!
Item was changed: + ----- Method: MCPackageManager class>>reregisterForNotificationsWith: (in category 'system changes - support') ----- - ----- Method: MCPackageManager class>>reregisterForNotificationsWith: (in category 'system changes') ----- reregisterForNotificationsWith: aSystemChangeNotifier aSystemChangeNotifier notify: self ofSystemChangesOfItem: #class change: #Added using: #classModified:; notify: self ofSystemChangesOfItem: #class change: #Modified using: #classModified:; notify: self ofSystemChangesOfItem: #class change: #Renamed using: #classModified:; notify: self ofSystemChangesOfItem: #class change: #Commented using: #classModified:; notify: self ofSystemChangesOfItem: #class change: #Recategorized using: #classMoved:; notify: self ofSystemChangesOfItem: #class change: #Removed using: #classRemoved:; notify: self ofSystemChangesOfItem: #method change: #Added using: #methodModified:; notify: self ofSystemChangesOfItem: #method change: #Modified using: #methodModified:; notify: self ofSystemChangesOfItem: #method change: #Recategorized using: #methodMoved:; + notify: self ofSystemChangesOfItem: #method change: #Removed using: #methodRemoved:; + notify: self ofSystemChangesOfItem: #protocol change: #Renamed using: #protocolRenamed:! - notify: self ofSystemChangesOfItem: #method change: #Removed using: #methodRemoved:!
Item was changed: + (PackageInfo named: 'Monticello') postscript: '"Adds support for protocol renaming" + MCWorkingCopy allManagers do: [:ea | ea registerForNotifications].'! - (PackageInfo named: 'Monticello') postscript: '(ServiceRegistry current serviceWithId: #browserMethodMenu) services - removeAllSuchThat: [:service | #(browseMcMethodRevisions browseMcMethodOrigin) includes: service id]. - (ServiceRegistry current serviceWithId: #browserClassMenu) services - removeAllSuchThat: [:service | #(browseMcClassRevisions browseMcClassOrigin) includes: service id].'!
packages@lists.squeakfoundation.org