It's all about the answers!

Ask a question

How do I check in deleted files and folders at the root of a sandbox using the CLI?


Martin McAuley (1721533) | asked Oct 10 '13, 11:57 a.m.
retagged Dec 16 '13, 3:57 p.m. by David Lafreniere (4.8k7)
I have successfully shared files and folders into a component using the CLI command 'scm share <workspace> <component> <directory\*> -r <repository>'. Note: I specify the path as '<directory\*' so as not to include the directory path in the changeset. Later I can load the fileset into a sandbox and delete various files and folders and these show up as expected under the 'Unresolved' section when running 'scm status'. I can use the 'scm checkin' command to check in deleted files and folders except for those at the share root, which because they are at the root have no parent folder. How do I check in these deleted files and folders using the CLI?

One answer



permanent link
Surya Tripathi (65017) | answered Oct 10 '13, 2:09 p.m.
You can run the following command to checkin deleted files/folders -
scm checkin  -d <Sandbox Location> <Root Directory> -P <password> -u <user>

You might need RTC 4.0.5 as this command may not work with prior versions.

Comments
Martin McAuley commented Oct 11 '13, 6:29 a.m.

Thanks for the feedback. Just to be clear are you saying that if I specify the root directory to be the sandbox location e.g. 'scm checkin -d c:\sandbox1 c:\sandbox1 ...'. then 4.0.5 now detects root level deleted files and folders (unlike my current version 4.0.3 which does nothing for the same command)?


Surya Tripathi commented Oct 11 '13, 3:19 p.m. | edited Oct 11 '13, 3:20 p.m.

In your example, you would actually want to pass the root directory of your project inside your sandbox. For example -
scm checkin -d c:\sandbox1 c:\sandbox1\project1 ...


Martin McAuley commented Oct 15 '13, 6:02 a.m.

My query is about checking in deleted files and folders that were at the root of the sandbox i.e. they have no parent folder. The root files and folders have been deleted and I cannot checkin their parent folder as usual because the deleted files and folders were already at the root of the sandbox. As I detailed in my question above I used the CLI command 'scm share <workspace> <component> <directory*> -r <repository>' i.e. '<directory>*' to check in top level files and folders to the sandbox root as I do not want these files and folders to be in a top-level folder.


Surya Tripathi commented Oct 15 '13, 8:27 p.m.

If I understand your question correctly, you ran the share command to add files/folders into your component. Example -
scm share  -r <repository> -u <user> -P <password> <workspace> <component> <path>
If the value of "path" was c:\temp\component-x, then the command above will automatically create your sandbox at c:\temp.
Now, you decide to undo the share operation. So you first delete files/folders (C:\temp\component-x and everything underneath) and then run this checkin command-
scm checkin -d c:\temp c:\temp\component-x -u <user> -P <password>



Martin McAuley commented Oct 16 '13, 10:20 a.m.

I still don't see how I checkin a deleted root file or folder. For example I share a file at the root of the sandbox 'c:\temp' using 'scm share <workspace> <component> c:\temp\file1.txt'. Later I delete the file and 'scm status' shows the file as 'd--' in the unresolved section. I now want to checkin this deleted file - how do I do that?


Surya Tripathi commented Oct 16 '13, 1:26 p.m.

So, c:\temp being your sandbox, you would be able to run the checkin command on file1.txt.
scm checkin -d c:\temp c:\temp\file1.txt -u <user> -P <password>

This command may not work if you don't have 4.0.5, because of this bug -
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=255197



Martin McAuley commented Oct 17 '13, 4:47 a.m.

ok - I am on 4.0.3 at the moment which rejects this command as the file is missing. I have tried the 4.0.5M2 cli but it will not run without a server upgrade - we will have to arrange that. Just one final point, I assume this fix will also allow a root level folder to be deleted and checked in just like a root level file? Thanks again for the feedback.


Surya Tripathi commented Oct 17 '13, 1:37 p.m.

Your assumption is correct. The command will work for folders as well. Please accept the answer if it has resolved your question so that no one else will be monitoring it anymore. Thanks.


Martin McAuley commented Oct 31 '13, 11:57 a.m.

I have now got a 4.0.5RC1 localhost instance running and the root file and folder delete is now working - thanks for your help. I have noticed one problem however with the RC1 release - if I run a 'scm status -C' (which shows the pending deleted file or folder) then the subsequent checkin fails with the previous version file-not-present message. If I delete the root file or folder and immediately run checkin then it works. Displaying the pending status seems to break the new root checkin feature.


Surya Tripathi commented Oct 31 '13, 2:13 p.m.

Thanks for confirming that it works. The scm status -C may be a problem. Could you please submit a defect for that? Thanks.


Martin McAuley commented Nov 01 '13, 6:01 a.m.

I have raised workitem 287889 for the status problem.

showing 5 of 11 show 6 more comments

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.