|
|
|
@ -15,6 +15,7 @@ import com.fr.design.mainframe.vcs.VcsConfigManager;
|
|
|
|
|
import com.fr.design.mainframe.vcs.ui.FileVersionTable; |
|
|
|
|
import com.fr.event.Event; |
|
|
|
|
import com.fr.event.EventDispatcher; |
|
|
|
|
import com.fr.event.Listener; |
|
|
|
|
import com.fr.event.ListenerAdaptor; |
|
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
@ -24,6 +25,8 @@ import com.fr.report.entity.VcsEntity;
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
import com.fr.workspace.Workspace; |
|
|
|
|
import com.fr.workspace.WorkspaceEvent; |
|
|
|
|
import com.fr.workspace.server.vcs.VcsOperator; |
|
|
|
|
import com.fr.workspace.server.vcs.filesystem.VcsFileSystem; |
|
|
|
|
import com.fr.workspace.server.vcs.git.config.GcConfig; |
|
|
|
@ -66,6 +69,8 @@ public class VcsHelper implements JTemplateActionListener {
|
|
|
|
|
|
|
|
|
|
private volatile boolean legacyMode; |
|
|
|
|
|
|
|
|
|
private volatile boolean root; |
|
|
|
|
|
|
|
|
|
public static VcsHelper getInstance() { |
|
|
|
|
return INSTANCE; |
|
|
|
|
} |
|
|
|
@ -89,6 +94,12 @@ public class VcsHelper implements JTemplateActionListener {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener<Workspace>() { |
|
|
|
|
@Override |
|
|
|
|
public void on(Event event, Workspace param) { |
|
|
|
|
root = WorkContext.getCurrent().isRoot() || WorkContext.getCurrent().isLocal(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -370,7 +381,7 @@ public class VcsHelper implements JTemplateActionListener {
|
|
|
|
|
* @return 支持返回true |
|
|
|
|
*/ |
|
|
|
|
public boolean checkV2FunctionSupport() { |
|
|
|
|
return !VcsHelper.getInstance().isLegacyMode() && (WorkContext.getCurrent().isLocal() || WorkContext.getCurrent().isRoot()); |
|
|
|
|
return !VcsHelper.getInstance().isLegacyMode() && root; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|