Browse Source

REPORT-16559

research/10.0
XiaXiang 6 years ago
parent
commit
ac21c53a5d
  1. 15
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

15
designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

@ -35,11 +35,6 @@ public class VcsHelper {
private static final int MINUTE = 60 * 1000;
private final static String VCS_PLUGIN_ID = "com.fr.plugin.vcs.v10";
public final static String CURRENT_USERNAME = WorkContext.getCurrent().isLocal()
? Toolkit.i18nText("Fine-Design_Vcs_Local_User")
: WorkContext.getCurrent().getConnection().getUserName();
public final static Color TABLE_SELECT_BACKGROUND = new Color(0xD8F2FD);
public final static Color COPY_VERSION_BTN_COLOR = new Color(0x419BF9);
@ -71,6 +66,12 @@ public class VcsHelper {
return fileTree.getSelectionPaths().length - fileTree.getSelectedTemplatePaths().length;
}
public static String getCurrentUsername() {
return WorkContext.getCurrent().isLocal()
? Toolkit.i18nText("Fine-Design_Vcs_Local_User")
: WorkContext.getCurrent().getConnection().getUserName();
}
private static int selectedTemplateCounts() {
TemplateFileTree fileTree = TemplateTreePane.getInstance().getTemplateFileTree();
if (fileTree.getSelectionPaths() == null) {
@ -131,11 +132,11 @@ public class VcsHelper {
latestFileVersion = entity.getVersion();
}
if (jt.getEditingFILE() instanceof VcsCacheFileNodeFile) {
operator.saveVersionFromCache(VcsHelper.CURRENT_USERNAME, fileName, StringUtils.EMPTY, latestFileVersion + 1);
operator.saveVersionFromCache(getCurrentUsername(), fileName, StringUtils.EMPTY, latestFileVersion + 1);
String path = DesignerFrameFileDealerPane.getInstance().getSelectedOperation().getFilePath();
FileVersionTable.getInstance().updateModel(1, WorkContext.getCurrent().get(VcsOperator.class).getVersions(path.replaceFirst("/", "")));
} else {
operator.saveVersion(VcsHelper.CURRENT_USERNAME, fileName, StringUtils.EMPTY, latestFileVersion + 1);
operator.saveVersion(getCurrentUsername(), fileName, StringUtils.EMPTY, latestFileVersion + 1);
}
VcsEntity oldEntity = WorkContext.getCurrent().get(VcsOperator.class).getFileVersionByIndex(fileName, 1);
if (VcsHelper.needDeleteVersion(oldEntity)) {

Loading…
Cancel
Save