MetacelloProject>>currentVersion

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

MetacelloProject>>currentVersion

Alexandre Bergel-5
Hi!

I am wondering what currentVersion exactly do. I am facing an unnatural behavior, for which I cannot say whether this is a bug or a feature.

Consider a configuration of bitbltpen. I define the following class and methods:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
((Smalltalk globals at: #MetacelloConfigTemplate) duplicateClassWithNewName: #ConfigurationOfBitBltPen) category: 'ConfigurationOfBitBltPen'

ConfigurationOfBitBltPen>>baseline10: spec
        <version: '1.0-baseline'>
       
        spec for: #common do: [
                spec blessing: #baseline.
        ].

        spec for: #pharo do: [
                spec
                        repository: 'http://www.squeaksource.com/PharoNonCorePackage';
                        package: 'BitBltPen'
        ]

ConfigurationOfBitBltPen>>version10: spec
        <version: '1.0' imports: #('1.0-baseline') >
       
        spec for: #pharo do: [
                spec
                        package: 'BitBltPen' with: 'BitBltPen-StephaneDucasse.1' ].
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

The expression "ConfigurationOfBitBltPen project currentVersion" returns nil. I would expect 1.0 actually.
Is this a bug in currentVersion? I understand that since the MetacelloPlatform current stackCache does not have an entry for the configuration. But is this really what is expected?

I am working on a MetacelloBrowser tool. I am almost there. Just a few minor things hamper me from getting a first release of the tool.

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





Reply | Threaded
Open this post in threaded view
|

Re: MetacelloProject>>currentVersion

Mariano Martinez Peck


On Fri, Jan 7, 2011 at 2:10 PM, Alexandre Bergel <[hidden email]> wrote:
Hi!

I am wondering what currentVersion exactly do. I am facing an unnatural behavior, for which I cannot say whether this is a bug or a feature.

Consider a configuration of bitbltpen. I define the following class and methods:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
((Smalltalk globals at: #MetacelloConfigTemplate) duplicateClassWithNewName: #ConfigurationOfBitBltPen) category: 'ConfigurationOfBitBltPen'

ConfigurationOfBitBltPen>>baseline10: spec
       <version: '1.0-baseline'>

       spec for: #common do: [
               spec blessing: #baseline.
       ].

       spec for: #pharo do: [
               spec
                       repository: 'http://www.squeaksource.com/PharoNonCorePackage';
                       package: 'BitBltPen'
       ]

ConfigurationOfBitBltPen>>version10: spec
       <version: '1.0' imports: #('1.0-baseline') >

       spec for: #pharo do: [
               spec
                       package: 'BitBltPen' with: 'BitBltPen-StephaneDucasse.1' ].
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

The expression "ConfigurationOfBitBltPen project currentVersion" returns nil. I would expect 1.0 actually.

yes, I would expect nil because I know about #currentVersion. However, the name can be a little misleading, because it is the CURRENT version that you have loaded in such image.
So, if you never loaded any version, then there is no current version ;)   It is not about the cong/repo info, but your own image
maybe the name #localVesion is better?  I don't know

 
Is this a bug in currentVersion? I understand that since the MetacelloPlatform current stackCache does not have an entry for the configuration. But is this really what is expected?

I am working on a MetacelloBrowser tool. I am almost there. Just a few minor things hamper me from getting a first release of the tool.

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Reply | Threaded
Open this post in threaded view
|

Re: MetacelloProject>>currentVersion

Alexandre Bergel-5
>
> The expression "ConfigurationOfBitBltPen project currentVersion" returns nil. I would expect 1.0 actually.
>
> yes, I would expect nil because I know about #currentVersion. However, the name can be a little misleading, because it is the CURRENT version that you have loaded in such image.
> So, if you never loaded any version, then there is no current version ;)   It is not about the cong/repo info, but your own image
> maybe the name #localVesion is better?  I don't know

That looks strange to me. Why getting the current version has to be related to what I previously loaded?

Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





Reply | Threaded
Open this post in threaded view
|

Re: MetacelloProject>>currentVersion

Guillermo Polito
In reply to this post by Mariano Martinez Peck
Maybe #installedVersion ?

On Fri, Jan 7, 2011 at 10:29 AM, Mariano Martinez Peck <[hidden email]> wrote:


On Fri, Jan 7, 2011 at 2:10 PM, Alexandre Bergel <[hidden email]> wrote:
Hi!

I am wondering what currentVersion exactly do. I am facing an unnatural behavior, for which I cannot say whether this is a bug or a feature.

Consider a configuration of bitbltpen. I define the following class and methods:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
((Smalltalk globals at: #MetacelloConfigTemplate) duplicateClassWithNewName: #ConfigurationOfBitBltPen) category: 'ConfigurationOfBitBltPen'

ConfigurationOfBitBltPen>>baseline10: spec
       <version: '1.0-baseline'>

       spec for: #common do: [
               spec blessing: #baseline.
       ].

       spec for: #pharo do: [
               spec
                       repository: 'http://www.squeaksource.com/PharoNonCorePackage';
                       package: 'BitBltPen'
       ]

ConfigurationOfBitBltPen>>version10: spec
       <version: '1.0' imports: #('1.0-baseline') >

       spec for: #pharo do: [
               spec
                       package: 'BitBltPen' with: 'BitBltPen-StephaneDucasse.1' ].
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

The expression "ConfigurationOfBitBltPen project currentVersion" returns nil. I would expect 1.0 actually.

yes, I would expect nil because I know about #currentVersion. However, the name can be a little misleading, because it is the CURRENT version that you have loaded in such image.
So, if you never loaded any version, then there is no current version ;)   It is not about the cong/repo info, but your own image
maybe the name #localVesion is better?  I don't know

 
Is this a bug in currentVersion? I understand that since the MetacelloPlatform current stackCache does not have an entry for the configuration. But is this really what is expected?

I am working on a MetacelloBrowser tool. I am almost there. Just a few minor things hamper me from getting a first release of the tool.

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.







Reply | Threaded
Open this post in threaded view
|

Re: MetacelloProject>>currentVersion

Dale Henrichs
In reply to this post by Alexandre Bergel-5
On 01/07/2011 05:38 AM, Alexandre Bergel wrote:

>>
>> The expression "ConfigurationOfBitBltPen project currentVersion" returns nil. I would expect 1.0 actually.
>>
>> yes, I would expect nil because I know about #currentVersion. However, the name can be a little misleading, because it is the CURRENT version that you have loaded in such image.
>> So, if you never loaded any version, then there is no current version ;)   It is not about the cong/repo info, but your own image
>> maybe the name #localVesion is better?  I don't know
>
> That looks strange to me. Why getting the current version has to be related to what I previously loaded?
>
> Alexandre

As Mariano explained, the #currentVersion returns the version that is
installed in the image ... Be aware that it does not necessarily return
the version that you loaded...if you have manually loaded/unloaded or
the definition of a version is changed (because it is a #development
version) then you may get an answer that is different than the version
that you loaded ... Metacello does not store any state ... the image
already has all of the state, so Metacello calculates the
#currentVersion by finding the "best fit" version (basically matching
image state to version definitions) ... you can query a version for it's
versionStatus to determine how good a fit the match is:

        #allLoadedToSpec: "all projects and packages are loaded and
                           match specification"
           #loadedToSpec:"all loaded projects and packages match
                          specifications (at least one package loaded)"
#loadedMatchConstraints: "all loaded projects and packages match
                           constraints (at least one package loaded)"
        #somethingLoaded: "at least one package loaded"

If not match can be made, the #currentVersion returns nil ...

I don't quite understand the algorithm behind what you expected
#currentVersion to return ... when I look at ConfigurationOfBitBltPen I
don't see why version '1.0' is any more "current" than '1.0-baseline'.
There is a defined sort order for the versions and #lastVersion gives
you the the "latest version" without regard to blessings.

If you are working on the tool, then I think that the new version of
Metacello (1.0-beta.28 which will be released very soon now). In that
version I have added support for a development cycle and part of that
support is to the symbolic version #development to define the _current
development version_ ... then the MetacelloToolBox methods can reason
about the _current development version_ which might be what you are
trying to do here ..

Before doing too much more work on your own, I encourage you to load the
1.0-beta.28 and take a look at the help browser (I document the toolbox
api and the development process there) since the release of 1.0-beta.28
is imminent you might change the MetacelloBrowser tool to use the
toolbox and provide me with feedback for changes extensions (I have been
mentioning the toolbox over the last few months ... hoping for
feedback). The toolbox is intended to implement the basic algorithms
that _should_ be used by Metacello tools so that the same functions
behave the same whether you invoke them from a menu or as a script...

Dale
Reply | Threaded
Open this post in threaded view
|

Re: MetacelloProject>>currentVersion

Dale Henrichs
On 01/07/2011 09:59 AM, Dale Henrichs wrote:
> On 01/07/2011 05:38 AM, Alexandre Bergel wrote:

>
> Before doing too much more work on your own, I encourage you to load the
> 1.0-beta.28 and take a look at the help browser (I document the toolbox
> api and the development process there) since the release of 1.0-beta.28
> is imminent you might change the MetacelloBrowser tool to use the
> toolbox and provide me with feedback for changes extensions (I have been
> mentioning the toolbox over the last few months ... hoping for
> feedback). The toolbox is intended to implement the basic algorithms
> that _should_ be used by Metacello tools so that the same functions
> behave the same whether you invoke them from a menu or as a script...
>
> Dale

One more comment ... There is a lot of information that can be extracted
from Metacello configurations/versions/projects/etc, but it can be
difficult to find the right method since there are so many classes
involved ... So I really want the toolbox to be th focal point and plan
to include entry points for all the different aspects of metacello over
time ...

Dale
Reply | Threaded
Open this post in threaded view
|

Re: MetacelloProject>>currentVersion

Mariano Martinez Peck
In reply to this post by Dale Henrichs


On Fri, Jan 7, 2011 at 6:59 PM, Dale Henrichs <[hidden email]> wrote:
On 01/07/2011 05:38 AM, Alexandre Bergel wrote:

The expression "ConfigurationOfBitBltPen project currentVersion" returns nil. I would expect 1.0 actually.

yes, I would expect nil because I know about #currentVersion. However, the name can be a little misleading, because it is the CURRENT version that you have loaded in such image.
So, if you never loaded any version, then there is no current version ;)   It is not about the cong/repo info, but your own image
maybe the name #localVesion is better?  I don't know

That looks strange to me. Why getting the current version has to be related to what I previously loaded?

Alexandre

As Mariano explained, the #currentVersion returns the version that is installed in the image ...

maybe we can use #installedVersion as Guille suggested?
 
Be aware that it does not necessarily return the version that you loaded...if you have manually loaded/unloaded or the definition of a version is changed (because it is a #development version) then you may get an answer that is different than the version that you loaded ...

ahhhhh I didn't know that ;)
 
Metacello does not store any state ...

I think I would like that metacello stores EXACTLY which version as loaded. I think that for bugs detection in projects and configurations it would be useful. Maybe we can add a new #installVersion that answers exactlly this. what do you think?

thanks

mariano
 
the image already has all of the state, so Metacello calculates the #currentVersion by finding the "best fit" version (basically matching image state to version definitions) ... you can query a version for it's versionStatus to determine how good a fit the match is:

      #allLoadedToSpec: "all projects and packages are loaded and
                         match specification"
         #loadedToSpec:"all loaded projects and packages match
                        specifications (at least one package loaded)"
#loadedMatchConstraints: "all loaded projects and packages match
                         constraints (at least one package loaded)"
      #somethingLoaded: "at least one package loaded"

If not match can be made, the #currentVersion returns nil ...

I don't quite understand the algorithm behind what you expected #currentVersion to return ... when I look at ConfigurationOfBitBltPen I don't see why version '1.0' is any more "current" than '1.0-baseline'. There is a defined sort order for the versions and #lastVersion gives you the the "latest version" without regard to blessings.

If you are working on the tool, then I think that the new version of Metacello (1.0-beta.28 which will be released very soon now). In that version I have added support for a development cycle and part of that support is to the symbolic version #development to define the _current development version_ ... then the MetacelloToolBox methods can reason about the _current development version_ which might be what you are trying to do here ..

Before doing too much more work on your own, I encourage you to load the 1.0-beta.28 and take a look at the help browser (I document the toolbox api and the development process there) since the release of 1.0-beta.28 is imminent you might change the MetacelloBrowser tool to use the toolbox and provide me with feedback for changes extensions (I have been mentioning the toolbox over the last few months ... hoping for feedback). The toolbox is intended to implement the basic algorithms that _should_ be used by Metacello tools so that the same functions behave the same whether you invoke them from a menu or as a script...

Dale

Reply | Threaded
Open this post in threaded view
|

Re: MetacelloProject>>currentVersion

Dale Henrichs


On Saturday, January 8, 2011 4:03:10 AM UTC-8, Mariano Martinez Peck wrote:


On Fri, Jan 7, 2011 at 6:59 PM, Dale Henrichs <[hidden email]> wrote:
On 01/07/2011 05:38 AM, Alexandre Bergel wrote:

As Mariano explained, the #currentVersion returns the version that is installed in the image ...

maybe we can use #installedVersion as Guille suggested?
 
Be aware that it does not necessarily return the version that you loaded...if you have manually loaded/unloaded or the definition of a version is changed (because it is a #development version) then you may get an answer that is different than the version that you loaded ...

ahhhhh I didn't know that ;)
 
Metacello does not store any state ...

I think I would like that metacello stores EXACTLY which version as loaded. I think that for bugs detection in projects and configurations it would be useful. Maybe we can add a new #installVersion that answers exactlly this. what do you think?

I think that sounds like a really good idea ... I'll submit a feature request ... I've actually done something like this in the past, so I should be able to implement it in 1.0-beta.28 ...

Dale