On Sat, 16 Feb 2019, Chris Muller wrote:
Hi all,
This version is intended to alleviate our concerns about readability by making the number no longer than someone's local phone number.
I still don't like this idea. Why? - while single version numbers are not too large, the system version number would still be 7 digits long - the version number would lose information about the number of commits of the given package. You may argue that it's not exact, but it still gives a good estimate. - the change is focused too much on the Trunk, while Monticello is used in other places too - it solves a problem that happens way too infrequently (different packages with the same name) - you can't commit the same package twice within a minute, which is a something you do when you want to split multiple changes up into different commits
Levente
Best, Chris
On Sat, Feb 16, 2019 at 4:49 PM commits@source.squeak.org wrote:
Chris Muller uploaded a new version of Monticello to project The Inbox: http://source.squeak.org/inbox/Monticello-cmm.66240.mcz
==================== Summary ====================
Name: Monticello-cmm.66240 Author: cmm Time: 16 February 2019, 4:49:51.685281 pm UUID: 435c7c35-3b22-4f66-b733-070ccd48a980 Ancestors: Monticello-eem.684
Monticello only requires monotonicity and uniqueness for its version numbers, not consecutiveness. When saving a new package, generate a unique, 6-digit versionNumber. Beginning approximately 2020-11-25T10:40:00+00:00, a 7th digit will appear -- no more than a local phone number -- which will be good until year 2038.
=============== Diff against Monticello-eem.684 ===============
Item was added:
- ----- Method: MCAncestry>>hasAncestorNamed: (in category 'ancestry') -----
- hasAncestorNamed: aString
self allAncestorsDo:
[ : each | aString asMCVersionName = each name ifTrue: [ ^ true ] ].
^ false!
Item was added:
- ----- Method: MCVersionName class>>newVersionNameFor: (in category 'utilities') -----
- newVersionNameFor: branchName
^ branchName, '-' , Utilities authorInitials , '.' , self newVersionNumberString!
Item was added:
- ----- Method: MCVersionName class>>newVersionNumberString (in category 'utilities') -----
- newVersionNumberString
"Answer a unique version number for use in generating the versionNumber portion of my name."
^ self versionNumberFor: DateAndTime now!
Item was added:
- ----- Method: MCVersionName class>>versionNumberFor: (in category 'private') -----
- versionNumberFor: aDateAndTime
"Answer a unique version number for use in generating the versionNumber portion of my name."
| epoch |
epoch := '2019-01-01T00:00:00+00:00' asDateAndTime.
^ (aDateAndTime - epoch) days * 24 * 60!
Item was changed: MCPackageManager subclass: #MCWorkingCopy
instanceVariableNames: 'versionInfo ancestry repositoryGroup requiredPackages environment'
instanceVariableNames: 'versionInfo ancestry counter repositoryGroup requiredPackages environment' classVariableNames: '' poolDictionaries: '' category: 'Monticello-Versioning'!
Item was changed: ----- Method: MCWorkingCopy>>nextVersionName (in category 'private') ----- nextVersionName | branch oldName | ancestry ancestors isEmpty ifTrue:
[ branch := package name ]
[ counter ifNil: [ counter := 0 ].
branch := package name ] ifFalse: [ oldName := ancestry ancestors first versionName.
branch := oldName packageAndBranchName ].
^ MCVersionName newVersionNameFor: branch!
branch := oldName packageAndBranchName.
counter ifNil:
[ counter := (ancestry ancestors detectMax:
[ : eachVersionInfo | eachVersionInfo versionNumber ])
ifNil: [ 0 ]
ifNotNil:
[ : highestNumbered | highestNumbered versionNumber ] ] ].
counter := counter + 1.
^ branch , '-' , Utilities authorInitials , '.' , counter asString!
Item was changed: ----- Method: MCWorkingCopy>>uniqueVersionName (in category 'private') ----- uniqueVersionName |versionName|
counter := nil. [versionName := self nextVersionName.
(self repositoryGroup includesVersionNamed: versionName) or: [ ancestry hasAncestorNamed: versionName ]] whileTrue.
self repositoryGroup includesVersionNamed: versionName] whileTrue. ^ versionName!