Merge "Remove ChangeJson > Submit dependency"
This commit is contained in:
@@ -145,7 +145,6 @@ public class ChangeJson {
|
|||||||
private final GitRepositoryManager repoManager;
|
private final GitRepositoryManager repoManager;
|
||||||
private final ProjectCache projectCache;
|
private final ProjectCache projectCache;
|
||||||
private final MergeUtil.Factory mergeUtilFactory;
|
private final MergeUtil.Factory mergeUtilFactory;
|
||||||
private final Submit submit;
|
|
||||||
private final IdentifiedUser.GenericFactory userFactory;
|
private final IdentifiedUser.GenericFactory userFactory;
|
||||||
private final ChangeData.Factory changeDataFactory;
|
private final ChangeData.Factory changeDataFactory;
|
||||||
private final FileInfoJson fileInfoJson;
|
private final FileInfoJson fileInfoJson;
|
||||||
@@ -171,7 +170,6 @@ public class ChangeJson {
|
|||||||
GitRepositoryManager repoManager,
|
GitRepositoryManager repoManager,
|
||||||
ProjectCache projectCache,
|
ProjectCache projectCache,
|
||||||
MergeUtil.Factory mergeUtilFactory,
|
MergeUtil.Factory mergeUtilFactory,
|
||||||
Submit submit,
|
|
||||||
IdentifiedUser.GenericFactory uf,
|
IdentifiedUser.GenericFactory uf,
|
||||||
ChangeData.Factory cdf,
|
ChangeData.Factory cdf,
|
||||||
FileInfoJson fileInfoJson,
|
FileInfoJson fileInfoJson,
|
||||||
@@ -192,7 +190,6 @@ public class ChangeJson {
|
|||||||
this.repoManager = repoManager;
|
this.repoManager = repoManager;
|
||||||
this.userFactory = uf;
|
this.userFactory = uf;
|
||||||
this.projectCache = projectCache;
|
this.projectCache = projectCache;
|
||||||
this.submit = submit;
|
|
||||||
this.mergeUtilFactory = mergeUtilFactory;
|
this.mergeUtilFactory = mergeUtilFactory;
|
||||||
this.fileInfoJson = fileInfoJson;
|
this.fileInfoJson = fileInfoJson;
|
||||||
this.accountLoaderFactory = ailf;
|
this.accountLoaderFactory = ailf;
|
||||||
@@ -412,7 +409,7 @@ public class ChangeJson {
|
|||||||
// the response and avoid making a request to /submit_type from the UI.
|
// the response and avoid making a request to /submit_type from the UI.
|
||||||
out.mergeable = in.getStatus() == Change.Status.MERGED
|
out.mergeable = in.getStatus() == Change.Status.MERGED
|
||||||
? null : cd.isMergeable();
|
? null : cd.isMergeable();
|
||||||
out.submittable = submit.submittable(cd);
|
out.submittable = Submit.submittable(cd);
|
||||||
ChangedLines changedLines = cd.changedLines();
|
ChangedLines changedLines = cd.changedLines();
|
||||||
if (changedLines != null) {
|
if (changedLines != null) {
|
||||||
out.insertions = changedLines.insertions;
|
out.insertions = changedLines.insertions;
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ public class Submit implements RestModifyView<RevisionResource, SubmitInput>,
|
|||||||
* @param cd the change to check for submittability
|
* @param cd the change to check for submittability
|
||||||
* @return if the change has any problems for submission
|
* @return if the change has any problems for submission
|
||||||
*/
|
*/
|
||||||
public boolean submittable(ChangeData cd) {
|
public static boolean submittable(ChangeData cd) {
|
||||||
try {
|
try {
|
||||||
MergeOp.checkSubmitRule(cd);
|
MergeOp.checkSubmitRule(cd);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user