Main Content

polyspace-project -diff, polyspace-project -merge

(System Command) Compare and merge Polyspace Platform projects before submission to source control

Since R2023b

Description

The polyspace-project -diff, polyspace-project -merge system command allows you to compare and merge Polyspace® Platform projects in a diff/merge tool (or automatically merge projects at the command line).

Compare Projects

polyspace-project -diff latestProject myProject opens a diff/merge tool for comparing the projects latestProject and myProject. The project structure of latestProject appears on the left and that of myProject appears on the right.

example

Merge Projects

polyspace-project -merge latestProject myProject [-target mergedProject] opens a diff/merge tool for comparing and merging the projects latestProject and myProject. The project structure of latestProject appears on the left and that of myProject appears on the right.

example

polyspace-project -merge baseProject latestProject myProject [-target mergedProject] [-auto] opens a diff/merge tool for comparing and merging the projects latestProject and myProject with a base project baseProject. The project structure of latestProject appears on the left with baseProject in the middle and myProject on the right. The option -auto initializes the merged project with the result of an automatic merge (otherwise, the merged project is initialized with myProject).

example

Automatically Merge Projects

polyspace-project -auto-merge baseProject latestProject myProject [-target mergedProject] attempts to automatically merge the projects latestProject and myProject with respect to a base project baseProject.

example

Examples

collapse all

You can compare the structure of two Polyspace Platform projects in the user interface of a diff/merge tool.

To open the diff/merge tool for comparing two projects, use the -diff option with the polyspace-project command.

polyspace-project -diff latestProject.psprjx myProject.psprjx

You can merge the structure of two Polyspace Platform projects in the user interface of a diff/merge tool.

To merge two projects, use the -merge option with the polyspace-project command.

polyspace-project -merge latestProject.psprjx myProject.psprjx

You can also perform a three-way merge, where you open three projects in the diff/merge tool: your version of the project, the latest version, and the base version of the project that you later modified.

Instead of merging projects manually, you can attempt to automatically merge your version of a project with the latest version of the project in a repository. For automatic merge, you must specify a base project.

To automatically merge two projects, use the -auto-merge option with the polyspace-project command.

polyspace-project -auto-merge baseProject.psprjx latestProject.psprjx myProject.psprjx

Input Arguments

collapse all

Full or relative path to the latest version of project in repository.

  • When comparing or merging two projects in the user interface of the diff/merge tool, the structure of this project appears on the left.

  • In a three-way manual merge, the structure of this project appears on the left in the Theirs column.

Example: "E:\dev_branch\Polyspace_projects\testProject.psprjx"

Full or relative path to your version of the project.

  • When comparing or merging two projects in the user interface of the diff/merge tool, the structure of this project appears on the right.

  • In a three-way manual merge, the structure of this project appears on the right in the Mine column.

Example: "E:\home\user\Polyspace_projects\testProject.psprjx"

Full or relative path to base version of a project. The base version of a project is the version that you checked out from the repository and made changes to. The path to the base version of a project is required only in a three-way merge (automatic or manual). In a three-way manual merge in the user interface of the diff/merge tool, the structure of this project appears in the middle in the Base column.

Example: "E:\master_branch\Polyspace_projects\testProject.psprjx"

By default, after a merge, your version of a project is overwritten with a merged version. If you want a dedicated merge output instead, use the option -target followed by the full or relative path to the merged project.

Example: "E:\master_branch\Polyspace_projects\testProject.psprjx"

Version History

Introduced in R2023b