Jump to content

update to latest changeset of current branch using command line


Marc Audouy

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...