From d0e4e1e8b65f0ea7c941adfb35c2c5948f5316b3 Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 20 Oct 2020 17:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=EF=BC=8C=20bugf?= =?UTF-8?q?ix/10.0=20=E5=90=88=20feature/10.0=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/utils/DesignUtils.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 775118d285..75a0d83125 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -6,6 +6,7 @@ import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.gui.UILookAndFeel; import com.fr.design.i18n.Toolkit; @@ -15,6 +16,7 @@ import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.GeneralContext; +import com.fr.general.GeneralUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.CommonCodeUtils; @@ -26,6 +28,9 @@ import com.fr.value.NotNullLazyValue; import com.fr.workspace.WorkContext; import org.jetbrains.annotations.NotNull; +import com.fr.workspace.connect.WorkspaceConnectionInfo; +import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; + import javax.swing.SwingUtilities; import javax.swing.UIManager; import java.awt.Desktop; @@ -417,4 +422,23 @@ public class DesignUtils { public static boolean sendFeedBack(FeedBackInfo feedBackInfo) throws Exception { return true; } + + + public static boolean checkDesignerRemoteVersion() { + if (WorkContext.getCurrent().isLocal()) { + return true; + } + String envName = DesignerEnvManager.getEnvManager().getCurEnvName(); + DesignerWorkspaceInfo selectedEnv = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName); + String localBranch; + String remoteBranch; + WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection(); + localBranch = GeneralUtils.readFullBuildNO(); + try { + remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); + } catch (Exception e) { + return false; + } + return localBranch.contains("#") && localBranch.equals(remoteBranch); + } }