Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
13b8ccb
Initial dirty version of push v2
MarcelGeo Aug 8, 2025
216c3bd
tweak _do_upload running outside of class to prevent threads mix
MarcelGeo Aug 8, 2025
57c6bf4
add local changes
MarcelGeo Aug 14, 2025
88f00ea
make tests runnable with checking current version - Please update you…
MarcelGeo Aug 14, 2025
a2cfe62
Cleanup and fix getting diff from dictionary to be more safe
MarcelGeo Aug 14, 2025
054a818
fixes for missing schema
MarcelGeo Aug 15, 2025
7ba0971
cleanup
MarcelGeo Aug 15, 2025
42c34a2
Retry sync job using
MarcelGeo Aug 19, 2025
0128a06
Address comstic comments from @varmar05 and some from @wonder-sk
MarcelGeo Sep 3, 2025
df88376
fix uploading 0 size files
MarcelGeo Sep 3, 2025
28aa757
handle project info directly from v2 projects versions
MarcelGeo Sep 3, 2025
efd7ed6
Add unit tests and tunning of retry mechanism
MarcelGeo Sep 3, 2025
29292da
Update test calling count measurement
MarcelGeo Sep 5, 2025
c6dafca
add test also for v1
MarcelGeo Sep 5, 2025
e54bde8
Drop versions and permissions check
MarcelGeo Sep 9, 2025
57e854b
get rid of project info from editor
MarcelGeo Sep 9, 2025
747ea46
black
MarcelGeo Sep 9, 2025
39cea8b
Merge remote-tracking branch 'origin/master' into push-v2-integration
MarcelGeo Sep 10, 2025
b6cfa3e
temp_dir fix
MarcelGeo Sep 10, 2025
a045095
add max of 100 files
MarcelGeo Sep 11, 2025
50b6224
black
MarcelGeo Sep 11, 2025
0fc2a9e
Find just one file over limit in transaction
MarcelGeo Sep 12, 2025
607e148
black swan
MarcelGeo Sep 12, 2025
77b82e9
Close connection to make runnable test in new python and skip test fo…
MarcelGeo Sep 12, 2025
85387a5
Merge remote-tracking branch 'origin/push-v2-integration' into change…
MarcelGeo Sep 15, 2025
3041e75
Move validation to post_init
MarcelGeo Sep 16, 2025
350aedc
get rid of glob.glob
MarcelGeo Sep 16, 2025
e36ae8d
address comments without progress bar @wonder-sk
MarcelGeo Sep 17, 2025
0119b7d
First version for sync progress bar
MarcelGeo Sep 18, 2025
cf232a6
Merge remote-tracking branch 'origin/push-v2-integration' into change…
MarcelGeo Sep 18, 2025
7dbed14
fix typo and some docstrings for localProjectChanges
MarcelGeo Sep 18, 2025
92d5340
Merge remote-tracking branch 'origin/push-v2-integration' into change…
MarcelGeo Sep 18, 2025
0b585ee
move file size to consts
MarcelGeo Sep 18, 2025
2e38b84
create generator yielding function for sync project
MarcelGeo Sep 18, 2025
3d00631
Introduce generator for getting progress
MarcelGeo Sep 18, 2025
4fc877c
Merge remote-tracking branch 'origin/push-v2-integration' into change…
MarcelGeo Sep 18, 2025
7440f3f
Update docstring for sync method
MarcelGeo Sep 18, 2025
cac700e
Merge pull request #274 from MerginMaps/changes_limits
MarcelGeo Sep 24, 2025
06e815e
Reloading MerginProject instance to get fresh changes
MarcelGeo Sep 25, 2025
9486830
Cosmetic upgrades v1
MarcelGeo Sep 25, 2025
0f5e7f3
move variable to common
MarcelGeo Oct 30, 2025
c0ac231
Merge remote-tracking branch 'origin/master' into push-v2-integration
MarcelGeo Oct 30, 2025
1394c94
Some refactor on loggin changes
MarcelGeo Oct 30, 2025
f94279d
fix tests for logging
MarcelGeo Oct 30, 2025
0fb66b4
mock properly v1 as tests are hooked to v1
MarcelGeo Oct 30, 2025
fe773f4
fix text in logging test
MarcelGeo Oct 30, 2025
5cea584
Minor test upgrade to accept v2
MarcelGeo Oct 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleanup and fix getting diff from dictionary to be more safe
  • Loading branch information
MarcelGeo committed Aug 14, 2025
commit a2cfe62c0449feb80c9f50fa9f14da51814ac8ab
2 changes: 1 addition & 1 deletion mergin/local_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class BaseLocalChange:
class LocalChange(BaseLocalChange):
origin_checksum: Optional[str] = None
chunks: List[str] = field(default_factory=list)
diff: dict = field(default_factory=dict) # Assuming diff is a dict with relevant data
diff: Optional[dict] = None
upload_file: Optional[str] = None

def get_diff(self) -> Optional[BaseLocalChange]:
Expand Down
6 changes: 3 additions & 3 deletions mergin/merginproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ def get_push_changes(self):
diff_id = str(uuid.uuid4())
diff_name = path + "-diff-" + diff_id
diff_file = self.fpath_meta(diff_name)
print(f"Creating changeset for {path} - {diff_name}")
try:
self.geodiff.create_changeset(origin_file, current_file, diff_file)
if self.geodiff.has_changes(diff_file):
Expand Down Expand Up @@ -704,13 +703,14 @@ def apply_push_changes(self, changes):
self.geodiff.make_copy_sqlite(self.fpath(path), basefile)
elif k == "updated":
# in case for geopackage cannot be created diff (e.g. forced update with committed changes from wal file)
if "diff" not in item:
diff = item.get("diff")
if not diff:
self.log.info("updating basefile (copy) for: " + path)
self.geodiff.make_copy_sqlite(self.fpath(path), basefile)
else:
self.log.info("updating basefile (diff) for: " + path)
# better to apply diff to previous basefile to avoid issues with geodiff tmp files
changeset = self.fpath_meta(item["diff"]["path"])
changeset = self.fpath_meta(diff["path"])
patch_error = self.apply_diffs(basefile, [changeset])
if patch_error:
# in case of local sync issues it is safier to remove basefile, next time it will be downloaded from server
Expand Down
Loading