Skip to content

Instantly share code, notes, and snippets.

@Uko
Last active December 25, 2015 01:49
Show Gist options
  • Save Uko/6898022 to your computer and use it in GitHub Desktop.
Save Uko/6898022 to your computer and use it in GitHub Desktop.
Move montichello repository to some other place
"script by Damien Cassou originaly from: https://code.google.com/p/smalltalk-hub/issues/detail?id=12"
| source goSource destination goDestination files destinationFiles |
source := MCHttpRepository location: '<url-to-source-sepository>'.
destination := MCHttpRepository
location: '<url-to-destination-sepository>'
user: '<login>'
password: '<pass>'.
goSource := Gofer new repository: source.
goDestination := Gofer new repository: destination.
files := source allVersionNames.
(goSource allResolved select: [ :resolved | files anySatisfy: [ :each |
resolved name = each ] ]) do: [ :each | goSource package: each packageName ].
goSource fetch. "downloads all mcz on your computer"
destinationFiles := destination allVersionNames. "checks what files are already at destination"
files reject: [ :file | destinationFiles includes: file ] thenDo: [ :file |
goDestination version: file ]. "selects only the mcz that are not yet at destination"
goDestination push. "sends everything to new repository"
"check if we have exactly the same files at source and destination"
self assert: destination allVersionNames sorted = files sorted
@seandenigris
Copy link

Ha ha, I wonder how many of use kept a copy of this super-handy script :)

@DamienCassou
Copy link

I'm happy if others found it useful :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment