Here's the answer to yesterday's quiz. I'll work through each step and describe what's happening:
1. mkdir subfolder - makes a folder on your local drive2. cd subfolder - change directories into the folder3. echo foo > main.cs - create a new file under “subfolder“4. h add main.cs - pend an “add“ action to the new file5. h checkin - checks in both the file and the folder “subfolder“. This is the implicit add behavior I mentioned in yesterday's blog6. cd .. - change directories up 1 level7. h rename $/subfolder $/folder2 - pends a rename of “subfolder“ to “folder2“8. echo Hello World! > folder2\readme.txt - create a new file under “folder2“9. h add folder2\readme.txt - pends an add to the new file under “folder2“, and an implicit “add“ on folder210. h checkin folder2\readme.txt - checks in folder2 and readme.txt11. h undo folder2 - Trick question. At this point, there is actually nothing to undo for the item “folder2“. folder2 was added for you in step 10.
Unfortunately, I think I probably made this sample a bit more complex than necessary to get the point across about implicit adds. It also turns out I found a bug while going through this exercise ;) The implicit add of “folder2“ seems to have eaten the rename of “subfolder“, so after the checkin in step 10, your local drive arrangement doesn't match the repository. I'll make sure that gets fixed. Such is the life of a tester...
If you have questions about what would happen after a certain sequence of commands, please ask. I'll do my best to answer!