From 0b6891ec4a53817b825c557f374cce62bbd79128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Mon, 16 Oct 2023 21:10:45 +0200 Subject: Storage: handle BASE/SBASE references as parents --- src/storage.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/storage.cpp') diff --git a/src/storage.cpp b/src/storage.cpp index 4e56b2e..366fe71 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -1032,12 +1032,19 @@ vector Ref::previous() const return {}; if (auto sdata = rec->item("SDATA").asRef()) { - if (auto drec = sdata.value()->asRecord()) - return drec->items("SPREV").asRef(); + if (auto drec = sdata.value()->asRecord()) { + auto res = drec->items("SPREV").asRef(); + if (auto base = drec->item("SBASE").asRef()) + res.push_back(*base); + return res; + } return {}; } - return rec->items("PREV").asRef(); + auto res = rec->items("PREV").asRef(); + if (auto base = rec->item("BASE").asRef()) + res.push_back(*base); + return res; } Generation Ref::generation() const -- cgit v1.2.3