diff --git a/contrib/buildbot/phabricator_wrapper.py b/contrib/buildbot/phabricator_wrapper.py --- a/contrib/buildbot/phabricator_wrapper.py +++ b/contrib/buildbot/phabricator_wrapper.py @@ -366,6 +366,10 @@ return commit_data[0]["fields"]["identifier"] + def get_revision_changed_files(self, revision_id): + return list(self.differential.getcommitpaths( + revision_id=revision_id).values()) + def get_file_content_from_master(self, path): latest_commit_hash = self.get_latest_master_commit_hash() diff --git a/contrib/buildbot/test/mocks/phabricator.py b/contrib/buildbot/test/mocks/phabricator.py --- a/contrib/buildbot/test/mocks/phabricator.py +++ b/contrib/buildbot/test/mocks/phabricator.py @@ -36,6 +36,7 @@ phab.differential.diff.search.return_value = Result([]) phab.differential.revision.return_value = Result([]) phab.differential.revision.search.return_value = Result([]) + phab.differential.getcommitpaths.return_value = {} phab.diffusion = mock.Mock() phab.diffusion.commit = mock.Mock() diff --git a/contrib/buildbot/test/test_phabricator.py b/contrib/buildbot/test/test_phabricator.py --- a/contrib/buildbot/test/test_phabricator.py +++ b/contrib/buildbot/test/test_phabricator.py @@ -245,6 +245,18 @@ commit_hash, "0000000000000000000000000000000123456789") + def test_get_revision_changed_files(self): + self.phab.differential.getcommitpaths.return_value = { + "0": "file1", + "1": "dir/file2", + } + self.assertEqual( + self.phab.get_revision_changed_files(1234), + [ + "file1", + "dir/file2", + ]) + def test_get_file_content_from_master(self): commit_hash = "0000000000000000000000000000000123456789" file_phid = "PHID-FILE-somefile"