Question

The context is this one:
A package had several branches developped in several repositories

  • squeaksource
  • source.squeak.org/trunk

Development stopped in source.squeak.org, and the goal is to transfer the branch back to squeaksource in order to have all versions published in a single repository.
But to ease human browsing and fast identification of the branch, I wish to add a standard branch identification to the name of squeaksource copy.
Is there a way to automate this operation? With Gofer maybe?

Was it helpful?

Solution

Monticello packages are immutable. You can easily move the versions around, but you should not rename the files. If you do, you break the history and loose the ability to merge the versions within your version tree and with other people's contributions.

To move all versions of package A from source url to target url you can use:

Gofer new
   repository: 'source url';
   package: 'A';
   fetch

" If you understand the concequences you could rename/rebranch the version files in your package-cache at this point. "

Gofer new
   repository: 'target url';
   package: 'A';
   push

OTHER TIPS

A more arcane solution which avoids subsequent serialization and deserialization of Monticello packages. This is useful for very big repositories and speeds up the copying quite a bit:

| sourceRepositoryUrl destinationRepositoryUrl files |

repositoryUrl := 'http://www.squeaksource.com/PROJECT'.
destinationRepositoryUrl := 'http://smalltalkhub.com/mc/USER/PROJECT/main'.

files := (MCHttpRepository new 
    parseFileNamesFromStream: (ZnClient new get: repositoryUrl; entity) readStream)
    select: [ :each | ZnMonticelloServerDelegate new isValidMczName: each ].

files do: [ :fileName ||entity stream|

    Transcript show: fileName; cr.
    "download version"
    entity := ZnClient new
    beOneShot;
        url: repositoryUrl;
        addPath: fileName;
        get;
        entity.

    "upload the version to gemstone"
    ZnClient new
        beOneShot;
        ifFail: [ :exception | Transcript show: fileName; show: ' '; print: exception ];
        username: 'USER' password: 'PASSWORD';
        entity: entity;
        url: destinationRepositoryUrl;
        addPath: fileName;
        put ]
displayingProgress: [ :fileName| 'Copying ', fileName]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top