AseptSoft Core Documentation
Breadcrumbs

Merging

Merging allows you to bring changes from any other module, template, or commit into your current module. AseptSoft uses a three-way merge algorithm that compares the source, destination, and their last common ancestor to detect and resolve conflicts intelligently.

Related: 🌿 Commits and Branches · 📁 File System · 🗂️ Version Control


📥 Update From... Workflow

To merge changes into the active module:

1. Open the merge dialog — select Update from... in the module's context menu.

2. Select the data source. Refer to the File System to locate your source:

Source Type

Description

Another module

From the same branch, a different branch, or even a different project

A commit

Any commit belonging to any module of any branch or project

A template

Saved at the templates root or any other location on disk

3. Resolve conflicts (if any). See the Conflict Resolution section below.

4. Press Commit to apply the merge.

5. Review the update log. A detailed log of all operations is shown and also written to disk (see File System).


🧮 Three-Way Merge Algorithm

AseptSoft compares three database snapshots — source (incoming), destination (current), and parent (last common ancestor) — to determine the correct action for every entity:

Source

Destination

Parent

Action

Present

Absent

Absent

Insert into destination

Present

Absent

Present

Source was modified, destination deleted — conflict

Present

Present

Present

Compare both against parent — conflict only if both sides changed differently

Present

Present

Absent

Compare directly — conflict if different

Absent

Present

Present

Source deleted the entity — delete from destination

Absent

Absent

Present

Both deleted — no action

Note: Certain properties are excluded from comparison during merge — date edited, date created, author, version, and graph visualization position are treated as untracked fields and never trigger conflicts.


⚠️ Conflict Types

When the algorithm detects incompatible changes, conflicts are grouped into two categories:

🔁 Duplicate ID Conflicts

The same entity (by ID) exists in both source and destination but has been modified differently from the common parent. For example, a Process renamed to "CIP" in the source and "SIP" in the destination.

🔑 Unique Property Violation Conflicts

After applying all changes, some entities would violate uniqueness constraints. AseptSoft enforces unique property rules across:

Constraint

Example

Entity name within its collection

Two Processes both named "CIP"

Step index within a Process

Two Steps with the same sequential index

AutoCAD Shape ID within a collection

Two Valves referencing the same CAD object


🤝 Conflict Resolution

When conflicts are detected, the merge dialog presents each conflict with a resolution choice:

Strategy

Behavior

Take from Source

Accept the incoming change, discard the local version

Take from Destination

Keep the local version, discard the incoming change

Default: By default, Take from Source is pre-selected for all conflicts — meaning incoming changes are prioritized unless you explicitly choose to keep local values.

For P&ID-level entity conflicts (Valves, Block Valves), an additional option is available:

Strategy

Behavior

Keep both changes

Retain both entities (one will be automatically renamed to avoid constraint violations)

Keep incoming changes

Remove the destination entity, keep the source version

Keep current changes

Remove the source entity, keep the local version

🔗 ID Remapping

When conflicts are resolved by choosing one side, all cross-references throughout the database are automatically updated. AseptSoft uses an optimized string-matching algorithm to replace embedded entity IDs in a single pass, ensuring referential integrity is maintained even for IDs embedded inside text properties (such as fluid response expressions).

🔁 Iterative Resolution

After applying conflict resolutions and remapping IDs, the algorithm re-checks for new conflicts that may have been introduced by the remapping. This process repeats until no conflicts remain, then the merge is committed.


🏭 Pharma Example: Merging a CIP Optimization Branch Back into Main

Your team has been working on a CIP (Clean-in-Place) skid project. The lead engineer maintained the baseline process on the main branch, while a process optimization engineer created a "CIP Optimization" branch (see Commits and Branches) to reduce water consumption.

Now that the optimization has been reviewed and approved in a Review Session, it is time to merge the changes back into the main branch.

📖 How To: Merge an Optimization Branch into Main

  1. Switch to the main branch — open the module on the main branch that should receive the optimized process

  2. Right-click the module → select Update from...

  3. Select the source — navigate to the "CIP Optimization" branch and select the corresponding module

  4. Review the merge preview — AseptSoft shows what will be inserted, updated, or deleted

  5. Resolve any conflicts — for example, if the lead engineer renamed the pre-rinse step to "Initial Rinse" while the optimization engineer renamed it to "Water Recovery Rinse", the merge dialog will show this conflict:

    • Choose Keep incoming changes to accept the optimization engineer's name

    • Choose Keep current changes to keep the lead engineer's name

    • For valve conflicts, choose Keep both changes to retain both configurations side by side

  6. Press Commit to finalize the merge

  7. Review the update log to verify all changes were applied correctly

Tip: After merging, create a commit named "Merged CIP Optimization — Reduced Water Consumption" to preserve this milestone for traceability and regulatory documentation.


📊 Merge Log

Every merge operation produces a detailed log recording each action taken:

Log Entry

Meaning

Insert

New entity added from source

Update

Existing entity updated with source values

Delete

Entity removed (deleted in source)

ID Updated

Cross-reference remapped after conflict resolution

Commit

Merge finalized successfully

Abort

Merge was cancelled or failed

The log converts internal IDs to human-readable names (Process names, Step names, Valve tags, etc.) for easy review. The log file is also saved to disk — see File System for the storage location.


🔄 PID Migration

A specialized merge variant is available for migrating entire PIDs (Process & Instrumentation Diagrams) between modules. The migration workflow includes:

  1. Preflight check — detects potential conflicts before starting:

    • Valve AutoCAD shape ID collisions

    • Block Valve AutoCAD shape ID collisions

    • Review Session name collisions

  2. Conflict resolution — resolve any detected collisions using the P&ID-specific strategies:

    • Keep both changes — retain both entities, auto-rename to avoid violations

    • Keep incoming changes — replace destination with source

    • Keep current changes — discard incoming, preserve local

  3. Entity migration — all entities owned by the source PID are transferred to the destination, with collection ownership references updated automatically

Tip: Review Session name collisions are auto-resolved by appending the source PID name to the conflicting session name.