Repository navigation
Project message set/get - #2153
Conversation
| throw new Exception("The message must contain a tag (project name(s))"); | ||
| } | ||
|
|
||
| if (command.compareTo("get") == 0 && getTags().size() != 1) { |
| break; | ||
| case "get": | ||
| for (String projectName : getTags()) { | ||
| Project project; |
There was a problem hiding this comment.
This seems more readable to me:
Project project = env.getProjects().get(projectName);
if (project != null) {
...| } | ||
|
|
||
| for (String projectName : getTags()) { | ||
| Project project; |
|
|
||
| switch (command) { | ||
| switch (getCommand()) { |
There was a problem hiding this comment.
Why call getCommand() for the second time? The result is already in command variable.
| } | ||
| } | ||
|
|
||
| return String.format("Variable \"%s\" set to \"%s\".", |
There was a problem hiding this comment.
I'm worried that this will set just the first project in getTags().
There was a problem hiding this comment.
And a test case for this would be great
| for (String projectName : getTags()) { | ||
| Project project; | ||
| if ((project = env.getProjects().get(projectName)) != null) { | ||
| return ClassUtil.invokeGetter(project, getText().substring(4)).getBytes(); |
There was a problem hiding this comment.
I'm worried that this will use just the first project in getTags().
There was a problem hiding this comment.
There is a check that get can only have one project specified.
| @@ -495,4 +497,53 @@ public void testGetRepos() throws Exception { | |||
| out = new String(m.apply(env)); | |||
There was a problem hiding this comment.
in the setUp():
Assume.assumeTrue(new MercurialRepository().isWorking());
Assume.assumeTrue(new SubversionRepository().isWorking());
Assume.assumeTrue(new GitRepository().isWorking());
can you please replace it with the conditional run?
|
|
||
| // Change their property. | ||
| m = new ProjectMessage(); | ||
| m.setText("set handleRenamedFiles = false"); |
There was a problem hiding this comment.
can you try doing this test for = true? I'm still not conviced that this works for both of the projects and false seems to be the default value.
There was a problem hiding this comment.
Based on the applyMessage() -> set -> return
There was a problem hiding this comment.
I have not committed the fix yet to see that the test is really failing. Coming in a minute..
| } | ||
|
|
||
| @Test | ||
| @ConditionalRun(RepositoryInstalled.GitInstalled.class) |
There was a problem hiding this comment.
nb but this is now a duplicate
| echo " in the webapp." | ||
| echo " Examples:" | ||
| echo " tabSize = 8" | ||
| echo " handleRenamedFiles = true" |
There was a problem hiding this comment.
and also I think there is a wiki page listing the tunables so it should be also added there
There was a problem hiding this comment.
Introduces set/get commands for Project message. Both the command name and its arguments have to reside in message text since the tags are already used for project names.