Jump to content

Stephen

Members
  • Posts

    1
  • Joined

  • Last visited

Stephen's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • Conversation Starter Rare

Recent Badges

1

Reputation

  1. I'm having a little trouble writing some automation tools to work with Plastic. It seems that every time I write a method to get the current branch and changeset for our build machine to add to the build metadata, it doesn't actually work. For example: When explicitly up to date on a given branch, `cm status --header` will show something like this: `/main@myworkspace@mycompany@cloud (cs:1057 - head)` However, if I'm explicitly pointing to a specific commit, I get this: `cs:1050@myworkspace@mycompany@cloud (head:1051)` Which is a little frustrating because I lost the branch name, and now have to parse it differently. Fine. To get the branch, I do `cm showselector` ``` Selector for workspace myworkspace: rep "myworkspace@mycompany@cloud" path "/" smartbranch "/main/test_versioning" changeset "1050" ``` Hey, neat, there's both of them. But, if I go back to tracking the branch instead of the specific revision, I get this: ``` Selector for workspace ramshacklers: rep "myworkspace@mycompany@cloud" path "/" smartbranch "/main/test_versioning" ``` Well, darn, I guess I need both commands no matter what. Now, I get (to some extent) _why_ the output of these commands are different under those different circumstances. What I don't get it why the software needs to be so hostile to me getting basic information about where the repository is currently pointing? Clearly there _exists_ at any point in time a current branch, and a current revision, is there any command that can just actually consistently show me the information I need? Is there a command I just don't know about? I acknowledge it's not hard to write a smart enough parser to wade through all this, but it has at the very least created a lot of back and forth when I thought I had solved a problem, only to discover a new layer of Plastic I hadn't considered before? I feel like I can't be the only person who is going to need to solve this problem, and the one-off nature of these kinds of scripts means I'm probably going to be re-solving it in a bunch of places since sharing quick script code like this is usually more work than it's ever worth.
×
×
  • Create New...