Querying commits in the TimeLine.
This commit is contained in:
parent
0f89cdab5c
commit
04cb54214c
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user