Jump to content
Marc Audouy

update to latest changeset of current branch using command line

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? 

 

Share this post


Link to post
Share on other sites

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 🙂

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...