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 which are listed in the Modified Files view of the project.

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. Compare this with the Modified Files view in the project, where you can see two modified project metadata files in the resources folder

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