Skip to content

Commit

Permalink
Merge pull request #1798 from jecisc/set-tonel-version
Browse files Browse the repository at this point in the history
Allow to set tonel writer version to use for export
  • Loading branch information
tesonep authored Jan 31, 2024
2 parents 79ade7c + b63f84e commit b25aa14
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Iceberg-Libgit-Tonel/IceLibgitTonelWriter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ IceLibgitTonelWriter class >> forInternalStore [

{ #category : 'writing' }
IceLibgitTonelWriter class >> forInternalStoreFileOut: aMCVersion on: aRepository [
self forInternalStore
fileOut: aMCVersion
on: aRepository subdirectoryReference

(self forInternalStore forVersion: (aRepository properties tonelVersion ifNil: [ self forInternalStore defaultVersion ])) new
directoryReference: aRepository subdirectoryReference;
writeVersion: aMCVersion
]

{ #category : 'accessing' }
Expand Down
11 changes: 8 additions & 3 deletions Iceberg-Libgit/IceRepositoryProperties.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ IceRepositoryProperties class >> propertiesFileName [

{ #category : 'instance creation' }
IceRepositoryProperties class >> readPropertiesFrom: aFileReference [
self flag: #pharoFixMe. "When Pharo 6.1 will not be supported anymore we can directly use: `ref readStreamDo: [ :stream | STON fromStream: stream ]` but currently FileReference>>readStream return a ZnBufferedStream in Pharo 61 and a ZnCharacterReadStream decoding utf8 in Pharo 7."
^ aFileReference
binaryReadStreamDo: [ :stream | STON fromStream: (ZnCharacterReadStream on: stream encoding: 'utf8') ]

^ aFileReference readStreamDo: [ :stream | STON fromStream: stream ]
]

{ #category : 'comparing' }
Expand Down Expand Up @@ -210,6 +209,12 @@ IceRepositoryProperties >> storeOnFileReference: aFileReference [
nextPut: self properties ]
]

{ #category : 'private' }
IceRepositoryProperties >> tonelVersion [

^ self properties at: #version ifAbsent: [ nil ]
]

{ #category : 'accessing' }
IceRepositoryProperties >> writerClass [
^ self properties
Expand Down

0 comments on commit b25aa14

Please sign in to comment.