File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -416,8 +416,19 @@ def apply_push_changes(self, changes):
416
416
move_file (self .fpath_meta (item ["path" ]), basefile )
417
417
elif k == 'removed' :
418
418
os .remove (basefile )
419
- else :
419
+ elif k == 'added' :
420
420
shutil .copy (self .fpath (path ), basefile )
421
+ elif k == 'updated' :
422
+ # better to apply diff to previous basefile to avoid issues with geodiff tmp files
423
+ changeset = self .fpath_meta (item ['diff' ]['path' ])
424
+ patchedfile = self .apply_diffs (basefile , [changeset ])
425
+ if patchedfile :
426
+ move_file (patchedfile , basefile )
427
+ else :
428
+ # in case of local sync issues it is safier to remove basefile, next time it will be downloaded from server
429
+ os .remove (basefile )
430
+ else :
431
+ pass
421
432
422
433
def backup_file (self , file ):
423
434
"""
You can’t perform that action at this time.
0 commit comments