[squeak-dev] The Inbox: Monticello-ul.726.mcz
Levente Uzonyi
leves at caesar.elte.hu
Mon Jun 29 18:28:39 UTC 2020
On Mon, 29 Jun 2020, Jakob Reschke wrote:
> Am Mo., 29. Juni 2020 um 01:43 Uhr schrieb <commits at source.squeak.org>:
>>
>> + ----- Method: MCDirectoryRepository>>includesVersionNamed: (in category 'versions') -----
>> + includesVersionNamed: aString
>> +
>> + | comparable |
>> + comparable := ((aString endsWith: '.mcz') and: [ aString size > 4 ])
>> + ifTrue: [ aString allButLast: 4 ]
>> + ifFalse: [ aString ].
>
> Thank you for the suggestion. Why not use aString asMCVersionName
> versionName here?
Copy-paste from parent.
When Chris introduced MCVersionName, he tried to use #asMCVersionName
there, but later he reverted it according to the history of the parent
method. It probably broke stuff (see below).
I think MCVersionName is something that should not exists in its current
form. Why?
- it's a subclass of ByteString, which limits the possible character set
- #= is not commutative when one object is an MCVersionName, the other is
a ByteString:
'foo' = 'foo.mcz' asMCVersionName. "==> false"
'foo.mcz' asMCVersionName = 'foo'. "==> true"
- the above property breaks the contract of #hash and #=, so they
sometimes misbehave in hashed collections
>
> Doesn't the repository include the version even if it is just a diffy
> version? You might say no because there is no complete snapshot, but
It does, but we can't look up the diffy version, because we can't know the
previous version the diff was made against.
> the diffy version has the same versionInfo after all, doesn't it?
Yes, it has the same versionInfo.
Levente
More information about the Squeak-dev
mailing list
|