How to add a file in a sub-directory with lscm?
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.
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
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.
Comments
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
Acknowledged. Thanks.