Skip to content

Commit

Permalink
Merge pull request #1341 from akgrant43/5578-Iceberg-method-history-s…
Browse files Browse the repository at this point in the history
…hows-only-oldest-commit

5578-Iceberg-method-history-shows-only-oldest-commit
  • Loading branch information
guillep authored Jun 9, 2020
2 parents 1aa2bf3 + 9e5abab commit e2e2370
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Iceberg-Libgit-Filetree/IceLibgitFiletreeLogReader.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Class {
#instVars : [
'fileName'
],
#category : 'Iceberg-Libgit-Filetree'
#category : #'Iceberg-Libgit-Filetree'
}

{ #category : #'instance creation' }
Expand All @@ -30,16 +30,22 @@ IceLibgitFiletreeLogReader >> fileName: aString [

{ #category : #utilities }
IceLibgitFiletreeLogReader >> loadDefinitions [
| entry segments className classIsMeta |
| entry segments className classIsMeta entryPath packageIndex |

definitions := OrderedCollection new.

segments := (self fileName substrings: '/') allButLast asOrderedCollection.
classIsMeta := segments removeLast = 'class'.
className := segments last copyUpToLast: $..

"entryPath is the relative path from the package to the method being loaded"
packageIndex := segments indexOf: packageDirectory filename.
entryPath := packageIndex > 0 ifTrue:
[ entryPath := $/ join: (segments copyFrom: 1 to: packageIndex).
self fileName allButFirst: entryPath size ]
ifFalse:
[ self fileName allButFirst: packageDirectory filename size ].
entry := (packageDirectory
entryByPath: (self fileName allButFirst: packageDirectory filename size)
entryByPath: entryPath
ifAbsent: [ ^ nil ]).
entry readStreamDo: [ :fileStream |
| category source timestamp selector |
Expand Down

0 comments on commit e2e2370

Please sign in to comment.