add push procedure

This commit is contained in:
grimhilt 2023-06-11 17:58:00 +02:00
parent c4bcebe677
commit b914dde525

View File

@ -1,32 +1,14 @@
## Push
```mermaid
flowchart TD
A[Start] --> G[Get staged objects]
G --> GNO[Get next object]
GNO --> H{Object empty ?}
H --> |No| B{Is a directory ?}
H ----> |Yes| F[End]
B --> |Yes| C[Push Folder]
B --> |No| E[Push File]
C --> GNO
E --> GNO
```
## Pushing a folder
```mermaid
flowchart TD
A[Start] --> B{Is local folder older than the server one ?}
```
## Pushing a file
```mermaid
```
1. Get list of file and folder to push from ``.nextsync/index``
2. For each object in the list:
* If it is a file:
* Check if the file exists on the server
* If a collision occurs, compare the modification date (given by the file blob and the server)
* If it is more recent download the file under with ``.dist`` extension
* Else overwrite the file
* If not collision occurs, upload the file
* If is it a folder:
* If the folder exists on the server apply this procedure for its content
* Else upload it