It's all about the answers!

Ask a question

How to add a file in a sub-directory with lscm?


Markus Selve (1023) | asked Feb 25 '15, 11:18 a.m.
First I load a file from my workspace in a sub directory while I am in a directory that is my sandbox:
lscm load -r my_repository -t root/subdir  my_workspace  my_component/root/subdir/file1
Now I have the file (relative to my sandbox where I executed the command) in: root/subdir/file1
Now I create a new file in that subdir:
echo "a test" > root/subdir/new_file
If I tried to checkin the new_file, 'lscm checkin' tells me it isn't shared.  So I tried to share it:
lscm share -r my_repository --verbose  --remotePath root/subdir my_workspace my_component root/subdir/new_file
But lscm prints out:
Cannot share projects under "<my path to sandbox>/root/subdir" - ancestor is shared: "<my path to sandbox>". Try 'lscm help share' for more information.

So how do I checkin the new_file to my workspace into its correct place in root/subdir?

Regards, Markus.

Accepted answer


permanent link
Shashikant Padur (4.2k27) | answered Feb 26 '15, 12:45 a.m.
JAZZ DEVELOPER
edited Feb 26 '15, 3:31 a.m.
In your case RTC only tracks the file under root/subdir and not the directory itself. To track the directory you have to load at the directory level: lscm load -r my_repository -t root/subdir  my_workspace  my_component/root/subdir
After which adding files under root/subdir will be tracked.
Markus Selve selected this answer as the correct answer

Comments
Markus Selve commented Feb 26 '15, 2:43 a.m. | edited Feb 26 '15, 2:45 a.m.

Thanks a lot for your answer! 

In the future it would be nice, if you could explain a bit more what steps one actually has to do to achieve the goal.  You are obviously an experienced lscm developper, but I'm a new-by user.  For you everything is explained with 'adding files will be tracked'.  After trying around a bit I found out that this means, I do not have to use 'lscm share' at all, after I loaded the whole sub directory.  It would have been helpful, if you had added sentences like this at the end of your answer:
- just add the file in the sandbox
- don't use 'lscm share' at all
- proceed as with a changed file:
  - create a changeset
  - checkin to workspace


Shashikant Padur commented Feb 26 '15, 3:31 a.m.
JAZZ DEVELOPER

 Acknowledged. Thanks.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.