|
|
|
@ -27,6 +27,7 @@ import com.fr.stable.project.ProjectConstants;
|
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
import com.fr.workspace.Workspace; |
|
|
|
|
import com.fr.workspace.WorkspaceEvent; |
|
|
|
|
import com.fr.workspace.server.vcs.VcsFileUtils; |
|
|
|
|
import com.fr.workspace.server.vcs.VcsOperator; |
|
|
|
|
import com.fr.workspace.server.vcs.filesystem.VcsFileSystem; |
|
|
|
|
import com.fr.workspace.server.vcs.git.config.GcConfig; |
|
|
|
@ -181,27 +182,9 @@ public class VcsHelper implements JTemplateActionListener {
|
|
|
|
|
private String getEditingFilename() { |
|
|
|
|
JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
|
|
|
|
String editingFilePath = jt.getEditingFILE().getPath(); |
|
|
|
|
return dealWithFilePath(editingFilePath); |
|
|
|
|
return VcsFileUtils.dealWithFilePath(editingFilePath); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 处理传入的文件名,使其符合Vcs规范 |
|
|
|
|
* |
|
|
|
|
* @param filePath 文件路径 |
|
|
|
|
* @return 处理完的文件 |
|
|
|
|
*/ |
|
|
|
|
public String dealWithFilePath(String filePath) { |
|
|
|
|
String vcsCacheDir = VcsFileSystem.getInstance().getVcsCacheRelativePath(); |
|
|
|
|
if (filePath.startsWith(ProjectConstants.REPORTLETS_NAME)) { |
|
|
|
|
filePath = filePath.replaceFirst(ProjectConstants.REPORTLETS_NAME, StringUtils.EMPTY); |
|
|
|
|
} else if (filePath.startsWith(vcsCacheDir)) { |
|
|
|
|
filePath = filePath.replaceFirst(vcsCacheDir, StringUtils.EMPTY); |
|
|
|
|
} |
|
|
|
|
if (filePath.startsWith(VCS_FILE_SLASH)) { |
|
|
|
|
filePath = filePath.substring(1); |
|
|
|
|
} |
|
|
|
|
return filePath; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean needDeleteVersion(VcsEntity entity) { |
|
|
|
|
VcsConfigManager configManager = DesignerEnvManager.getEnvManager().getVcsConfigManager(); |
|
|
|
|