From 323171db3251a9eccf84d57daca7ac44c1df670c Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 31 Jul 2023 17:04:10 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-87551=20=E5=AF=B9=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E9=87=8D=E5=91=BD=E5=90=8D=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86=E4=BB=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E6=98=AF=E6=AF=8F=E4=B8=AA=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E9=83=BD=E6=98=AF=E4=B8=80=E6=A0=B7=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/vcs/common/VcsHelper.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java index 07007604d..15787348f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java +++ b/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 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(); } }