Getting information for repository files.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-04-17 20:51:54 -05:00
parent a424c855fc
commit 49e2cf7d29

View File

@ -235,6 +235,12 @@ FossilRepo >> fetchPage: pageName [
^ NeoJSONReader fromString: (self jsonWikiDataFor: 'get/', pageName) ^ NeoJSONReader fromString: (self jsonWikiDataFor: 'get/', pageName)
] ]
{ #category : #accessing }
FossilRepo >> firstCheckinFor: testRepoFile [
"Checkins are in reverse order"
^ (self checkinsFor: testRepoFile) last
]
{ #category : #accessing } { #category : #accessing }
FossilRepo >> fossilUv: anArgument and: aSecondArgument [ FossilRepo >> fossilUv: anArgument and: aSecondArgument [
@ -318,7 +324,7 @@ FossilRepo >> jsonDataFor: anUrlSegment [
{ #category : #querying } { #category : #querying }
FossilRepo >> jsonStringFor: aFileName [ FossilRepo >> jsonStringFor: aFileName [
| baseUrl queryForJSONData | | baseUrl queryForJSONData |
baseUrl := self remote addPathSegments: #('json' 'finfo'). baseUrl := self remote copy addPathSegments: #('json' 'finfo').
queryForJSONData := baseUrl queryAt: 'name' put: aFileName. queryForJSONData := baseUrl queryAt: 'name' put: aFileName.
^ (ZnEasy get: queryForJSONData) contents. ^ (ZnEasy get: queryForJSONData) contents.
] ]
@ -441,6 +447,13 @@ FossilRepo >> pageList [
^ NeoJSONReader fromString: (self jsonWikiDataFor: 'list') ^ NeoJSONReader fromString: (self jsonWikiDataFor: 'list')
] ]
{ #category : #accessing }
FossilRepo >> printOn: aStream [
super initialize.
aStream
nextPutAll: 'Repository: ', self remote asString
]
{ #category : #authentication } { #category : #authentication }
FossilRepo >> rawCapabilities [ FossilRepo >> rawCapabilities [
^ NeoJSONReader fromString: (self jsonDataFor: 'cap') ^ NeoJSONReader fromString: (self jsonDataFor: 'cap')
@ -449,7 +462,9 @@ FossilRepo >> rawCapabilities [
{ #category : #accessing } { #category : #accessing }
FossilRepo >> remote [ FossilRepo >> remote [
^ remote := (self command: 'remote') copyWithout: Character lf ^ remote
"TO DEBUG: Capture the context of this assignation without damaging the generaly of the accessor for other cases."
":= (self command: 'remote') copyWithout: Character lf"
] ]
{ #category : #accessing } { #category : #accessing }
@ -582,6 +597,11 @@ FossilRepo >> update [
^ self command: 'update' ^ self command: 'update'
] ]
{ #category : #accessing }
FossilRepo >> uuidFor: relativeFilePath [
^ (self firstCheckinFor: relativeFilePath) at: 'uuid'
]
{ #category : #authentication } { #category : #authentication }
FossilRepo >> whoAmI [ FossilRepo >> whoAmI [
^ NeoJSONReader fromString: (self jsonDataFor: 'whoami') ^ NeoJSONReader fromString: (self jsonDataFor: 'whoami')