How do I check in deleted files and folders at the root of a sandbox using the CLI?
One answer
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
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)?
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 ...
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.
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>
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?
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
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.
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.
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.
Thanks for confirming that it works. The scm status -C may be a problem. Could you please submit a defect for that? Thanks.
I have raised workitem 287889 for the status problem.