From 5b92b14500e63c745f25de9a3de96007b87a22a6 Mon Sep 17 00:00:00 2001 From: ruidajo Date: Mon, 12 Dec 2022 10:39:38 -0500 Subject: [PATCH] Creating delete files and improving instance creation and remote. --- repository/Fossil/FossilRepo.class.st | 31 ++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/repository/Fossil/FossilRepo.class.st b/repository/Fossil/FossilRepo.class.st index 5e09989..4fd5fdb 100644 --- a/repository/Fossil/FossilRepo.class.st +++ b/repository/Fossil/FossilRepo.class.st @@ -35,11 +35,15 @@ FossilRepo class >> executable: aPathString [ { #category : #'instance creation' } FossilRepo class >> local: aFilePath repository: aFossilFilePath [ - - ^ self new + + | repo | + repo := self new local: aFilePath; - repository: aFossilFilePath; - yourself + repository: aFossilFilePath. + repo remote = 'off' + ifTrue: [ repo remote: nil ] + ifFalse: [ repo remote: repo remote ]. + ^ repo ] { #category : #accessing } @@ -169,6 +173,19 @@ FossilRepo >> createPage: pageName [ ^ NeoJSONReader fromString: (self jsonWikiDataFor: 'create/', pageName) ] +{ #category : #accessing } +FossilRepo >> delete: fileRelativePath [ + "I delete a file to the working Fossil repository, given that both, the file and the repositor, + share the same root directory/folder." + + OSSUnixSubprocess new + command: self class locateExecutable; + workingDirectory: self localRoot; + arguments: { 'delete' . fileRelativePath }; + redirectStdout; + runAndWaitOnExitDo: [ :process :outString | ^ outString ] +] + { #category : #accessing } FossilRepo >> diff [ @@ -437,7 +454,11 @@ FossilRepo >> remote [ { #category : #accessing } FossilRepo >> remote: anUrlString [ - remote := anUrlString asUrl + + anUrlString + ifNil: [ remote := anUrlString ] + ifNotNil: [ remote := anUrlString asUrl ] + ] { #category : #accessing }