Skip to content
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

Keep both local and remote nodes with mismatched kinds #26

Closed
wants to merge 13 commits into from

Commits on Feb 1, 2019

  1. Add MergedNode::descendants().

    This returns an iterator that yields the merged node's descendants, in
    level order.
    linabutler committed Feb 1, 2019
    Configuration menu
    Copy the full SHA
    3252307 View commit details
    Browse the repository at this point in the history
  2. Add {Local, Remote}Only merge states; remove LocalWithNewStructure.

    Before `Unchanged`, `Local` meant "keep local and maybe upload", and
    `LocalWithNewStructure` meant "keep local and always upload". Now
    that `Unchanged` exists, `Local` means "keep local and upload", so
    `LocalWithNewStructure` is redundant.
    
    Further, it wasn't obvious that `Local { remote_node: None }` meant
    the item only exists locally, and should be uploaded unconditionally,
    and `Remote { local_node: None }` meant the item only exists remotely,
    and should be applied unconditionally. This commit changes `Local`
    and `Remote` to mean "exists on both sides, but prefer one", and adds
    `LocalOnly`, `RemoteOnly`, and `RemoteOnlyWithNewStructure` to mean
    "exists on one side, so take unconditionally".
    
    To that end, this commit treats remotely changed user content roots as
    `Unchanged`. As of bug 1432614, roots don't have user-editable titles,
    so applying remote title changes is unnecessary. However, we also don't
    mark the roots as `Local`, because that would mean we'd reupload the
    root _every time_ it was changed remotely.
    
    Finally, we want callers to easily determine whether to apply remote
    changes, and upload local and new changes. This commit adds
    `MergeState::{should_apply, should_upload}()` for that.
    linabutler committed Feb 1, 2019
    Configuration menu
    Copy the full SHA
    16a0cb2 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2019

  1. Configuration menu
    Copy the full SHA
    395b86b View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2019

  1. Configuration menu
    Copy the full SHA
    69c9cd0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1986fed View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2019

  1. Configuration menu
    Copy the full SHA
    c54538b View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2019

  1. Configuration menu
    Copy the full SHA
    30e14a4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5fffe4b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ece9d31 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2019

  1. Configuration menu
    Copy the full SHA
    eeec5ba View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2019

  1. Configuration menu
    Copy the full SHA
    776579c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    91124bf View commit details
    Browse the repository at this point in the history
  3. Keep both local and remote nodes with mismatched kinds.

    For mismatched kinds, we keep both nodes with new GUIDs. This is an
    edge case: Places maintenance on Desktop can change an item's
    kind without changing its GUID, but this should be rare.
    
    In general, we can't meaningfully pick a side when two items have
    different kinds (a bookmark and a folder with children? a bookmark and
    a separator?), so we keep both, with new structure, to avoid possible
    data loss.
    
    See #13.
    linabutler committed Feb 17, 2019
    Configuration menu
    Copy the full SHA
    b2410ff View commit details
    Browse the repository at this point in the history