Johan Ung Posted August 29, 2017 Report Share Posted August 29, 2017 Hi there, I'm trying to undo changes from CLI to a changed file that is configured to be a hidden changes item. Doing it from the GUI is very simple and quick. Not able to do it with 'cm unco'? Is 'cm update' the right way to go? Was able to get that working but it felt slower than doing it from the GUI. Link to comment Share on other sites More sharing options...
S_Luis Posted August 29, 2017 Report Share Posted August 29, 2017 Hi! The cm unco command undoes a checked out file even if it is inside the hidden changes item list. As it doesn't seem to work for you, I'll guess that you have modified your file locally, but you have NOT checked it out (which is OK! let's solve it) You can see the status of locally changed but hidden files with the --hiddenchanged flag fo the status command. Then, once you know which files are you interested in, you can do both a checkout and an undo checkout, which will revert your local changes. The full cycle: 1) --hiddenchanged allows you to see locally modified files if they are not checked out (requires a disk search) $ cm status --hiddenchanged cs:32@rep:myrepo@repserver localhost:8087 Modified items (CH = changed, CO = checkout, CP = copied (new), RP = replaced) CH MyHiddenChangedFile.cs 2) checkout allows you to check out that file. Notice the lack of the --hiddenchanged argument the second time I call cm status, as it is no longer needed. $ cm checkout MyHiddenChangedFile.cs The selected items are about to be checked out. Please wait... Item C:\Users\sluisp\repos\tests\MyHiddenChangedFile.cs was correctly checked out $ cm status cs:32@rep:myrepo@repserver localhost:8087 Modified items (CH = changed, CO = checkout, CP = copied (new), RP = replaced) CO MyHiddenChangedFile.cs 3) undocheckout allows you to undo the checkout on that file, which will also revert its changes: $ cm undocheckout MyHiddenChangedFile.cs C:\Users\sluisp\repos\tests\MyHiddenChangedFile.cs unchecked out correctly $ cm status cs:32@rep:myrepo@repserver localhost:8087 $ cm status --hiddenchanged cs:32@rep:myrepo@repserver localhost:8087 Please let me know if this solved your issue Link to comment Share on other sites More sharing options...
Johan Ung Posted August 30, 2017 Author Report Share Posted August 30, 2017 Ah okay didn't know it had to be checked out, thank you very much! Link to comment Share on other sites More sharing options...
S_Luis Posted August 30, 2017 Report Share Posted August 30, 2017 4 hours ago, Johan Ung said: Ah okay didn't know it had to be checked out, thank you very much! Here to help Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.