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):
416416 move_file (self .fpath_meta (item ["path" ]), basefile )
417417 elif k == 'removed' :
418418 os .remove (basefile )
419- else :
419+ elif k == 'added' :
420420 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
421432
422433 def backup_file (self , file ):
423434 """
You can’t perform that action at this time.
0 commit comments