-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitDeltaCreator, GitDeltaIndex and helper classes
- Loading branch information
Showing
101 changed files
with
713 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
6 changes: 6 additions & 0 deletions
6
src/FileSystem-Git.package/GitDeltaCreator.class/class/createFor.basedOn..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
instance creation | ||
createFor: aCollection basedOn: aDeltaIndex | ||
^ (self | ||
withDeltaIndex: aDeltaIndex | ||
target: aCollection) | ||
create |
7 changes: 7 additions & 0 deletions
7
src/FileSystem-Git.package/GitDeltaCreator.class/class/createFor.basedOn.maxSize..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
instance creation | ||
createFor: aCollection basedOn: aDeltaIndex maxSize: aNumber | ||
^ (self | ||
withDeltaIndex: aDeltaIndex | ||
target: aCollection | ||
maxSize: aNumber) | ||
create |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/class/maxOperationSize.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
constants | ||
maxOperationSize | ||
^ GitDeltaRabinHasher window + 18 |
6 changes: 6 additions & 0 deletions
6
src/FileSystem-Git.package/GitDeltaCreator.class/class/withDeltaIndex.target..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
instance creation | ||
withDeltaIndex: aDeltaIndex target: aCollection | ||
^ self new | ||
deltaIndex: aDeltaIndex; | ||
target: aCollection; | ||
yourself |
5 changes: 5 additions & 0 deletions
5
src/FileSystem-Git.package/GitDeltaCreator.class/class/withDeltaIndex.target.maxSize..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
instance creation | ||
withDeltaIndex: aDeltaIndex target: aCollection maxSize: aNumber | ||
^ (self withDeltaIndex: aDeltaIndex target: aCollection) | ||
maxSize: aNumber; | ||
yourself |
4 changes: 4 additions & 0 deletions
4
src/FileSystem-Git.package/GitDeltaCreator.class/instance/checkMaxSize.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
as yet unclassified | ||
checkMaxSize | ||
(self hasMaxSize and: [self output size >= self maxSize]) | ||
ifTrue: [self output: nil]. |
12 changes: 12 additions & 0 deletions
12
src/FileSystem-Git.package/GitDeltaCreator.class/instance/create.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
as yet unclassified | ||
create | ||
self | ||
initializeHasher; | ||
createOutput; | ||
writeSourceSize; | ||
writeTargetSize; | ||
writeInsertionsWhileInitializingHashValue; | ||
mainLoop; | ||
ensureInsertionCountIsWritten; | ||
checkMaxSize. | ||
^ self output |
7 changes: 7 additions & 0 deletions
7
src/FileSystem-Git.package/GitDeltaCreator.class/instance/createOutput.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
as yet unclassified | ||
createOutput | ||
| initialSize | | ||
initialSize := 8192. | ||
(self hasMaxSize and: [initialSize >= self maxSize]) | ||
ifTrue: [initialSize := self maxSize + self class maxOperationSize + 1]. | ||
self output: (OrderedCollection new: initialSize). |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/deltaIndex..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
deltaIndex: anObject | ||
deltaIndex := anObject |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/deltaIndex.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
deltaIndex | ||
^ deltaIndex |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/ensureInsertionCountIsWritten.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
ensureInsertionCountIsWritten | ||
self hasInsertion ifTrue: [self writeInsertionCount]. |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/erase.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
erase | ||
self output removeLast. |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/eraseSlotForInsertionCount.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
eraseSlotForInsertionCount | ||
self erase. |
14 changes: 14 additions & 0 deletions
14
src/FileSystem-Git.package/GitDeltaCreator.class/instance/expandMatchBackwards.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
as yet unclassified | ||
expandMatchBackwards | ||
self hasInsertion ifFalse: [^ self]. | ||
[self matchIndex > 1 and: [(self source at: self matchIndex - 1) = (self target at: self targetIndex - 1)]] | ||
whileTrue: [ | ||
self matchSize: self matchSize + 1. | ||
self matchIndex: self matchIndex - 1. | ||
self targetIndex: self targetIndex - 1. | ||
self erase. | ||
self insertionCount: self insertionCount - 1. | ||
self hasInsertion ifFalse: [ | ||
self eraseSlotForInsertionCount. | ||
^ self]]. | ||
self writeInsertionCount. |
21 changes: 21 additions & 0 deletions
21
src/FileSystem-Git.package/GitDeltaCreator.class/instance/findMatch.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
as yet unclassified | ||
findMatch | ||
self matchSize < 4096 ifFalse: [^ self]. | ||
self hasher addRollingValueAt: self targetIndex. | ||
self deltaIndex entriesWithHashValue: self hasher hashValue do: [:entry | | ||
| currentSource sourceRestSize currentTarget newMatchSize | | ||
currentSource := entry index. | ||
currentTarget := self targetIndex. | ||
sourceRestSize := self source size + 1 - currentSource | ||
clampHigh: self target size + 1 - currentTarget. | ||
sourceRestSize < self matchSize ifTrue: [^ self]. | ||
[sourceRestSize > 0 and: [(self source at: currentSource) = (self target at: currentTarget)]] whileTrue: [ | ||
sourceRestSize := sourceRestSize - 1. | ||
currentSource := currentSource + 1. | ||
currentTarget := currentTarget + 1]. | ||
newMatchSize := currentSource - entry index. | ||
self matchSize < newMatchSize ifTrue: [ | ||
self | ||
matchSize: newMatchSize; | ||
matchIndex: entry index. | ||
self matchSize >= 4096 ifTrue: [^ self]]]. |
8 changes: 8 additions & 0 deletions
8
src/FileSystem-Git.package/GitDeltaCreator.class/instance/handleMatch.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
as yet unclassified | ||
handleMatch | ||
self matchSize < 4 | ||
ifTrue: [self insertOne] | ||
ifFalse: [self | ||
expandMatchBackwards; | ||
writeCopy; | ||
reinitializeHashValue]. |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/hasInsertion.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
hasInsertion | ||
^ self insertionCount > 0 |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/hasMaxSize.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
hasMaxSize | ||
^ self maxSize isZero not |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/hasher..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
hasher: anObject | ||
hasher := anObject |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/hasher.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
hasher | ||
^ hasher |
9 changes: 9 additions & 0 deletions
9
src/FileSystem-Git.package/GitDeltaCreator.class/instance/initialize.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
as yet unclassified | ||
initialize | ||
super initialize. | ||
self | ||
maxSize: 0; | ||
targetIndex: 1; | ||
insertionCount: 0; | ||
matchIndex: 1; | ||
matchSize: 0. |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/initializeHasher.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
initializeHasher | ||
self hasher: (GitDeltaRabinHasher on: self target). |
7 changes: 7 additions & 0 deletions
7
src/FileSystem-Git.package/GitDeltaCreator.class/instance/insertOne.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
accessing | ||
insertOne | ||
self hasInsertion ifFalse: [self skipSlotForInsertionCount]. | ||
self writeInsertion. | ||
self targetIndex: self targetIndex + 1. | ||
self insertionCount = 16r7f ifTrue: [self writeInsertionCount]. | ||
self matchSize: 0. |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/insertionCount..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
insertionCount: anObject | ||
insertionCount := anObject |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/insertionCount.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
insertionCount | ||
^ insertionCount |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/isAborted.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
isAborted | ||
^ self output isNil |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/isAtEnd.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
isAtEnd | ||
^ self targetIndex > self target size |
8 changes: 8 additions & 0 deletions
8
src/FileSystem-Git.package/GitDeltaCreator.class/instance/mainLoop.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
as yet unclassified | ||
mainLoop | ||
[self isAtEnd] whileFalse: [ | ||
self | ||
findMatch; | ||
handleMatch; | ||
checkMaxSize. | ||
self isAborted ifTrue: [^ self]]. |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/matchIndex..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
matchIndex: anObject | ||
matchIndex := anObject |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/matchIndex.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
matchIndex | ||
^ matchIndex |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/matchSize..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
matchSize: anObject | ||
matchSize := anObject |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/matchSize.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
matchSize | ||
^ matchSize |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/maxSize..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
maxSize: anObject | ||
maxSize := anObject |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/maxSize.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
maxSize | ||
^ maxSize |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/output..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
output: anObject | ||
output := anObject |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/output.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
output | ||
^ output |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/read.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
read | ||
^ self target at: self targetIndex |
4 changes: 4 additions & 0 deletions
4
src/FileSystem-Git.package/GitDeltaCreator.class/instance/reinitializeHashValue.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
as yet unclassified | ||
reinitializeHashValue | ||
self matchSize < 4096 ifFalse: [^ self]. | ||
self hasher hashFirstWindowAt: self targetIndex - self hasher class window. |
4 changes: 4 additions & 0 deletions
4
src/FileSystem-Git.package/GitDeltaCreator.class/instance/skipSlotForInsertionCount.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
as yet unclassified | ||
skipSlotForInsertionCount | ||
"placeholder that will be overwritten or easy to find during debugging" | ||
self write: -1. |
4 changes: 4 additions & 0 deletions
4
src/FileSystem-Git.package/GitDeltaCreator.class/instance/skipSlotForOperation.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
as yet unclassified | ||
skipSlotForOperation | ||
"placeholder that will be overwritten or easy to find during debugging" | ||
self write: -1. |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/source.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
source | ||
^ self deltaIndex source |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/target..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
target: anObject | ||
target := anObject |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/target.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
target | ||
^ target |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/targetIndex..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
targetIndex: anObject | ||
targetIndex := anObject |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/targetIndex.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
targetIndex | ||
^ targetIndex |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/write..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
write: anInteger | ||
self output addLast: anInteger. |
21 changes: 21 additions & 0 deletions
21
src/FileSystem-Git.package/GitDeltaCreator.class/instance/writeCopy.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
as yet unclassified | ||
writeCopy | ||
| left operationIndex operation offset | | ||
left := self matchSize - 16r10000 clampLow: 0. | ||
self matchSize: self matchSize - left. | ||
self skipSlotForOperation. | ||
operationIndex := self output size. | ||
operation := 16r80. | ||
offset := self matchIndex - 1. | ||
(offset bitAnd: 16r000000ff) > 0 ifTrue: [operation := operation bitOr: 16r01. self write: (offset"bitShift: 0")]. | ||
(offset bitAnd: 16r0000ff00) > 0 ifTrue: [operation := operation bitOr: 16r02. self write: (offset bitShift: -8)]. | ||
(offset bitAnd: 16r00ff0000) > 0 ifTrue: [operation := operation bitOr: 16r04. self write: (offset bitShift: -16)]. | ||
(offset bitAnd: 16rff000000) > 0 ifTrue: [operation := operation bitOr: 16r08. self write: (offset bitShift: -24)]. | ||
(self matchSize bitAnd: 16r00ff) > 0 ifTrue: [operation := operation bitOr: 16r10. self write: (self matchSize"bitShift: 0")]. | ||
(self matchSize bitAnd: 16rff00) > 0 ifTrue: [operation := operation bitOr: 16r20. self write: (self matchSize bitShift: -8)]. | ||
self output at: operationIndex put: operation. | ||
|
||
self targetIndex: self targetIndex + self matchSize. | ||
self matchIndex: self matchIndex + self matchSize. | ||
self matchSize: left. | ||
self matchIndex - 1 > 16rffffffff ifTrue: [self matchSize: 0]. |
4 changes: 4 additions & 0 deletions
4
src/FileSystem-Git.package/GitDeltaCreator.class/instance/writeInsertion.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
as yet unclassified | ||
writeInsertion | ||
self write: self read. | ||
self insertionCount: self insertionCount + 1. |
4 changes: 4 additions & 0 deletions
4
src/FileSystem-Git.package/GitDeltaCreator.class/instance/writeInsertionCount.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
as yet unclassified | ||
writeInsertionCount | ||
self output at: self output size - self insertionCount put: self insertionCount. | ||
self insertionCount: 0. |
8 changes: 8 additions & 0 deletions
8
...m-Git.package/GitDeltaCreator.class/instance/writeInsertionsWhileInitializingHashValue.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
as yet unclassified | ||
writeInsertionsWhileInitializingHashValue | ||
self skipSlotForInsertionCount. | ||
self hasher class window timesRepeat: [ | ||
self isAtEnd ifTrue: [^ self]. | ||
self writeInsertion. | ||
self hasher addFirstWindowValueAt: self targetIndex. | ||
self targetIndex: self targetIndex + 1]. |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/writeSourceSize.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
writeSourceSize | ||
self writeVariableSizeInteger: self source size. |
3 changes: 3 additions & 0 deletions
3
src/FileSystem-Git.package/GitDeltaCreator.class/instance/writeTargetSize.st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
writeTargetSize | ||
self writeVariableSizeInteger: self target size. |
8 changes: 8 additions & 0 deletions
8
src/FileSystem-Git.package/GitDeltaCreator.class/instance/writeVariableSizeInteger..st
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
as yet unclassified | ||
writeVariableSizeInteger: anInteger | ||
| left | | ||
left := anInteger. | ||
[left >= 16r80] whileTrue: [ | ||
self write: (left bitOr: 16r80). | ||
left := left bitShift: -7]. | ||
self write: left. |
Oops, something went wrong.