Jump to content

cm find current branch?


sgrassie

Recommended Posts

  • 2 weeks later...
On 3/24/2022 at 2:03 PM, Patrice Beauvais said:

cm status --header is not bad too since it returns the last synched changeset at same time too..

But it may not return the branch name at all, if the selector is on a changeset (for example, you right-clicked on a changeset (instead of the branch) and did a "Switch workspace to...").

Note that IF (and only if) the selector is on a changeset, "cm showselector" does print the associated cs number as well.

Link to comment
Share on other sites

The command cm status --machinereadable --header will always return the changeset number as the second output parameter. With this information you can run cm log cs:## --csformat={branch} to return the branch name.

(Only caveat is this solution will not work on Gluon workspaces, as they don't technically point to a single changeset!)

Hope this helps!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...