use of com.google.gerrit.server.patch.PatchScriptFactoryForAutoFix in project gerrit by GerritCodeReview.
the class GetFixPreview method getFixPreviewForSingleFile.
private DiffInfo getFixPreviewForSingleFile(Repository git, PatchSet patchSet, ProjectState state, ChangeNotes notes, String fileName, ImmutableList<FixReplacement> fixReplacements) throws PermissionBackendException, AuthException, LargeObjectException, InvalidChangeOperationException, IOException, ResourceNotFoundException {
PatchScriptFactoryForAutoFix psf = patchScriptFactoryFactory.create(git, notes, fileName, patchSet, fixReplacements, DiffPreferencesInfo.defaults());
PatchScript ps = psf.call();
DiffSide sideA = DiffSide.create(ps.getFileInfoA(), MoreObjects.firstNonNull(ps.getOldName(), ps.getNewName()), DiffSide.Type.SIDE_A);
DiffSide sideB = DiffSide.create(ps.getFileInfoB(), ps.getNewName(), DiffSide.Type.SIDE_B);
DiffInfoCreator diffInfoCreator = new DiffInfoCreator(state, new DiffWebLinksProviderImpl(), true);
return diffInfoCreator.create(ps, sideA, sideB);
}
Aggregations