File management

Tip

This chapter assumes that the Helix Plugin for MATLAB and Simulink (P4SL) is installed, you have created your project, and that it is connected to the Helix Core Server. If this is not the case please see the following chapters for instructions:

This chapter covers file management in Simulink and MATLAB including:

View the status of your project files

Simulink

Navigate to the Simulink All Files View to view the status of your project files and folders.

Image of the Simulink project file view

Status column

  • Green tick indicates that the file or the content of a folder is under Perforce Helix Core Server control.
  • Period (.) indicates the file or the content of the folder is not under Perforce Helix Core Server control.

Helix Core column

File decorations in the Helix Core column indicate the state of each of the files in the Helix Core Server:

  • Green circle file is not marked change
  • Plus sign (+) file marked for add
  • Blue square file has been marked for edit
  • Empty circle file not under source control
  • Period (.) file source control status is unknown

Revision column

Revision number: indicates the revision of the file in you workspace.

Tip

A revision number of -1 indicates that the file is marked for add but is not yet under Helix Core Server control.

MATLAB

Image of MATLAB depot files

Helix Core column

File decorations in the Helix Core column indicate the state of each of the files in the Helix Core Server:

  • Green circle file is not marked change
  • Plus sign (+) file marked for add
  • Blue square file has been marked for edit
  • Empty circle file not under source control
  • Period (.) file source control status is unknown

Helix Core Server Right-click menu options

Simulink Helix Core Server menu

To open the Helix Core Server menu, select one of more files/folders in your project and Right-Click to display the menu.

Image of File right click dropdown

The menu contains the following items:

Menu option Description

Extract Conflict Markers to File

Extracts the conflict markers from the selected files and enables you to compare the files causing the conflict. For instructions on extracting conflict markers, see the Extract Conflict Markers section of the MATLAB documentation.

Add to Project

Adds the selected file(s) to the Simulink project and opens the file for add locally. The file(s) are displayed under Modified Files and you must commit the file(s) to complete the process.

Remove from Project

Removes the file(s) from the project, commits the remove (delete) to the Helix Core Server, but does not delete the local file in your workspace.

Add Folder to Project (including Child Files)

Adds the file(s) in the selected folder(s) to the Simulink project and opens the file(s) for add locally. The file(s) are displayed under Modified Files and you must commit the file(s) to complete the process.

Refresh Helix Core Status

Checks the status of the workspace files in Helix Core Server.

Check for Modifications

Checks for modifications that are not registered in the pending changelist.

Get File Lock

Gets the latest version of the selected file(s) and then opens the file(s) for edit in the Helix Core Server. The file(s) are displayed in the Modified Files view. You must commit (submit) the file(s) to complete the process.

Editing a file without clicking Get File Lock will do nothing unless the file is saved. Local files in your workspace are kept as read-only by the Helix Core Server. When you try to save the file you are prompted to click Overwrite. When you click Overwrite the file is opened for edit in the Helix Core Server.

Revert Local Changes and Release Locks

Discards any changes that you have made to the files in your workspace. This operation is known as revertingClosed To discard changes you made to a file in your client workspace without submitting the changes to the depot. a file.

Show Revisions

Shows the revision history for the selected files.

Compare to Revision

Uses the p4 print command to stream the non-head revision to the user's machine. Local files are not updated.

Compare to Ancestor

Compares the selected file with the last checked-out version in the sandbox. For information about Compare to Ancestor, see the Compare Revisions section of the MATLAB documentation.

Revert using Helix Core

Reverts the selected file(s) to the revision in the Helix Core Server and overwrites those file(s) in your workspace.

MATLAB Helix Core Server menu

To open the Helix Core Server menu, select one of more files/folders in your project Right-Click and select Source Control to display the menu.

Image of MATLAB file view

The menu contains the following Helix Core Server items:

Menu option Description

View and Commit Changes...

Commits the selected files to the Helix Core Server.

Get Revisions

Opens the Get Revision dialog and enables you to get a specific revision of the selected files.

Workspace:

Opens the Helix Core Connection dialog and enables you to edit how your Workspace is populated.

Pending:

Opens the Pending Changelist dialog and enables you to select your active changelist.

Refresh Helix Core Status

Checks the status of the workspace files in Helix Core Server.

Get File Lock

Gets the latest version of the selected files and then opens the files for edit in the Helix Core Server. The files are displayed in the Modified Files view. You must commit the files to complete the process.

Editing a file without clicking Get File Lock will do nothing unless the file is saved. Local files in your workspace are kept as read-only by the Helix Core Server. When you save the file you are prompted to click Overwrite. When you click Overwrite the file is opened for edit in the Helix Core Server.

Revert Local Changes

Reverts the selected file(s) to the revision in the Helix Core Server and overwrites those file(s) in your workspace.

Discards any changes that you have made to the files in your workspace. This operation is known as revertingClosed To discard changes you made to a file in your client workspace without submitting the changes to the depot. a file.

Rename...

Renames the selected file or folder to the name that you specify.

Move...

Moves the selected file or folder to the location that you specify.

Automatic checkout of project files

When you edit, add or delete a file in your project, the P4SL plugin automatically checks out the file, marks it for edit, add, or delete as appropriate, and adds it to the Pending changelist. You must commit the files to complete the process, see Commit project files.

Tip
  • You cannot move a file to a different pending changelist.
  • If you select a different pending changelist any files you add, edit, or delete will be added to the selected pending changelist.

Commit project files

Commit the changes to you project files to the Helix Core Server:

  1. To commit the project files to the Helix Core Server, either:
    • Simulink: click the Commit button in the Project tab.
    • MATLAB: click the Modified tab, open the current folder, Right-Click and select View and Commit Changes.....
  2. Image of the Simulink Commit file dialog

  3. Add a change description to the Comment text box and clcik Commit to commit the changes.

  4. Your files are committed to the Helix Core Server.