-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix up diverging structure in bookmark trees #19
Commits on Jan 18, 2019
-
Configuration menu - View commit details
-
Copy full SHA for b5e38d4 - Browse repository at this point
Copy the full SHA b5e38d4View commit details -
Configuration menu - View commit details
-
Copy full SHA for f844722 - Browse repository at this point
Copy the full SHA f844722View commit details -
Configuration menu - View commit details
-
Copy full SHA for eeaee8f - Browse repository at this point
Copy the full SHA eeaee8fView commit details
Commits on Jan 19, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 615707f - Browse repository at this point
Copy the full SHA 615707fView commit details -
Don't store placeholders for missing children in entries.
Originally, I'd intended for the tree to expose diverging structure to the merger, and for the merger to fix it. That was part of why I split `Item` into `Existing` and `Missing` variants. However, it turns out it's simpler to resolve divergences in the tree, and expose a well-formed structure to the merger instead. Changing `Item` to an enum means we now need a pattern match for _every_ item, when all we really want is a flag on the parent that says "this folder has diverged because it has a missing child". `Entry::divergence` already flags diverging structure for multiple parents, so let's use it to also flag parents with missing children, instead of forcing the merger to handle invalid structure for this one case.
Configuration menu - View commit details
-
Copy full SHA for 8225591 - Browse repository at this point
Copy the full SHA 8225591View commit details -
Refactor and refine the new tree.
* Add missing doc comments. * Rename reparenting methods for clarity. * Move `Tree::{children, parent}_for_entry` to `Node::{children, parent}`. * Remove optional return value from `Node::level`. * Add `Node::is_{root, default_parent_for_orphans}`. * Iterate over `Tree::entries` instead of `Tree::entry_index_by_guid`. The two should point to the same entries, but `entries` is more direct. * Don't mark trees with orphans as equal.
Configuration menu - View commit details
-
Copy full SHA for ea1a022 - Browse repository at this point
Copy the full SHA ea1a022View commit details -
Configuration menu - View commit details
-
Copy full SHA for ed65291 - Browse repository at this point
Copy the full SHA ed65291View commit details -
Configuration menu - View commit details
-
Copy full SHA for d23fd74 - Browse repository at this point
Copy the full SHA d23fd74View commit details -
Configuration menu - View commit details
-
Copy full SHA for 67b6cb7 - Browse repository at this point
Copy the full SHA 67b6cb7View commit details
Commits on Jan 26, 2019
-
Reviews from @thomcc and @mhammond.
* Clarify why `merge::Driver` exists. * Make `Merger` generic over `Driver`, instead of using a trait object. * Use `clone` instead of `to_owned`. * Replace `Entry#is` with `std::ptr::eq`. * Add `MergedNode::remote_guid_changed`.
Configuration menu - View commit details
-
Copy full SHA for a1ba30b - Browse repository at this point
Copy the full SHA a1ba30bView commit details -
Don't store divergence on tree nodes.
In most cases, `node.2 == node.entry().divergence`, except for orphans, default orphans, and diverging `parentid`s. This is a surprising inconsistency that means `node_for_guid` and `children` need to do more work to figure out if the node has actually diverged. This commit: * Changes the tree to flag divergent `parentid`s at `insert` time. * Cleans up `Tree::structure_for_insert`, to clarify what happens when a `parentid` is or isn't provided. * Moves the logic for checking default folder divergences into `Node::diverged`. * Replaces `EntryParents::{indices, guids}` with `EntryParents::iter()`, which doesn't allocate (thanks, @thomcc!).
Configuration menu - View commit details
-
Copy full SHA for b182366 - Browse repository at this point
Copy the full SHA b182366View commit details -
* Clean up optionals with `.map_or(...)` and `.filter(...).map(...)`. * Explain why we use `ptr::eq` to compare entries.
Configuration menu - View commit details
-
Copy full SHA for 25b31ef - Browse repository at this point
Copy the full SHA 25b31efView commit details -
Naming is the hardest problem in computer science.
* Shorten import paths. * Rename `Child::Existing` to `Child::Exists`. * Rename `Divergence::Ok` to `Divergence::Consistent`, since `Ok` might be confused with `Result`.
Configuration menu - View commit details
-
Copy full SHA for 3842b40 - Browse repository at this point
Copy the full SHA 3842b40View commit details
Commits on Jan 29, 2019
-
Include nodes from both sides for each
MergeState
.We need this to apply the merged tree, when we join to the local and remote trees.
Configuration menu - View commit details
-
Copy full SHA for ceb45d6 - Browse repository at this point
Copy the full SHA ceb45d6View commit details -
Refactor error handling in
Store
.* Fix infinite recursion in `fmt::Display::fmt()` for `Error`. * Make `Store` generic over the error type. This allows callers to provide their own error types that unify with Dogear errors, `nsresult`s, and others, instead of requiring them to wrap their errors into `ErrorKind::Storage(...)`. * Forward decoding errors from `Guid::from{utf8, uft16}()`. * Rename `ErrorKind::GenerateGuid` to `ErrorKind::InvalidGuid`. * Move `dogear::merge` into `Store::merge`.
Configuration menu - View commit details
-
Copy full SHA for 07fd161 - Browse repository at this point
Copy the full SHA 07fd161View commit details