On 1/27/16 12:03 AM, Thierry Goubier wrote:
Hi Dale,Thierry,
then a question: how does one query a baselineOf or a configOf to retrieve the current project state (i.e. packages) loaded in the image?
Thierry
Good question:)
To start with in tODE I have a class TDMetacelloProjectRegistrationDefinition which is part of the following hierarchy:
Object
��TDDefinition
�� TDPackageBasedDefinition
�� ��TDAbstractProjectRegistrationDefinition
�� �� TDGitProjectRegistrationDefinition
�� �� TDMetacelloProjectRegistrationDefinition
�� �� ��TDMetacelloRegistrationDefinition
�� �� �� TDMetacelloBaselineRegistrationDefinition
�� �� �� TDMetacelloConfigurationRegistrationDefinition
�� �� �� TDMetacelloHybridRegistrationDefinition
�� �� ��TDMetacelloUnloadedProjectRegistrationDefinition
The method TDMetacelloProjectRegistrationDefinition>>workingCopies[1] calculates the list of MCWorkingCopy instances for the loaded packages associated with a project (including the configurationof or baselineof... or both).
The key Metacello methods called include:
�� MetacelloProjectRegistration>>projectVersion[2]
�� MetacelloMCVersion>>packages[3]
�� MetacelloPackageSpec>>workingCopy[4]
�� MetacelloMCProjectSpec>>projectPackage[5]
This is really the key information for doing all of the other operations for a "Project Browser" like "save all dirty packages and commit" and "give me diffs for all dirty packages in project"...
Dale
[1] https://github.com/dalehenrich/tode/blob/master/repository/Topez-Server-Core.package/TDMetacelloProjectRegistrationDefinition.class/instance/workingCopies.st
[2] https://github.com/dalehenrich/metacello-work/blob/master/repository/Metacello-Core.package/MetacelloProjectRegistration.class/instance/projectVersion.st
[3] https://github.com/dalehenrich/metacello-work/blob/master/repository/Metacello-MC.package/MetacelloMCVersion.class/instance/packages.st
[4] https://github.com/dalehenrich/metacello-work/blob/master/repository/Metacello-MC.package/MetacelloPackageSpec.class/instance/workingCopy.st
[5] https://github.com/dalehenrich/metacello-work/blob/master/repository/Metacello-MC.package/MetacelloMCProjectSpec.class/instance/projectPackage.st