Skip to content

Commit

Permalink
add migration instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanlm committed Oct 6, 2017
1 parent a44b113 commit 74fa8bb
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions MigrateFromFileTree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Migrate from FileTree to Tonel
===

I prepared this small script to drive your migration:

```Smalltalk
locationDir := 'path/to/your/repo' asFileReference.
subDir := 'your-source-dir-or-empty'.
sourceDir := locationDir.
subDir
ifNotNil: [
subDirWithDelim := subDir, '/'.
sourceDir := sourceDir / subDir ]
ifNil: [
subDirWithDelim := '' ].
repo := IceRepositoryCreator new
location: locationDir;
subdirectory: subDir;
createRepository.
"branch if you want to perform the migration on separated place (you
can later do a PR)"
repo createBranch: 'migrate-sources-to-tonel'.
commit := repo branch lastCommit.
repo savedPackages do: [ :each | | filetreePackage |
TonelWriter fileOut: (commit versionFor: each) on: sourceDir.
filetreePackage := IceLibgitFiletreeWriter directoryNameFor: each.
(sourceDir / filetreePackage) ensureDeleteAll.
repo addFilesToIndex: {
subDirWithDelim, (IceLibgitTonelWriter directoryNameFor: each).
subDirWithDelim, (IceLibgitFiletreeWriter directoryNameFor: each). } ].
repo addProperties: (IceRepositoryProperties fromDictionary: { #format -> #tonel } asDictionary).
repo
commitIndexWithMessage: 'sources migrated'
andParents: { commit }.
repo push.
```

*Please note that is not possible to migrate history from FileTree to Tonel. This is because FileTree is file-per-method and Tonel is File-Per-Class, so no conversion can be made (at least that I can think of).*

0 comments on commit 74fa8bb

Please sign in to comment.