|
|
|
@ -292,18 +292,14 @@ public class Designer extends BaseDesigner {
|
|
|
|
|
* @param jt |
|
|
|
|
*/ |
|
|
|
|
private void dealWithVcs(JTemplate jt) { |
|
|
|
|
try { |
|
|
|
|
String fileName = VcsHelper.getEditingFilename(); |
|
|
|
|
int latestFileVersion = WorkContext.getCurrent().get(VcsOperator.class).getLatestFileVersion(fileName); |
|
|
|
|
if (jt.getEditingFILE() instanceof VcsCacheFileNodeFile) { |
|
|
|
|
WorkContext.getCurrent().get(VcsOperator.class).saveVersionFromCache(VcsHelper.CURRENT_USERNAME, fileName, StringUtils.EMPTY, latestFileVersion + 1); |
|
|
|
|
String path = DesignerFrameFileDealerPane.getInstance().getSelectedOperation().getFilePath(); |
|
|
|
|
FileVersionTable.getInstance().updateModel(1, WorkContext.getCurrent().get(VcsOperator.class).getVersions(path.replaceFirst("/", ""))); |
|
|
|
|
} else { |
|
|
|
|
WorkContext.getCurrent().get(VcsOperator.class).saveVersion(VcsHelper.CURRENT_USERNAME, fileName, StringUtils.EMPTY, latestFileVersion + 1); |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error("vcs error: {}", e.getMessage()); |
|
|
|
|
String fileName = VcsHelper.getEditingFilename(); |
|
|
|
|
int latestFileVersion = WorkContext.getCurrent().get(VcsOperator.class).getLatestFileVersion(fileName); |
|
|
|
|
if (jt.getEditingFILE() instanceof VcsCacheFileNodeFile) { |
|
|
|
|
WorkContext.getCurrent().get(VcsOperator.class).saveVersionFromCache(VcsHelper.CURRENT_USERNAME, fileName, StringUtils.EMPTY, latestFileVersion + 1); |
|
|
|
|
String path = DesignerFrameFileDealerPane.getInstance().getSelectedOperation().getFilePath(); |
|
|
|
|
FileVersionTable.getInstance().updateModel(1, WorkContext.getCurrent().get(VcsOperator.class).getVersions(path.replaceFirst("/", ""))); |
|
|
|
|
} else { |
|
|
|
|
WorkContext.getCurrent().get(VcsOperator.class).saveVersion(VcsHelper.CURRENT_USERNAME, fileName, StringUtils.EMPTY, latestFileVersion + 1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|