From 49e2cf7d29814a8c03291d78e2388deb39d0369f Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Mon, 17 Apr 2023 20:51:54 -0500 Subject: [PATCH] Getting information for repository files. --- repository/Fossil/FossilRepo.class.st | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/repository/Fossil/FossilRepo.class.st b/repository/Fossil/FossilRepo.class.st index 4fd5fdb..39e2293 100644 --- a/repository/Fossil/FossilRepo.class.st +++ b/repository/Fossil/FossilRepo.class.st @@ -235,6 +235,12 @@ FossilRepo >> fetchPage: pageName [ ^ NeoJSONReader fromString: (self jsonWikiDataFor: 'get/', pageName) ] +{ #category : #accessing } +FossilRepo >> firstCheckinFor: testRepoFile [ + "Checkins are in reverse order" + ^ (self checkinsFor: testRepoFile) last +] + { #category : #accessing } FossilRepo >> fossilUv: anArgument and: aSecondArgument [ @@ -318,7 +324,7 @@ FossilRepo >> jsonDataFor: anUrlSegment [ { #category : #querying } FossilRepo >> jsonStringFor: aFileName [ | baseUrl queryForJSONData | - baseUrl := self remote addPathSegments: #('json' 'finfo'). + baseUrl := self remote copy addPathSegments: #('json' 'finfo'). queryForJSONData := baseUrl queryAt: 'name' put: aFileName. ^ (ZnEasy get: queryForJSONData) contents. ] @@ -441,6 +447,13 @@ FossilRepo >> pageList [ ^ NeoJSONReader fromString: (self jsonWikiDataFor: 'list') ] +{ #category : #accessing } +FossilRepo >> printOn: aStream [ + super initialize. + aStream + nextPutAll: 'Repository: ', self remote asString +] + { #category : #authentication } FossilRepo >> rawCapabilities [ ^ NeoJSONReader fromString: (self jsonDataFor: 'cap') @@ -449,7 +462,9 @@ FossilRepo >> rawCapabilities [ { #category : #accessing } 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 } @@ -582,6 +597,11 @@ FossilRepo >> update [ ^ self command: 'update' ] +{ #category : #accessing } +FossilRepo >> uuidFor: relativeFilePath [ + ^ (self firstCheckinFor: relativeFilePath) at: 'uuid' +] + { #category : #authentication } FossilRepo >> whoAmI [ ^ NeoJSONReader fromString: (self jsonDataFor: 'whoami')