13.7. Working Offline

You can work in your shared medini analyze projects offline. This is convenient when you are not connected to a server. When you are connected to the server again, you can push your changes to the server, and pull any updates from it.

When executing a push or pull, medini analyze performs a three-way diff between the server project, offline project, and the baseline.

  • For a push, the baseline is always your last save of the offline project and the associated changes.

  • For a pull, the baseline is the state of the server project at the previous pull. If no changes have been merged yet, the baseline is the server project state when you first created the offline project.

13.7.1. Creating an Offline Project

To create an offline project, complete these steps.

  1. Log in to the server and open a project in the Model Browser.

  2. Right-click the project and select Create Offline Copy....

    Ansys medini analyze creates an offline copy in the workspace. Project appears with an "offline copy" decorator. Note that the project is also marked with a "sync" overlay.

You can now begin working in your offline project.

13.7.2. Pushing Changes to the Server

After you have made some changes in the offline project, you can push them to the project version on the server.

To push your changes to the server:

  1. In your offline project, save the changes you made.

  2. Right-click your offline project and select Push Changes to Server....

A dialog informs you that changes are being integrated and then merged. If there are no conflicts, the server is updated and the dialog closes. The change appears in the server version of your project (which is the version you created the offline copy from). You can undo the push by clicking Ctrl+Z, and redo with Ctrl+Y.

If no changes are found, a dialog informs you of this.

Note that if the server project is locked by another user for exclusive editing, you will not be able to push until the user releases the lock.

13.7.3. Pulling Changes from the Server

When changes have been made to the version of the project on the server, you can merge them into your offline project.

To pull changes from the server into your offline project:

  • Right-click your offline project and select Pull Changes from Server....

A dialog informs you that changes are being integrated and then merged. If there are no conflicts, the offline project is updated and the dialog closes. The change from the server project appears in your offline project. You can undo the pull by clicking Ctrl+Z, and redo with Ctrl+Y.

If no changes are found, a dialog informs you of this.

13.7.4. Cherry-Picking Changes

You can compare an offline project with the shared project it is associated with, and then cherry-pick the changes you want to push or pull from the server.

When you cherry-pick, the latest baseline pull (in your workspace) is the baseline project for the three-way comparison or merge. If the baseline is missing, the merge is handled the same way as it is normally handled for pushing changes or pulling changes. For more information, see Comparison of projects.

The following table shows which project is the source and which is the target for the cherry-pick, depending on the scenario.

Table 13.1:

Merge commandMerge sourceMerge target
Changes from serverShared projectOffline copy of project
Changes to serverOffline copy of projectShared

To use the cherry-pick functionality, complete these steps:

  1. In the medini analyze Model Browser, make sure the offline project is loaded.

    If the original shared project is not loaded, medini analyze loads it for you. Note that if the shared project is locked by another user, no merges or reverts can be completed to the shared project until you have the lock.

  2. To pull changes from the server:

    • Select the offline version of the project and from the context menu select Cherry-Pick > Pull Changes from Server...

    To push changes to the server:

    • Select the offline version of the project and from the context menu select Cherry-Pick > Push Changes to Server...

In the Difference Browser, you can now select the items that were added, modified, or removed in the source or target (displayed with the corresponding overlay). Right-click an item and select the merge or revert action you want.

13.7.5. Resolving Merge Conflicts

When you make changes in an offline project while another user is making changes in the server project, a push or pull can result in a merge conflict. You can resolve merge conflicts using medini analyze's conflict resolution tools.

If there is a merge conflict during a push or pull, medini analyze puts you in the "Conflict Resolution" view. The Merge Done and Abort buttons appear.

  • Clicking the Merge Done button keeps non-conflicting changes and rejects conflicting changes. This process keeps the target version of the conflicting changes. After you have rejected conflicting changes, they will not appear the next time you run this same process (push or pull). They will appear once more when you execute the opposite process.

  • Clicking the Abort button rolls back all changes to before the pull or push.


Important:  If you leave the Conflict Resolution view without clicking the Merge Done or the Abort button, and you continue working in the Model Browser, you risk losing the changes you have made in the Conflict Resolution view.


The Difference Browser lists the project elements that are in conflict. Conflicting changes are marked with a red arrow overlay. Non-conflicting changes are marked with a blue arrow overlay. Use the icon menu at the top of the Difference Browser to display the types of changes you want to see. You can also hover over each project element to get a little more information about the conflict.

To merge or revert changes or subtree changes here, right-click the project element and select the action you want to take.

To get more details about the conflict, double-click the item, or right-click and select Show Details. The Difference Details window opens, showing the differences between the target and the source. The Difference Details window shows the conflict details for all types of project elements except external documents.


Note:
  • During a push, the target is the server project and the source is the offline project.

  • During a pull, the target is the offline project and the source is the server project.


You can merge or revert individual items by right-clicking in the Name column and selecting either Merge Change(s) or Revert Change(s).

To compare the projects, you can switch between the Conflict Resolution view and Analysis view by clicking the Compare/Merge button Analysis button. Remember that if you make changes in the Model Browser without clicking either the Merge Done or the Abort button, you risk losing the changes you made in the Conflict Resolution view.

For more details about how medini analyze handles diff-merge, see Diff/Merge Handling

13.7.6. Deleting Offline Projects

When you are done working in your offline project and have successfully pushed all your changes to the server, you can delete the project. Note that the project baseline is managed locally and is deleted together with the project.

To delete your offline project:

  • Right-click in your offline project and select Delete.