Creating rename functionality and improving status return.

This commit is contained in:
ruidajo 2022-03-12 12:52:36 -05:00
parent 2e5894a780
commit 5dda27cac3

View File

@ -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