It's all about the answers!

Ask a question

scm command [add component] - How to use -source-workspace option


Kazuki Nobutani (4118) | asked Jul 16 '17, 10:16 p.m.

Hello,

I have a question with regards to usage of one of scm command option.
The description of the [-s, --source-workspace] claims as below, but I have not being able to successfully run it on my environment.
Can anybody please tell me what is the correct way of running using the option?

[Provides the initial history from the specified workspace or stream. To specify the workspace or stream, use its name[@repo], alias, or UUID[@repo].]

I have checked the following command works fine.
("rtc" is the alias name and "TEST" is my repository ws)
> scm add component -r rtc TEST Build
Component (1000) "Build" successfully removed.

And now if I tried to use the -s option, an error occurs and cannot add component... They all fail.
> scm add component -r rtc TEST Build -s rtc
> scm add component -r rtc TEST Build -s rtc "BRM Stream" Build
> scm add component -r rtc TEST Build -s rtc TEST
> scm add component -r rtc TEST Build -s rtc TEST Build
> scm add component -r rtc TEST Build -s rtc TEST 1000

I have no idea how am I using this.
Thanks in advance.

One answer



permanent link
Shashikant Padur (3.9k27) | answered Jul 16 '17, 11:22 p.m.
JAZZ DEVELOPER
Can you post the error message?

In your command "scm add component -r rtc TEST Build -s rtc" it seems like "rtc" is a repository because it is provided as a value to the "-r" option. Do you have a repository workspace or stream called "rtc"?

If the source stream is "BRM Stream" then the command will be as follows: "scm add component -r rtc TEST Build -s "BRM Stream"


Comments
Kazuki Nobutani commented Jul 17 '17, 3:34 a.m.

Hi,
Thank you very much for your update and sorry for the confusion.
"rtc" = repository alias for "https://server:port/ccm"
"BRM Stream" = One of the stream in the source repository.
"TEST" = My repository ws.
"Build" = One of the component in the "BRM Stream.

I have tried the below commands and it failed with those errors...
>scm add component -r rtc TEST Build -s "BRM Stream"

Problem running 'add component':
Could not add components
Component 'Build' is not in workspace
Check the log for details about the error at XXXX. If you have configured custom logging check your log configuration settings for the path to the log file.

I don't really understand why it cannot find 'Build'. Is it trying to look into my repository ws?
And here is the log mentioned in the above message. But it is really long. If you need the whole log to know the issue, please let me know.



Kazuki Nobutani commented Jul 17 '17, 3:34 a.m.


<date>2017-07-17T04:16:58</date>
    <millis>1500275818553</millis>
    <sequence>1</sequence>
    <logger></logger>
    <level>SEVERE</level>
    <class>com.ibm.team.filesystem.cli.core.util.StatusHelper</class>
    <method>logException</method>
    <thread>1</thread>
    <message>Could not add components</message>
    <exception>
<message>com.ibm.team.scm.common.ComponentNotInWorkspaceException: Component 'Build' is not in workspace</message>
<frame>
<class>com.ibm.team.scm.service.internal.utils.ComponentUtils</class>
<method>throwNotInWorkspaceException</method>
<line>105</line>
</frame>


Shashikant Padur commented Jul 17 '17, 4:06 a.m. | edited Jul 17 '17, 4:06 a.m.
JAZZ DEVELOPER

 When you run 'scm list component "BRM Stream"' does it list the "Build" component?


Kazuki Nobutani commented Jul 17 '17, 7:54 p.m.

Yes, it does.

>scm list components -r rtc "BRM Stream"
Workspace: (1011) "BRM Stream" <-> (1012) "JKE Banking Integration Stream"
  Component: (1013) "Banking Logic"
  Component: (1000) "Build"
  Component: (1014) "C# UI"
  Component: (1005) "Database"
  Component: (1001) "Java UI"
  Component: (1007) "Mobile"
  Component: (1009) "Prerequisites"
  Component: (1010) "Web UI"


I used ID, but it did not work either.

>scm add component -r rtc TEST 1000 -s 1011
Problem running 'add component':
Could not add components
Component 'Build' is not in workspace
Check the log for details about the error at "XXXX". If you have configured custom logging check your log configuration settings for the path to the log file.


Shashikant Padur commented Jul 17 '17, 11:03 p.m.
JAZZ DEVELOPER

I tried this on a 604 client and it worked fine. Which version of RTC are you using?


Kazuki Nobutani commented Jul 19 '17, 11:02 p.m.

I am using 5.0.1
But I tried with 6.0.4 and the issue reproduced. What is the command you tried?


Shashikant Padur commented Jul 19 '17, 11:37 p.m.
JAZZ DEVELOPER

 I tried "scm add component -r rtc TEST 1000 -s 1011" (of course with different parameters) and it worked.


Kazuki Nobutani commented Jul 20 '17, 3:56 a.m.

Hello,
Thanks for checking. It seems like when you specify a stream which is a flow target, it fails.
So it worked fine when I specified other streams/ws.
Now it is good to know it is working!

I'm just curious is this an expected behavior?


1
Shashikant Padur commented Jul 20 '17, 5:07 a.m. | edited Jul 20 '17, 5:38 a.m.
JAZZ DEVELOPER

That's interesting. I don't recollect if I tried the workspace's flow target as the source workspace for add component.


By the way, instead of adding the component you should accept the component if it is the flow target.

showing 5 of 9 show 4 more comments

Your answer


Register or to post your answer.