&& null != reviewRequest.getRepository().getPath()
&& !reviewRequest.getRepository().getPath().trim().isEmpty()){
try {
String svnUrlProject = RbSVNUrlUtils.getSVNUrlForProject((mainPageSelectedResources[0]));
if( !svnUrlProject.trim().toLowerCase().startsWith(reviewRequest.getRepository().getPath().trim().toLowerCase())){
CloseDialogWithHttpLink closeDialogWithLink = new CloseDialogWithHttpLink(getShell(),
ReviewboardUtil.norminateRepositoryUrl(reviewboardClient.getServerUrl())+"/r/"+reviewRequest.getId(),
RbSubclipseMessages.getString("ERROR_INFORMATION_LABLE"),
RbSubclipseMessages.getString("ERROR_NOTVALID_REPOSITORY"));
Display display = Display.getCurrent();
Color informationColor = display.getSystemColor(SWT.COLOR_RED);
closeDialogWithLink.setInformationColor(informationColor);
closeDialogWithLink.open();
return false;
}
} catch (Exception e) {
}
}
//如果是修改
if(mainPage.isUpdate()){
if( null == reviewRequest || reviewRequest.getId() == 0 ){
MessageDialog.openError(getShell(),
RbSubclipseMessages.getString("ERROR_INFORMATION_LABLE"),
MessageFormat.format(RbSubclipseMessages.getString("ERRO_REQUEST_0"), new Object[]{ String.valueOf(mainPage.getRequestId()) })); //$NON-NLS-1$
return false;
}
if( null != reviewRequest.getStatus() ){
if( reviewRequest.getStatus().equals( ReviewRequestStatus.SUBMITTED ) ){
CloseDialogWithHttpLink closeDialogWithLink = new CloseDialogWithHttpLink(getShell(),
ReviewboardUtil.norminateRepositoryUrl(reviewboardClient.getServerUrl())+"/r/"+reviewRequest.getId(),
RbSubclipseMessages.getString("ERROR_INFORMATION_LABLE"),
MessageFormat.format(RbSubclipseMessages.getString("ERRO_REQUEST_1"), new Object[]{ String.valueOf(mainPage.getRequestId()) }));
Display display = Display.getCurrent();
Color informationColor = display.getSystemColor(SWT.COLOR_RED);
closeDialogWithLink.setInformationColor(informationColor);
closeDialogWithLink.open();
return false;
}
if( reviewRequest.getStatus().equals( ReviewRequestStatus.DISCARDED ) ){
CloseDialogWithHttpLink closeDialogWithLink = new CloseDialogWithHttpLink(getShell(),
ReviewboardUtil.norminateRepositoryUrl(reviewboardClient.getServerUrl())+"/r/"+reviewRequest.getId(),
RbSubclipseMessages.getString("ERROR_INFORMATION_LABLE"),
MessageFormat.format(RbSubclipseMessages.getString("ERRO_REQUEST_2"), new Object[]{ String.valueOf(mainPage.getRequestId()) }));
Display display = Display.getCurrent();
Color informationColor = display.getSystemColor(SWT.COLOR_RED);
closeDialogWithLink.setInformationColor(informationColor);
closeDialogWithLink.open();
return false;
}
}
//再修改内容
reviewboardService.updateReviewRequestFilterNoValue(reviewRequest, new NullProgressMonitor());
//再上传diff
reviewboardService.uploadDiff(reviewRequest.getId(), repositoryRootUrl, fileDiffs, null, new NullProgressMonitor());
//如果是publish
if( !mainPage.isDraft() ){
reviewboardService.publishReviewRequest(reviewRequest.getId(), new NullProgressMonitor());
}
CloseDialogWithHttpLink closeDialogWithLink = new CloseDialogWithHttpLink(getShell(),
ReviewboardUtil.norminateRepositoryUrl(reviewboardClient.getServerUrl())+"/r/"+reviewRequest.getId(),
RbSubclipseMessages.getString("SUCCESS_UPDATE"),
RbSubclipseMessages.getString("SUCCESS_UPDATE_1")+reviewRequest.getId() +"");
closeDialogWithLink.open();
}else{//如果是新增
ModelReviewRequest reviewRequestNew = reviewboardService.newReviewRequestAll( reviewRequest,
repositoryRootUrl, fileDiffs, new NullProgressMonitor());
//如果是publish
if( !mainPage.isDraft() ){
reviewboardService.publishReviewRequest(reviewRequestNew.getId(), new NullProgressMonitor());
}
CloseDialogWithHttpLink closeDialogWithLink = new CloseDialogWithHttpLink(getShell(),
ReviewboardUtil.norminateRepositoryUrl(reviewboardClient.getServerUrl())+"/r/"+reviewRequestNew.getId(),
RbSubclipseMessages.getString("SUCCESS_COMMIT"),
RbSubclipseMessages.getString("SUCCESS_COMMIT_1")+reviewRequestNew.getId() +"");
closeDialogWithLink.open();
}
return true;
} catch (OperationException e) {