currentVersion

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

currentVersion

Johan Brichau-3
When I evaluate "ConfigurationOfMyProject project currentVersion" I get a wrong result and even different results in different images (and gemstone extents).

What should I be looking at to find out why metacello gives me a wrong result?

Thx!

Sent from my iPad

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: currentVersion

Dale Henrichs-3
Johan,

The #currentVersion calculation is based on image state so it is not surprising that you can get different answers ...

During the calculation, Metacello tries to match a defined version against the image to determine the currentVersion. Metacello starts at the latest version and works its way backwards until it finds a "match."

There are some rules involving loaded package versions and loaded project versions that are used to determine a match, but the calculation is always an approximation and can get fooled ...

With the Metacello Preview I am doing away with the currentVersion calculation in favor of recording the version that was actually loaded. When using the scripting API the registry of loaded projects instead of doing a #currentVersion calculation. If you don't use the scripting API or explicitly send the currentVersion message, then the old algorithms are used.

If I recall correctly, you are already using the Metacello Preview. If so, you can query the registry with the following:

  Metacello image
    project: 'your-project-name';
    list

to get a projectSpec (or project specs) from which you can get the versionString or repository, etc.

If for some reason you still need to understand more about #currentVersion, let me know and we'll go a bit further into that quagmire:)

Dale

----- Original Message -----
| From: "Johan Brichau" <[hidden email]>
| To: [hidden email]
| Sent: Wednesday, August 21, 2013 10:04:40 AM
| Subject: [Metacello] currentVersion
|
| When I evaluate "ConfigurationOfMyProject project currentVersion" I
| get a wrong result and even different results in different images
| (and gemstone extents).
|
| What should I be looking at to find out why metacello gives me a
| wrong result?
|
| Thx!
|
| Sent from my iPad
|
| --
| You received this message because you are subscribed to the Google
| Groups "Metacello" group.
| To unsubscribe from this group and stop receiving emails from it,
| send an email to [hidden email].
| For more options, visit https://groups.google.com/groups/opt_out.
|

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: currentVersion

Johan Brichau-3
Hi Dale,

> The #currentVersion calculation is based on image state so it is not surprising that you can get different answers ...

Right, but not if they have identical packages loaded ;-)

> If I recall correctly, you are already using the Metacello Preview. If so, you can query the registry with the following:
>
>  Metacello image
>    project: 'your-project-name';
>    list
>
> to get a projectSpec (or project specs) from which you can get the versionString or repository, etc.

Aha, yes, we are using the scriping api.
That seems to provide what I need indeed.
I am currently automating our update process and getting the currently loaded version from an extent reliably is crucial.

thx!
Johan

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.