diff --git a/repository/Fossil/FossilRepo.class.st b/repository/Fossil/FossilRepo.class.st index 3440ed0..23e4887 100644 --- a/repository/Fossil/FossilRepo.class.st +++ b/repository/Fossil/FossilRepo.class.st @@ -47,6 +47,19 @@ FossilRepo >> checkinsFor: relativeFilePath [ ^ payload at: 'checkins' ] +{ #category : #querying } +FossilRepo >> commitsByDate [ + "I present the sum of all commit organized by date." + | result | + result := Dictionary new. + self timeline do: [ :commit | | key | + key := (DateAndTime fromUnixTime: (commit at: 'timestamp' )) asDate. + result at: key + ifPresent: [ result at: key put: (result at: key) + 1 ] + ifAbsent: [ result at: key put: 1 ] ]. + ^ result +] + { #category : #wiki } FossilRepo >> createPage: pageName [ ^ NeoJSONReader fromString: (self jsonWikiDataFor: 'create/', pageName) @@ -133,6 +146,16 @@ FossilRepo >> remote: anUrlString [ remote := anUrlString asUrl ] +{ #category : #accessing } +FossilRepo >> timeline [ + "I return all information of all commits in a repository timeline." + | baseUrl queryForJSONData | + baseUrl := self remote addPathSegments: #('json' 'timeline' 'checkin'). + queryForJSONData := baseUrl queryAt: 'limit' put: 0. + ^ ((NeoJSONReader fromString: (queryForJSONData asUrl retrieveContents)) + at: 'payload') at: 'timeline' +] + { #category : #authentication } FossilRepo >> whoAmI [ ^ NeoJSONReader fromString: (self jsonDataFor: 'whoami')