Marc Audouy Posted March 26, 2019 Report Share Posted March 26, 2019 Hi, For automation purposes I have a script that needs to update the workspace to the latest cset of the current branch. At the moment I use an explicit cm switch br:/main, but I'd like it to work on any branch, for that I would need to know which branch I'm on but cm status does not give branch information, only cset and repository. So is there a way to go the latest cset using command line, or alternatively to know which branch we're on? Link to comment Share on other sites More sharing options...
psantosl Posted March 26, 2019 Report Share Posted March 26, 2019 This is what cm status gives: > cm status /main/refactor03@quake@localhost:6060 (cs:962 - head) Update to latest Plastic because we recently changed cm status 🙂 Link to comment Share on other sites More sharing options...
S_Luis Posted March 27, 2019 Report Share Posted March 27, 2019 If you have your workspace pointing to a cset instead of to a branch, this is what the cm status will show: > cm status cs:7024018@codice@skull.codicefactory.com:9095 (head:7024019) It won't show you the branch, but it will show changeset's branch's head. In my case, I have my workspace pointing to 7024018 and the head of the branch that changeset is in is 7024019. But you DON'T need to parse this output. Whether your workspace points to a branch or a changeset, just executing: > cm update --last ...Will switch your workspace to the current branch's head. Link to comment Share on other sites More sharing options...
Marc Audouy Posted March 27, 2019 Author Report Share Posted March 27, 2019 thanks, I was always unclear as to the difference between "pointing" to a branch or a cset, I always update by going to specific cset "cm update --last" it will be then, perfect. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.