From 5dda27cac3a8c723784d3e6ec749d069df7bfd5e Mon Sep 17 00:00:00 2001 From: ruidajo Date: Sat, 12 Mar 2022 12:52:36 -0500 Subject: [PATCH] Creating rename functionality and improving status return. --- repository/Fossil/FossilRepo.class.st | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/repository/Fossil/FossilRepo.class.st b/repository/Fossil/FossilRepo.class.st index 345c922..266f5b9 100644 --- a/repository/Fossil/FossilRepo.class.st +++ b/repository/Fossil/FossilRepo.class.st @@ -410,6 +410,18 @@ FossilRepo >> remote: anUrlString [ remote := anUrlString asUrl ] +{ #category : #accessing } +FossilRepo >> rename: oldName newName: newName [ + + OSSUnixSubprocess new + command: 'fossil'; + arguments: { 'rename'. oldName. newName }; + workingDirectory: self localRoot; + redirectStdout; + redirectStderr; + runAndWaitOnExitDo: [ :process :outString | ^ outString ] +] + { #category : #accessing } FossilRepo >> repository [ @@ -448,9 +460,19 @@ FossilRepo >> sanitize: aFileNameWithRelativePath [ { #category : #accessing } FossilRepo >> status [ - | output | + | status output missing edited | + status := self command: 'status'. output := OrderedDictionary new. - (self command: 'status') linesDo: [ :line | | k v temp commitLog | + + edited := status lines select: [ :line | line beginsWith: 'EDITED' ]. + output at: 'edited files' put: (edited collect: + [ :line | (line withoutPrefix: 'EDITED')trimmed ]). + + missing := status lines select: [ :line | line beginsWith: 'MISSING' ]. + output at: 'missing files' put: (missing collect: + [ :line | (line withoutPrefix: 'MISSING')trimmed ]). + + status linesDo: [ :line | | k v temp commitLog | commitLog := OrderedCollection new. temp := line splitOn: ': '. temp size = 2