Jump to content

Getting branch info


tsamstag

Recommended Posts

I'm working on a script that uses the Plastic command line client. In one part of the script, I need to get some info about a branch given a full branch name, e.g. br:/main/Feature. Since the actual name of the branch is "Feature" in this case, I can use:

cm find branch where name='Feature'

The problem is that the name of a branch (minus the path) does not need to be unique. I can add parent to the filter, but I can't figure out how to write a query that will also be able to uniquely identify /main.

cm find branch where name='main'

would find br:/main and br:/main/Feature/main. Is there something I could use in a find command to find a branch by the full path?

Link to comment
Share on other sites

Hi tsamstag,

What are you trying to achieve with the script? Maybe I can help you if I get an overall view.

Going to your specific questions, to find br:/main/feature/main I'd do:

cm find branch where name='main' and parent='br:/main/feature'

But yes, I realize we need to introduce support for specs on the 'name' field. We'll do that.

In the meantime, a 'dirty hack' to find /main:

cm find branch where name='main' and parent != 'br:/main'

Not very beautiful but it will work. :)

Let me know if it helps.

pablo

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...