Created
January 14, 2015 11:27
-
-
Save tinchodias/2f04c0590c73d1a0c8ed to your computer and use it in GitHub Desktop.
Gofer migration 2
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
packageNames := #(ConfigurationOfEpiceaSorter EpiceaSorter EpiceaSorterAnalysis). | |
sourceHttpRepository := | |
MCSmalltalkhubRepository | |
owner: 'MartinDias' | |
project: 'Epicea' | |
user: 'MartinDias' | |
password: 'xxxx'. | |
destinationHttpRepository := | |
MCSmalltalkhubRepository | |
owner: 'MartinDias' | |
project: 'EpiceaUntangler' | |
user: 'MartinDias' | |
password: 'xxxx'. | |
errors := OrderedCollection new. | |
packageNames do: [ :aPackageName | | |
| fileNames | | |
fileNames := sourceHttpRepository fileNamesForPackageNamed: aPackageName. | |
fileNames | |
do: [ :aFileName | | |
[(destinationHttpRepository includesFileNamed: aFileName) ifFalse: [ | |
| aVersion | | |
aVersion := sourceHttpRepository versionFromFileNamed: aFileName. | |
destinationHttpRepository storeVersion: aVersion] ] | |
on: Error | |
do: [ :e | errors add: aFileName -> e ]. ] | |
displayingProgress: [ 'Processing ', aPackageName, ' (total: ', fileNames size asString, ')' ] | |
]. | |
missingFileNamesByPackageName := packageNames collect: [ :aPackageName | | |
| sourceFileNames destinationFileNames | | |
sourceFileNames := sourceHttpRepository fileNamesForPackageNamed: aPackageName. | |
destinationFileNames := destinationHttpRepository fileNamesForPackageNamed: aPackageName. | |
aPackageName -> (sourceFileNames difference: destinationFileNames). | |
]. | |
errors2 := OrderedCollection new. | |
(missingFileNamesByPackageName flatCollect: #value) do: [ :aFileName | | |
[ | |
(destinationHttpRepository includesFileNamed: aFileName) ifFalse: [ | |
| aVersion | | |
aVersion := sourceHttpRepository versionFromFileNamed: aFileName. | |
destinationHttpRepository storeVersion: aVersion] ] | |
on: Error | |
do: [ :e | errors2 add: aFileName -> e ]. ] | |
displayingProgress: [ :aFileName | 'Re-trying with ', aFileName ]. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment