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

Support rebasing local changes on top of master/incoming changes #6662

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

khanaffan
Copy link
Contributor

@khanaffan khanaffan commented Apr 23, 2024

  1. Move conflict handler to TxnManager. Its only called in case of "Rebase" change integration method as nothing important can be done when we use merge method.
  2. Added following callbacks that allow application to make flexible changes when reapplying local txn when rebasing.
    • _onRebaseBeginLocalTxn()
    • onRebaseEndLocalTxn()
  3. SqliteChangeset allow to open local txn by Id.

imodel-native:iTwin/imodel-native#737


assert.strictEqual(1, getCount(briefcases[3], PhysicalModel.classFullName));
assertTxnStates(txns[3], false, false, false, false, true, "briefcase 3 after pull");
// TODO: "redo possible" should be false, if we try to reinstate, it will crash!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently a bug it seems. "IsRedoPossible" should be false (at least for merge.
Calling ReinstateTxn() after this crashes node.

// [3] model gets unsaved changes
IModelTestUtils.createAndInsertPhysicalPartitionAndModel(briefcases[3], IModelTestUtils.getUniqueModelCode(briefcases[3], "localPhysicalModel"), false);
assertTxnStates(txns[3], true, true, false, false, false, "briefcase 3 with unsaved local changes");
await assertThrowsAsync(async () => briefcases[3].pullChanges(), "cannot processed due to unsaved changes.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be "cannot be processed due to unsaved changes"
I did not find the string both in itwin and imodel-native....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants