Main Content

listModifiedFiles

List modified files in project

Description

modifiedfiles = listModifiedFiles(proj) returns the modified project files in the specified project. The function refreshes the source control status in the project, and then returns an array of project files.

example

Examples

collapse all

Open the Times Table App project. Use currentProject to create a project object from the currently loaded project.

openExample("matlab/TimesTableProjectExample")
proj = currentProject;

Modify the project name.

proj.Name = "Better Times Table App";

Get all the modified files in the project.

modifiedfiles = listModifiedFiles(proj)
modifiedfiles = 

  1x2 ProjectFile array with properties:

    Path
    Labels
    Revision
    SourceControlStatus

Observe that two files are modified. The files appear in the Modified Files section in the Source Control panel. If the Source Control icon is not in the sidebar, click the Open more panels button three-dot icon and add it.

Get the latest revision of the first modified file.

revision = modifiedfiles(1).Revision
revision = 

    "ab5a6255ccb2e63c7cd6a8e3bf5c5564926adae8"

Input Arguments

collapse all

Project, specified as a matlab.project.Project object. Use currentProject to create a project object from the currently loaded project.

Output Arguments

collapse all

Modified files, returned as an array of ProjectFile objects.

Version History

Introduced in R2019a