Skip to main content

merge

Overview of merging with #NDMerge Indicates the merge target and contents of NDMerge.

Merge branches

  • NDMerge merges the data of the current branch (own) with the data of the next design of the specified other branch (other).
    • Instead of merging text differences like the standard Git merge behavior, the data for each Next Design file is built in memory and the differences are merged for each model.
      • Corresponds to the following files of Next Design, and builds data for each file.
        • JSON format file
          • nproj
          • nprof
          • nmdl
        • DB format file
          • iproj
          • iprof
          • imdl
    • For example, build and merge the data for the model A.nmdl in the current branch (own) and the model A.nmdl in the specified other branch (other). The data in other model files has no effect on the merge of model A.nmdl.

Summary of merge by element

NDMerge treats model-based changes as differences, rather than treating common text line-by-line changes. The result of the merge will be reflected in the Next Design file. If there is a conflict, an error will occur and it will not be possible to merge.

Model merge

  • If there is no conflict on the model between the current branch (own) and the specified other branch (other), you can merge field values, model additions/deletions, etc.

  • Merge example

    • The model data for each branch is shown below.

      //Example of base model
      {
      "Metamodel": "Use case",
      "Fields": {
      "Name": "Following (ADAPTIVE)",
      "Description": "Driving while maintaining the distance from the preceding vehicle.",,
      "Scenarios $ Embed": []
      }
      }
      //Example of the current branch (own) model
      {
      "Metamodel": "Use case",
      "Fields": {
      "Name": "ADAPTIVE-DRIVE", //Change the value of Name
      "Description": "Driving while maintaining the distance from the preceding vehicle.",,
      "Scenarios $ Embed": [//Add one scenario
      {
      "Metamodel": "Scenario",
      "Fields": {
      "Name": "Basic flow",}
      }]]
      }
      }
      //Example of the model of the specified other branch (other)
      {
      "Metamodel": "Use case",
      "Fields": {
      "Name": "Following (ADAPTIVE)",
      "Description": "Driving while maintaining the distance from the preceding vehicle. If there is no preceding vehicle, it will be a constant speed driving.", //Change the value of Description
      "Scenarios $ Embed": [//Add one scenario
      {
      "Metamodel": "Scenario",
      "Fields": {
      "Name": "Exception flow (E1)",}
      }]]
      }
      }
    • Since the above changes of own and other do not conflict, the merge result will be as follows. In particular, adding elements to the Scenarios field is treated logically and merges both own and other changes.

        //Example model after merging
      {
      "Metamodel": "Use case",
      "Fields": {
      "Name": "ADAPTIVE-DRIVE", //Merge own values
      "Description": "Driving while maintaining the distance from the preceding vehicle. If there is no preceding vehicle, it will be constant speed driving.", //Merge the values of other
      "Scenarios $ Embed": [//Merge both own and other
      {
      "Metamodel": "Scenario",
      "Fields": {
      "Name": "Basic flow",}
      }
      {
      "Metamodel": "Scenario",
      "Fields": {
      "Name": "Exception flow (E1)",}
      }]]
      }
      }

Merge display information

  • Styles such as diagram shape position and size, background color and font are merged in preference to the current branch (own).
    • Even if the display information is changed in the current branch (own) and another branch (other) specified, the change of the current branch (own) is adopted without displaying it as a conflict.
    • If a branch that gives priority to merging is specified as an option, the value of that branch will be adopted.

Profile merge

  • If there is a profile change in the current branch (own) and the specified other branch (other), it cannot be merged and will be detected as a conflict.
    • If there is any one or more changes in the metamodel or view definition, it is considered to have changed.

Project merge

  • If there is no conflict of project information between the current branch (own) and the specified other branch (other), it can be merged.