Last active
December 25, 2015 01:49
-
-
Save Uko/6898022 to your computer and use it in GitHub Desktop.
Move montichello repository to some other place
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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 |
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
Ha ha, I wonder how many of use kept a copy of this super-handy script :)