|
|
|
@ -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(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|