diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2023-10-16 21:10:45 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2023-10-16 21:10:45 +0200 |
commit | 0b6891ec4a53817b825c557f374cce62bbd79128 (patch) | |
tree | bd810cd32c035cc4a66138f87cfd52510ab8a98f /src/storage.cpp | |
parent | 0ef80ef1c9861450cdaf59c0ea405da209995466 (diff) |
Storage: handle BASE/SBASE references as parents
Diffstat (limited to 'src/storage.cpp')
-rw-r--r-- | src/storage.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
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> 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 |