Improving status management.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-03-04 09:35:06 -05:00
parent c45692465d
commit 6e12663256

View File

@ -120,10 +120,10 @@ FossilRepo >> checkinsFor: relativeFilePath [
{ #category : #accessing } { #category : #accessing }
FossilRepo >> checkoutDateAndTime [ FossilRepo >> checkoutDateAndTime [
| date time dateTime splitedCheckout | | date time splitedCheckout |
splitedCheckout := (self status lines detect: [ :line | line beginsWith: 'checkout:' ])splitOn: ' '. splitedCheckout := (self status at: 'checkout') splitOn: ' '.
date := splitedCheckout at: 7. date := splitedCheckout at: 2.
time := splitedCheckout at: 8. time := splitedCheckout at: 3.
^ (date, time) asZTimestamp ^ (date, time) asZTimestamp
] ]
@ -328,7 +328,7 @@ FossilRepo >> local: aLocalFilePath [
FossilRepo >> localRoot [ FossilRepo >> localRoot [
local ifNotNil: [ ^ self local fullName ]. local ifNotNil: [ ^ self local fullName ].
^((self status lines detect: [ :line | line beginsWith: 'local-root:' ]) splitOn: ':') second trimmed ^ self status at: 'local-root:'
] ]
{ #category : #authentication } { #category : #authentication }
@ -392,9 +392,7 @@ FossilRepo >> repository [
repository ifNotNil: [ ^ repository ]. repository ifNotNil: [ ^ repository ].
self isOpen ifFalse: [ ^ nil ]. self isOpen ifFalse: [ ^ nil ].
^ repository := ((self status lines detect: ^ repository := self status at: 'repository'.
[ :line | line beginsWith: 'repository:' ])
splitOn: ':') second trimmed.
] ]
{ #category : #accessing } { #category : #accessing }
@ -415,8 +413,15 @@ FossilRepo >> sanitize: aFileNameWithRelativePath [
{ #category : #accessing } { #category : #accessing }
FossilRepo >> status [ FossilRepo >> status [
| output |
^ self command: 'status' 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 } { #category : #accessing }