How to copy several Monticello commits from local repository to Smalltalkhub.com automatically?
Asked Answered
P

2

4

I commit several versions of Monticello packages to a local repository on my disk during the day.

At a later time I want to sync the local repository with a Smalltalkhub.com repository.

At the moment I copy the local commits manually one by one to the Smalltalkhub repository using the Monticello browser.

How can i automate this task?

Papuan answered 3/7, 2013 at 17:52 Comment(0)
P
2

You can use Gofer to automate your Monticello tasks.

 Gofer new
   package: 'MyProject-Core';
   package: 'MyProject-Tests';
   url: 'http://smalltalkhub.com/mc/USER/MyProject/main/' username: 'USER' password: '***';
   push.
Parrie answered 3/7, 2013 at 19:5 Comment(0)
S
5

In the Gofer chapter of the "deep into pharo" new free book (pharo by example two - http://rmod.lille.inria.fr/pbe2/.) I presented Gofer in details. In particular I present some ways to migrate between repositories
The default for Gofer is fetch and pull, based on that you can easily build sync.

For example if you use Smalltalk hub

Gofer new
  smalltalkhubUser: 'PharoBooks' project: 'GoferExample'; 
  package: 'PBE2GoferExample';
  package: 'PBE2GoferExampleSecondPackage';
  push.
Gofer new
  smalltalkhubUser: 'PharoBooks' project: 'GoferExample'; 
  package: 'PBE2GoferExample';
  package: 'PBE2GoferExampleSecondPackage';
  fetch

You can also obtain some information as follows

((Gofer new
  smalltalkhubUser: 'Pharo' project: 'NativeBoost'; allResolved)
     groupedBy: [ :each | each packageName])

Now you can also migrate

 | go |
 go := Gofer new squeaksource3: 'Pharo20'. 
 go allResolved
    do: [ :each | self crLog: each packageName. 
        go package: each packageName;
        fetch]

Then once you get the files in your local directory you can push to another repository.

  | go |
  go := Gofer new.
  go repository: (MCHttpRepository
                   location: 'http://ss3.gemtalksystems.com/ss/rb-pharo' 
                   user: 'pharoUser' 
                   password: 'pharoPwd').
  (((FileSystem disk workingDirectory / 'package-cache') allFiles 
       select: [:each | '*.mcz' match: each basename])
                    groupedBy: [:each | (each base copyUpToLast: $-) ]) keys 
                                            do: [:name | go package: name; push]
Sher answered 3/7, 2013 at 19:25 Comment(0)
P
2

You can use Gofer to automate your Monticello tasks.

 Gofer new
   package: 'MyProject-Core';
   package: 'MyProject-Tests';
   url: 'http://smalltalkhub.com/mc/USER/MyProject/main/' username: 'USER' password: '***';
   push.
Parrie answered 3/7, 2013 at 19:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.