From 6de053470378dd5500e745a8258dedc515746e9d Mon Sep 17 00:00:00 2001 From: Laszlo Gati Date: Wed, 26 Mar 2025 16:44:50 +0100 Subject: [PATCH 1/8] ST6RI-836 Added magic command to change api-base-path --- .../sysml/interactive/SysMLInteractive.java | 16 ++++++ .../interactive/SysMLInteractiveHelp.java | 11 +++- .../omg/sysml/jupyter/kernel/SysMLKernel.java | 1 + .../jupyter/kernel/magic/ApiBasePath.java | 55 +++++++++++++++++++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/ApiBasePath.java diff --git a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java index 2d53d57ab..c921b8854 100644 --- a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java +++ b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java @@ -137,6 +137,10 @@ public void setApiBasePath(String apiBasePath) { this.apiBasePath = apiBasePath; } + public String getApiBasePath() { + return apiBasePath; + } + public int next() { this.resource = (XtextResource)this.createResource(counter + SYSML_EXTENSION); this.addInputResource(this.resource); @@ -249,6 +253,18 @@ public String help(String command) { help(command, Collections.emptyList()); } + public String apiBasePath(String apiBasePath, List help) { + if (!help.isEmpty()) { + return SysMLInteractiveHelp.getApiBasePathHelp(); + } + + if (!Strings.isNullOrEmpty(apiBasePath)) { + setApiBasePath(apiBasePath); + } + + return getApiBasePath(); + } + public String eval(String input, String targetName, List help) { if (Strings.isNullOrEmpty(input)) { this.counter++; diff --git a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java index bb33eba8d..4208adead 100644 --- a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java +++ b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java @@ -38,6 +38,7 @@ public class SysMLInteractiveHelp { private static final String GENERAL_HELP_STRING = "The following SysML v2 magic commands are available.\n" + "For help on a specific command, use \"%help \" or \"% -h\".\n\n" + + "%api-base-path\t Sets and prints the current api base path" + "%eval\t\tEvaluate a given expression.\n" + "%export\t\tSave a file of the JSON representation of the abstract syntax tree rooted in the named element.\n" + "%help\t\tGet a list of available commands or help on a specific command\n" @@ -115,6 +116,11 @@ public class SysMLInteractiveHelp { "Usage: %export \n\n" + "Save a file containing the complete JSON representation of the abstract syntax tree rooted in .\n" + " must be fully qualified.\n"; + + private static final String API_BASE_PATH_HELP_STRING = + "Usage: %api-base-path []\n\n" + + "Sets the current api base path\n" + + "If no argument is passed it prints the current api base path"; public static String getGeneralHelp() { return GENERAL_HELP_STRING; @@ -152,6 +158,10 @@ public static String getExportHelp() { return EXPORT_HELP_STRING; } + public static String getApiBasePathHelp() { + return API_BASE_PATH_HELP_STRING; + } + private static Map commandHelpMap = createCommandHelpMap(); private static Map createCommandHelpMap() { @@ -170,5 +180,4 @@ private static Map createCommandHelpMap() { public static String getHelpString(String command) { return commandHelpMap.get(command); } - } diff --git a/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/SysMLKernel.java b/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/SysMLKernel.java index f2265c140..f77bbe2ad 100644 --- a/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/SysMLKernel.java +++ b/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/SysMLKernel.java @@ -80,6 +80,7 @@ public SysMLKernel() { this.magics.registerMagics(Viz.class); this.magics.registerMagics(View.class); this.magics.registerMagics(Export.class); + this.magics.registerMagics(ApiBasePath.class); this.magicParser = new MyMagicParser(); } diff --git a/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/ApiBasePath.java b/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/ApiBasePath.java new file mode 100644 index 000000000..f40b7c54c --- /dev/null +++ b/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/ApiBasePath.java @@ -0,0 +1,55 @@ +/** + * SysML 2 Pilot Implementation + * Copyright (C) 2025 Model Driven Solutions, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * @license LGPL-3.0-or-later + * + * Contributors: + * Laszlo Gati, MDS + */ +package org.omg.sysml.jupyter.kernel.magic; + +import java.util.List; +import java.util.Map; + +import org.omg.sysml.interactive.SysMLInteractive; +import org.omg.sysml.jupyter.kernel.ISysML; + +import io.github.spencerpark.jupyter.kernel.magic.registry.LineMagic; +import io.github.spencerpark.jupyter.kernel.magic.registry.MagicsArgs; + +public class ApiBasePath { + + private static final MagicsArgs SHOW_ARGS = MagicsArgs.builder().onlyKnownKeywords().onlyKnownFlags() + .optional("basePath") + .flag("help", 'h', "true") + .build(); + + @LineMagic("api-base-path") + public static String apiBasePath(List args) { + Map> vals = SHOW_ARGS.parse(args); + List basePaths = vals.get("basePath"); + String basePath = basePaths.isEmpty()? null: basePaths.get(0); + + SysMLInteractive interactive = ISysML.getKernelInstance().getInteractive(); + + if (basePath != null) { + interactive.setApiBasePath(basePath); + } + + return "Api base path is: " + ISysML.getKernelInstance().getInteractive().getApiBasePath(); + } +} From 7e36f1267ac4b1ea2820343aeeb3dd03a94ac7dc Mon Sep 17 00:00:00 2001 From: Laszlo Gati Date: Mon, 5 May 2025 14:44:40 +0200 Subject: [PATCH 2/8] ST6RI-836 Changed magic command 'api-base-path' to 'repo' - updated help string - fixed '-h' flag --- .../sysml/interactive/SysMLInteractiveHelp.java | 17 +++++++++++------ .../sysml/jupyter/kernel/magic/ApiBasePath.java | 14 +++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java index 4208adead..af907b22f 100644 --- a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java +++ b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java @@ -32,19 +32,20 @@ import java.util.Map; import org.omg.sysml.plantuml.SysML2PlantUMLStyle; +import org.omg.sysml.util.traversal.facade.impl.ApiElementProcessingFacade; public class SysMLInteractiveHelp { private static final String GENERAL_HELP_STRING = "The following SysML v2 magic commands are available.\n" + "For help on a specific command, use \"%help \" or \"% -h\".\n\n" - + "%api-base-path\t Sets and prints the current api base path" + + "%repo\t Set the api base path for the repository" + "%eval\t\tEvaluate a given expression.\n" + "%export\t\tSave a file of the JSON representation of the abstract syntax tree rooted in the named element.\n" + "%help\t\tGet a list of available commands or help on a specific command\n" + "%list\t\tList loaded library packages or the results of a given query\n" + "%show\t\tPrint the abstract syntax tree rooted in a named element\n" - + "%publish\tPublish to the repository the modele elements rooted in a named element\n" + + "%publish\tPublish to the repository the model elements rooted in a named element\n" + "%view\t\tRender the view specified by the named view usage\n" + "%viz\t\tVisualize the name model elements\n"; @@ -118,9 +119,12 @@ public class SysMLInteractiveHelp { + " must be fully qualified.\n"; private static final String API_BASE_PATH_HELP_STRING = - "Usage: %api-base-path []\n\n" - + "Sets the current api base path\n" - + "If no argument is passed it prints the current api base path"; + "Usage: %repo []\n\n" + + "If is not given, print the current repository base path.\r\n" + + "If is given, set the repository base path.\r\n" + + "\r\n" + + " is a URL giving the API base path for the repository access by the %projects, %publish and %load commands. \r\n" + + "For example: " + ApiElementProcessingFacade.DEFAULT_BASE_PATH; public static String getGeneralHelp() { return GENERAL_HELP_STRING; @@ -173,7 +177,8 @@ private static Map createCommandHelpMap() { map.put("%publish", PUBLISH_HELP_STRING); map.put("%viz", VIZ_HELP_STRING); map.put("%view", VIEW_HELP_STRING); - map.put("%export", EXPORT_HELP_STRING); + map.put("%export", EXPORT_HELP_STRING); + map.put("%repo", API_BASE_PATH_HELP_STRING); return map; } diff --git a/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/ApiBasePath.java b/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/ApiBasePath.java index f40b7c54c..f0778a95e 100644 --- a/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/ApiBasePath.java +++ b/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/ApiBasePath.java @@ -33,23 +33,19 @@ public class ApiBasePath { - private static final MagicsArgs SHOW_ARGS = MagicsArgs.builder().onlyKnownKeywords().onlyKnownFlags() + private static final MagicsArgs REPO_ARGS = MagicsArgs.builder().onlyKnownKeywords().onlyKnownFlags() .optional("basePath") .flag("help", 'h', "true") .build(); - @LineMagic("api-base-path") + @LineMagic("repo") public static String apiBasePath(List args) { - Map> vals = SHOW_ARGS.parse(args); + Map> vals = REPO_ARGS.parse(args); List basePaths = vals.get("basePath"); + List help = vals.get("help"); String basePath = basePaths.isEmpty()? null: basePaths.get(0); SysMLInteractive interactive = ISysML.getKernelInstance().getInteractive(); - - if (basePath != null) { - interactive.setApiBasePath(basePath); - } - - return "Api base path is: " + ISysML.getKernelInstance().getInteractive().getApiBasePath(); + return interactive.apiBasePath(basePath, help); } } From 8f6cb35c4e028349a4ce097e5239dfde4624a3e3 Mon Sep 17 00:00:00 2001 From: Laszlo Gati Date: Mon, 5 May 2025 17:35:43 +0200 Subject: [PATCH 3/8] ST6RI-836 Changed api base path example in help string --- .../src/org/omg/sysml/interactive/SysMLInteractiveHelp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java index af907b22f..471396be8 100644 --- a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java +++ b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java @@ -124,7 +124,7 @@ public class SysMLInteractiveHelp { + "If is given, set the repository base path.\r\n" + "\r\n" + " is a URL giving the API base path for the repository access by the %projects, %publish and %load commands. \r\n" - + "For example: " + ApiElementProcessingFacade.DEFAULT_BASE_PATH; + + "For example: https://my.domain.com/sysml_repo"; public static String getGeneralHelp() { return GENERAL_HELP_STRING; From a24f936320fedae5aeb7595cd5d4967765d26e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Ujhelyi?= Date: Thu, 15 May 2025 13:52:08 +0200 Subject: [PATCH 4/8] ST6RI-836 Put back method mistakenly removed during merging --- .../src/org/omg/sysml/interactive/SysMLInteractiveHelp.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java index 6f030d05a..54f7e77ca 100644 --- a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java +++ b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractiveHelp.java @@ -192,6 +192,10 @@ public static String getLoadHelp() { return LOAD_HELP_STRING; } + public static String getApiBasePathHelp() { + return API_BASE_PATH_HELP_STRING; + } + private static Map commandHelpMap = createCommandHelpMap(); private static Map createCommandHelpMap() { From 6d6d9d21a94aede1dfdcc5fb28fb3a84f82f81ac Mon Sep 17 00:00:00 2001 From: Laszlo Gati Date: Wed, 21 May 2025 14:26:59 +0200 Subject: [PATCH 5/8] ST6RI-178 Added error message for empty branch loading --- .../src/org/omg/sysml/interactive/SysMLInteractive.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java index 261d02c56..26554a9b2 100644 --- a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java +++ b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java @@ -538,6 +538,11 @@ private String load(RemoteBranch branch) { System.out.println(); System.out.println("Selected branch " + branch.getName() + " (" + branch.getRemoteId().toString() + ")"); + Revision headRevision = branch.getHeadRevision(); + if (!headRevision.isRemote()) { + return "ERROR:Branch has no head commit\n"; + } + if (!tracker.isLibraryTracked()) { System.out.println("Caching library UUIDs..."); tracker.trackLibraryUUIDs(getLibraryResources()); @@ -549,9 +554,6 @@ private String load(RemoteBranch branch) { tracker.trackLocalUUIDs(inputResources); System.out.println("Downloading model..."); - - RemoteProject remoteProject = branch.getRemoteProject(); - Revision headRevision = branch.getHeadRevision(); APIModel model = headRevision.fetchRemote(); EMFModelRefresher modelRefresher = new EMFModelRefresher(model, tracker); @@ -565,6 +567,7 @@ private String load(RemoteBranch branch) { addResourceToIndex(resource); }); + RemoteProject remoteProject = branch.getRemoteProject(); return "Loaded Project " + remoteProject.getProjectName() + " (" + remoteProject.getRemoteId().toString() + ")\n"; } From 6498b076bb3700ca5146aa2db981c95bee2f8d67 Mon Sep 17 00:00:00 2001 From: Laszlo Gati Date: Wed, 21 May 2025 14:52:02 +0200 Subject: [PATCH 6/8] ST6RI-836 getProjectById returns null of project doesn't exist - when trying to query a project by id instead of throwing an exception getProjectById return null. This matches with the logic used in by getProjectByName --- .../org/omg/sysml/util/repository/ProjectRepository.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.omg.sysml/src/org/omg/sysml/util/repository/ProjectRepository.java b/org.omg.sysml/src/org/omg/sysml/util/repository/ProjectRepository.java index 62ba823ce..c64c23943 100644 --- a/org.omg.sysml/src/org/omg/sysml/util/repository/ProjectRepository.java +++ b/org.omg.sysml/src/org/omg/sysml/util/repository/ProjectRepository.java @@ -185,7 +185,11 @@ public RemoteProject getPRojectById(UUID projectId) { Project projectById = getProjectApi().getProjectById(projectId); return projectById == null? null: new RemoteProject(this, projectId, projectById.getName()); } catch (ApiException e) { - throw new RemoteException("Error occured while trying to query the project", e); + if (e.getCode() == 404) { + return null; + } else { + throw new RemoteException("Error occured while trying to query the project", e); + } } } From 070a256bb5ef1c0ba2cc26973b5d16d577896ff8 Mon Sep 17 00:00:00 2001 From: Ed Seidewitz Date: Thu, 22 May 2025 09:00:37 -0400 Subject: [PATCH 7/8] ST6RI-836 Changed name of %repo magic implementation to "Repo". - Also added %repo to SysMLInteractive main program, and properly updated counter. --- .../org/omg/sysml/interactive/SysMLInteractive.java | 13 +++++++++++-- .../org/omg/sysml/jupyter/kernel/SysMLKernel.java | 2 +- .../kernel/magic/{ApiBasePath.java => Repo.java} | 6 +++--- .../org/omg/sysml/jupyter/kernel/magic/View.java | 2 ++ 4 files changed, 17 insertions(+), 6 deletions(-) rename org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/{ApiBasePath.java => Repo.java} (90%) diff --git a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java index 26554a9b2..b3d7c4b4e 100644 --- a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java +++ b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java @@ -279,7 +279,8 @@ public String help(String command) { help(command, Collections.emptyList()); } - public String apiBasePath(String apiBasePath, List help) { + public String repo(String apiBasePath, List help) { + this.counter++; if (!help.isEmpty()) { return SysMLInteractiveHelp.getApiBasePathHelp(); } @@ -288,9 +289,15 @@ public String apiBasePath(String apiBasePath, List help) { setApiBasePath(apiBasePath); } - return getApiBasePath(); + return getApiBasePath() + "\n"; } + public String repo(String command) { + return "-h".equals(command)? + repo(null, Collections.singletonList("true")): + repo(command, Collections.emptyList()); + } + public String eval(String input, String targetName, List help) { if (Strings.isNullOrEmpty(input)) { this.counter++; @@ -783,6 +790,8 @@ public void run() { } } else if ("%projects".equals(command)) { System.out.print(this.projects(argument)); + } else if ("%repo".equals(command)) { + System.out.print(this.repo(argument)); } else if ("%publish".equals(command)) { if (!"".equals(argument)) { System.out.print(this.publish(argument)); diff --git a/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/SysMLKernel.java b/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/SysMLKernel.java index 3054658ac..0b371b3cf 100644 --- a/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/SysMLKernel.java +++ b/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/SysMLKernel.java @@ -82,7 +82,7 @@ public SysMLKernel() { this.magics.registerMagics(Export.class); this.magics.registerMagics(Projects.class); this.magics.registerMagics(Load.class); - this.magics.registerMagics(ApiBasePath.class); + this.magics.registerMagics(Repo.class); this.magicParser = new MyMagicParser(); } diff --git a/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/ApiBasePath.java b/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/Repo.java similarity index 90% rename from org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/ApiBasePath.java rename to org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/Repo.java index f0778a95e..6770d030e 100644 --- a/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/ApiBasePath.java +++ b/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/Repo.java @@ -31,7 +31,7 @@ import io.github.spencerpark.jupyter.kernel.magic.registry.LineMagic; import io.github.spencerpark.jupyter.kernel.magic.registry.MagicsArgs; -public class ApiBasePath { +public class Repo { private static final MagicsArgs REPO_ARGS = MagicsArgs.builder().onlyKnownKeywords().onlyKnownFlags() .optional("basePath") @@ -39,13 +39,13 @@ public class ApiBasePath { .build(); @LineMagic("repo") - public static String apiBasePath(List args) { + public static String repo(List args) { Map> vals = REPO_ARGS.parse(args); List basePaths = vals.get("basePath"); List help = vals.get("help"); String basePath = basePaths.isEmpty()? null: basePaths.get(0); SysMLInteractive interactive = ISysML.getKernelInstance().getInteractive(); - return interactive.apiBasePath(basePath, help); + return interactive.repo(basePath, help); } } diff --git a/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/View.java b/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/View.java index 8ec99c036..a892fb4dc 100644 --- a/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/View.java +++ b/org.omg.sysml.jupyter.kernel/src/main/java/org/omg/sysml/jupyter/kernel/magic/View.java @@ -63,6 +63,8 @@ public static DisplayData view(List args) { break; case TEXT: dd.putText(vr.getText()); + default: + break; } return dd; } From e46defeaf054bb53a8bb0095a7fe2afea471f715 Mon Sep 17 00:00:00 2001 From: Ed Seidewitz Date: Thu, 22 May 2025 09:05:58 -0400 Subject: [PATCH 8/8] ST6RI-836 Moved printing of API base path earlier in %load command impl. --- .../src/org/omg/sysml/interactive/SysMLInteractive.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java index b3d7c4b4e..dc7095169 100644 --- a/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java +++ b/org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java @@ -489,7 +489,7 @@ protected String publish(String name) { * @return output of the command */ public String load(Map parameters) { - counter++; + this.counter++; if (parameters.containsKey(HELP_KEY)) { return SysMLInteractiveHelp.getLoadHelp(); @@ -503,6 +503,9 @@ public String load(Map parameters) { return "ERROR:Branch name and id cannot be provided at the same time\n"; } + System.out.println("API base path: " + apiBasePath); + System.out.println(); + final ProjectRepository repository = new ProjectRepository(apiBasePath); final RemoteProject project; @@ -541,8 +544,6 @@ private String load(RemoteBranch branch) { return "ERROR:Branch doesn't exist\n"; } - System.out.println("API base path: " + apiBasePath); - System.out.println(); System.out.println("Selected branch " + branch.getName() + " (" + branch.getRemoteId().toString() + ")"); Revision headRevision = branch.getHeadRevision();