Improving and creating synchronize methods for fossil repos.

This commit is contained in:
ruidajo 2022-03-11 08:50:20 -05:00
parent 57401052b4
commit f44e2dfece

View File

@ -30,6 +30,23 @@ TiddlyWiki class >> fromJSONUrl: anUrlString [
name: anUrlString name: anUrlString
] ]
{ #category : #accessing }
TiddlyWiki >> addRecentChangesToRepo [
| docsSton docsStonSanitized recentTiddlers repository |
repository := self repository.
self
exportJSONFile;
importJSONFile.
recentTiddlers := self changesAfter: repository checkoutDateAndTime.
docsSton := recentTiddlers collect: [:each | each exportSTONFile].
"Collecting tiddlers file reference as string and adding to the repo"
docsStonSanitized := docsSton collect: [ :each |
(each fullName removePrefix: repository localRoot) allButFirst ].
docsStonSanitized do: [ :each | repository add: each ].
^ repository status
]
{ #category : #accessing } { #category : #accessing }
TiddlyWiki >> addToConfigFile [ TiddlyWiki >> addToConfigFile [
| cleaned newConfig | | cleaned newConfig |
@ -489,17 +506,15 @@ TiddlyWiki >> repository [
{ #category : #accessing } { #category : #accessing }
TiddlyWiki >> resynchronize [ TiddlyWiki >> resynchronize [
| repository | | repository return |
self
exportJSONFile;
importJSONFile.
repository := self repository. repository := self repository.
repository update. repository update.
return := Dictionary new
at: 'status' put: self addRecentChangesToRepo.
self exportSTONFiles.
self exportContentTiddlers. self exportContentTiddlers.
self exportLargeTiddlers. self exportLargeTiddlers.
repository addRecentChangesFromWiki: self. ^ return
^ Dictionary new
at: 'status' put: repository status;
at: 'file' put: self rebuildTiddlersJSON; at: 'file' put: self rebuildTiddlersJSON;
yourself. yourself.
] ]
@ -520,6 +535,26 @@ TiddlyWiki >> shadow [
^ self tiddlers select: [:tiddler | tiddler title beginsWith: '$:/'] ^ self tiddlers select: [:tiddler | tiddler title beginsWith: '$:/']
] ]
{ #category : #accessing }
TiddlyWiki >> syncRemoteLocalDestructive [
| repository |
repository := self repository.
repository update.
repository revertRemoteUnversioned.
repository exportHTMLUnversioned.
self
exportJSONFile;
importJSONFile.
self exportSTONFiles.
self exportContentTiddlers.
self exportLargeTiddlers.
^ Dictionary new
at: 'status' put: repository status;
at: 'tiddlers from STON' put: self rebuildTiddlers;
yourself.
]
{ #category : #accessing } { #category : #accessing }
TiddlyWiki >> taggedWith: aTag [ TiddlyWiki >> taggedWith: aTag [
^ self tiddlers select: [:tiddler | ^ self tiddlers select: [:tiddler |