Skip to content

Commit

Permalink
Merge branch 'master' into faster-diff-5
Browse files Browse the repository at this point in the history
  • Loading branch information
craigds committed Jan 8, 2025
2 parents 29a8a87 + 115c585 commit 8c8dc4f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ _When adding new entries to the changelog, please include issue/PR numbers where
## Unreleased

- diff: Much faster and much lower memory usage when using `--no-sort-keys` [#1032](https://github.com/koordinates/kart/pull/1032)
- diff: Fix an error when diffing a commit against the working copy, where a dataset has been deleted since the commit. [#1033](https://github.com/koordinates/kart/issues/1033)

## 0.16.0

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ endif()

project(
kart
VERSION 0.16.0
VERSION 0.16.1
DESCRIPTION "Version control for geospatial data"
HOMEPAGE_URL "https://kartproject.org"
LANGUAGES C CXX)
Expand Down
2 changes: 1 addition & 1 deletion kart/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.16.0
0.16.1.dev0
6 changes: 3 additions & 3 deletions kart/diff_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ def get_dataset_diff(

if include_wc_diff:
# diff += target_ds<>working_copy
if workdir_diff_cache is None:
workdir_diff_cache = target_ds.repo.working_copy.workdir_diff_cache()

# note: target_ds may be None if the dataset as deleted between the base & target commits
if target_ds is not None:
if workdir_diff_cache is None:
workdir_diff_cache = target_ds.repo.working_copy.workdir_diff_cache()
target_wc_diff = target_ds.diff_to_working_copy(
workdir_diff_cache,
ds_filter=ds_filter,
Expand Down
2 changes: 1 addition & 1 deletion requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ idna==3.7
# via requests
imagesize==1.4.1
# via sphinx
jinja2==3.1.4
jinja2==3.1.5
# via sphinx
livereload==2.6.3
# via sphinx-autobuild
Expand Down
16 changes: 16 additions & 0 deletions tests/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,22 @@ def _extract(diff_json):
}


def test_diff_rev_wc_with_deleted_dataset(data_working_copy, cli_runner):
"""
Diff the working copy against a commit, where a dataset has been deleted since the commit
"""

with data_working_copy("points") as (repo_path, wc):
r = cli_runner.invoke(
["data", "rm", "nz_pa_points_topo_150k", "--message=destroy"]
)
assert r.exit_code == 0, r.stderr

r = cli_runner.invoke(["diff", "HEAD^"])
assert r.exit_code == 0, r.stderr
assert "--- nz_pa_points_topo_150k:meta:schema.json" in r.stdout


@pytest.mark.parametrize("output_format", ["text", "json"])
def test_3d_diff_wc(data_archive, cli_runner, tmp_path, output_format):
with data_archive("gpkg-3d-points") as src:
Expand Down

0 comments on commit 8c8dc4f

Please sign in to comment.