Browse Source

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

new-design
Destiny.Lin 11 months 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); VcsOperator operator = WorkContext.getCurrent().get(VcsOperator.class);
String oldPath = oldName.replaceFirst(VCS_FILE_SLASH, StringUtils.EMPTY); String oldPath = oldName.replaceFirst(VCS_FILE_SLASH, StringUtils.EMPTY);
List<VcsEntity> oldVcsEntities = operator.getVersions(oldPath); List<VcsEntity> oldVcsEntities = operator.getVersions(oldPath);
String replaceName = newName.replaceFirst(VCS_FILE_SLASH, StringUtils.EMPTY);
for (VcsEntity oldVcsEntity : oldVcsEntities) { for (VcsEntity oldVcsEntity : oldVcsEntities) {
operator.saveVersion(oldVcsEntity.getUsername(), newName.replaceFirst(VCS_FILE_SLASH, StringUtils.EMPTY), oldVcsEntity.getCommitMsg(), oldVcsEntity.getVersion()); if (!VcsHelper.getInstance().isLegacyMode()) {
operator.deleteVersion(oldPath, oldVcsEntity.getVersion()); 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); FineLoggerFactory.getLogger().debug("moveVcs success. from {} to {}", oldName, replaceName);
if (GcConfig.getInstance().isGcEnable()) { if (GcConfig.getInstance().isGcEnable() && VcsHelper.getInstance().isLegacyMode()) {
operator.gc(); operator.gc();
} }
} }

Loading…
Cancel
Save