[Glass] Code snippet needed ... how to save a monticello package

Dale Henrichs dale.henrichs at gemtalksystems.com
Fri Jan 25 11:14:33 PST 2019


Well, with tODE installed there is a straightforward smalltalk API for 
saving mcz files ... I created tODE so that the smalltalk API would be 
available even if they are not using the tODE GUI ... Saving Monticello 
packages is not the simplest thing to do:)

Here's is the tODE code that it takes to save an mc file with tODE (in 
the class TDMonticelloTool):

   mc save <pkg-name> <version-name> <repository-spec> <commit-message>
      save <pkg-name> <version-name> @<repository-path> @<commit-message>

   | packageName wc versionName repoSpec repo commitMessage newVersion |
   packageName := tokens at: 2.
   wc := self resolveWorkingCopyReference: packageName.
   versionName := tokens at: 3.
   repoSpec := tokens at: 4.
   repo := self resolveRepositoryReference: repoSpec.
   commitMessage := tokens at: 5.
   (commitMessage beginsWith: '@')
     ifTrue: [ commitMessage := self resolveAtPathReference: 
commitMessage ].
   newVersion := [ wc newVersion ]
     on: MCVersionNameAndMessageRequest
     do: [ :notification | notification resume: (Array with: versionName 
with: commitMessage) ].
   self storeVersion: newVersion inRepository: repo.
   ^ newVersion

as you can see there are several method calls to `self` here that each 
do some important work ... If you rummage around in a stone with tODE 
installed, you can extract the necessary code but there is quite a bit 
of code involved in going through the whole process of saving a package  
-- it is quite complicated ...

If you have tODE installed you would execute the following tODE command:

    mc save <package-name> <package-name>-<yourinits>.<sequence-number> filetree://<path-to-directory> `<commit-message>`

And this command can be run from a bash command-line in GsDevKit_home 
without firing up the GUI:

    $GS_HOME/bin/todeIt <stoneName> << EOF
    mc save <package-name> <package-name>-<yourinits>.<sequence-number> filetree://<path-to-directory> `<commit-message>`

Without tODE, you can take a look at the class MCCmdSavePackage which 
was part of the implementation of the repository browser in GemTools, 
but there is no simple API as MCCmdSavePackage was written as part of 
the MCRepositoryBrowser, so the state is distributed across multiple 
classes ...

I wrote the TDMonticelloTool to try to simplify the process of saving 
Monticello packages and I think that your best bet is to use tODE ... I 
don't think Jade has support for reading and writing Monticello packages ...

When Rowan becomes available, there will be a much simple smalltalk api 
for saving all of the dirty packages in a project and of course there 
will be suport from within Jadeite for saving projects as well ...

If you want a workspace doit that you can run from a Jade workspace in a 
stone with tODE installed, I can help with that ...


On 1/25/19 9:46 AM, Marten Feldtmann wrote:
> Normally not.
> Marten
>> Dale Henrichs via Glass <glass at lists.gemtalksystems.com> hat am 25. 
>> Januar 2019 um 18:27 geschrieben:
>> Marten,
>> Are you using a stone with tODE installed?
>> Dale
>> On 1/25/19 8:12 AM, Marten Feldtmann via Glass wrote:
>>> If I have a name of a Monticello package ... how can I save this 
>>> package into a file  under s apecific name ?
>>> _______________________________________________
>>> Glass mailing list
>>> Glass at lists.gemtalksystems.com  <mailto:Glass at lists.gemtalksystems.com>
>>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>> _______________________________________________
>> Glass mailing list
>> Glass at lists.gemtalksystems.com
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20190125/4acaa2f3/attachment-0001.html>

More information about the Glass mailing list