From 6e126632565d38e69d91a13be2f8aaa96bf473d2 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Fri, 4 Mar 2022 09:35:06 -0500 Subject: [PATCH] Improving status management. --- repository/Fossil/FossilRepo.class.st | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/repository/Fossil/FossilRepo.class.st b/repository/Fossil/FossilRepo.class.st index 206e2a3..0a07efb 100644 --- a/repository/Fossil/FossilRepo.class.st +++ b/repository/Fossil/FossilRepo.class.st @@ -120,10 +120,10 @@ FossilRepo >> checkinsFor: relativeFilePath [ { #category : #accessing } FossilRepo >> checkoutDateAndTime [ - | date time dateTime splitedCheckout | - splitedCheckout := (self status lines detect: [ :line | line beginsWith: 'checkout:' ])splitOn: ' '. - date := splitedCheckout at: 7. - time := splitedCheckout at: 8. + | date time splitedCheckout | + splitedCheckout := (self status at: 'checkout') splitOn: ' '. + date := splitedCheckout at: 2. + time := splitedCheckout at: 3. ^ (date, time) asZTimestamp ] @@ -328,7 +328,7 @@ FossilRepo >> local: aLocalFilePath [ FossilRepo >> localRoot [ local ifNotNil: [ ^ self local fullName ]. - ^((self status lines detect: [ :line | line beginsWith: 'local-root:' ]) splitOn: ':') second trimmed + ^ self status at: 'local-root:' ] { #category : #authentication } @@ -392,9 +392,7 @@ FossilRepo >> repository [ repository ifNotNil: [ ^ repository ]. self isOpen ifFalse: [ ^ nil ]. - ^ repository := ((self status lines detect: - [ :line | line beginsWith: 'repository:' ]) - splitOn: ':') second trimmed. + ^ repository := self status at: 'repository'. ] { #category : #accessing } @@ -415,8 +413,15 @@ FossilRepo >> sanitize: aFileNameWithRelativePath [ { #category : #accessing } FossilRepo >> status [ - - ^ self command: 'status' + | output | + output := OrderedDictionary new. + (self command: 'status') linesDo: [ :line | |k v temp| + temp := line splitOn: ': '. + k := temp first. + v := temp second trimmed. + output at: k put: v. + ]. + ^ output ] { #category : #accessing }