Contenido principal

polyspace-project -diff, polyspace-project -merge

(System Command) Compare and merge Polyspace Platform projects, workspaces, configurations and tests 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, workspaces, configurations or tests in a diff/merge tool (or automatically merge them at the command line).

Compare Polyspace Artifacts

polyspace-project -diff latestVersion myVersion opens a diff/merge tool for comparing two versions of a Polyspace artifact, latestVersion and myVersion. The structure of the artifact latestVersion appears on the left and that of myVersion appears on the right.

example

Merge Polyspace Artifacts

polyspace-project -merge latestVersion myVersion [-target mergedVersion] opens a diff/merge tool for comparing and merging two versions of a Polyspace artifact, latestVersion and myVersion. The structure of the artifact latestVersion appears on the left and that of myVersion appears on the right.

example

polyspace-project -merge baseVersion latestVersion myVersion [-target mergedVersion] [-auto] opens a diff/merge tool for comparing and merging two versions of a Polyspace artifact, latestVersion and myVersion, taking into account a common ancestor version of the artifact, baseVersion (three-way merge). The structure of the artifact latestVersion appears on the left with baseVersion in the middle and myVersion on the right. The option -auto initializes the merged version with the result of an automatic merge (otherwise, the merged version is initialized with myVersion).

example

Automatically Merge Polyspace Artifacts

polyspace-project -auto-merge baseVersion latestVersion myVersion [-target mergedVersion] attempts to automatically merge two versions of a Polyspace artifact, latestVersion and myVersion, taking into account a common ancestor version of the artifact, baseVersion.

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 a Polyspace artifact in repository. The artifact can be a project (.psprjx file), workspace (.pswks file), configuration (.pscfg file), or test (.pstestd file).

In the user interface of the diff/merge tool:

  • In a two-way comparison or merge, the artifact latestVersion appears on the left.

  • In a three-way manual merge, the artifact latestVersion appears on the left in the Theirs column.

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

Full or relative path to your version of a Polyspace artifact. The artifact can be a project (.psprjx file), workspace (.pswks file), configuration (.pscfg file), or test (.pstestd file).

In the user interface of the diff/merge tool:

  • In a two-way comparison or merge, the artifact myVersion appears on the right.

  • In a three-way manual merge, the artifact myVersion 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 Polyspace artifact in repository. The base version is the version that you checked out from the repository and made changes to. The artifact can be a project (.psprjx file), workspace (.pswks file), configuration (.pscfg file), or test (.pstestd file).

The path to the base version 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 artifact baseVersion appears in the middle in the Base column.

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

Full or relative path to merged version of a Polyspace artifact in repository. The artifact can be a project (.psprjx file), workspace (.pswks file), configuration (.pscfg file), or test (.pstestd file).

By default, you do not require to specify the path to a merged Polyspace artifact. After a merge, your version of a Polyspace artifact is overwritten with a merged version. If you prefer a dedicated merge output instead, use the option -target followed by the path to the artifact mergedVersion.

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

Version History

Introduced in R2023b