Browse Source

REPORT-87551 对模板进行重命名后,版本管理仍存在,但是每个版本内容都是一样的

new-design
Destiny.Lin 1 year ago
parent
commit
323171db32
  1. 14
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

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

@ -255,13 +255,17 @@ public class VcsHelper implements JTemplateActionListener {
VcsOperator operator = WorkContext.getCurrent().get(VcsOperator.class);
String oldPath = oldName.replaceFirst(VCS_FILE_SLASH, StringUtils.EMPTY);
List<VcsEntity> oldVcsEntities = operator.getVersions(oldPath);
String replaceName = newName.replaceFirst(VCS_FILE_SLASH, StringUtils.EMPTY);
for (VcsEntity oldVcsEntity : oldVcsEntities) {
operator.saveVersion(oldVcsEntity.getUsername(), newName.replaceFirst(VCS_FILE_SLASH, StringUtils.EMPTY), oldVcsEntity.getCommitMsg(), oldVcsEntity.getVersion());
operator.deleteVersion(oldPath, oldVcsEntity.getVersion());
if (!VcsHelper.getInstance().isLegacyMode()) {
operator.renameVersion(oldVcsEntity, replaceName);
} else {
operator.saveVersion(oldVcsEntity.getUsername(), replaceName, oldVcsEntity.getCommitMsg(), oldVcsEntity.getVersion());
operator.deleteVersion(oldPath, oldVcsEntity.getVersion());
}
}
FineLoggerFactory.getLogger().debug("moveVcs success. from {} to {}", oldName, newName);
if (GcConfig.getInstance().isGcEnable()) {
FineLoggerFactory.getLogger().debug("moveVcs success. from {} to {}", oldName, replaceName);
if (GcConfig.getInstance().isGcEnable() && VcsHelper.getInstance().isLegacyMode()) {
operator.gc();
}
}

Loading…
Cancel
Save