Who we are

We are the developers of Plastic SCM, a full version control stack (not a Git variant). We work on the strongest branching and merging you can find, and a core that doesn't cringe with huge binaries and repos. We also develop the GUIs, mergetools and everything needed to give you the full version control stack.

If you want to give it a try, download it from here.

We also code SemanticMerge, and the gmaster Git client.

Introducing Plastic SCM's external tools actions

Friday, December 15, 2017 Sergio L. 0 Comments

External tool actions have been around since release 6.0.16.1486, thanks to some of you asking for them.

You can create custom actions to run on selected objects such as labels, changesets, branches, and items, and invoke those custom actions directly from Plastic SCM.

External tool actions - Branches

Add custom actions to branches and files

Okay, this is a little bit difficult to understand without an example, so I'm going to teach you how to implement two different actions: one for branches, and one for items. I'll let you tinker around with action for labels and changesets on your own, but it is just as easy. Remember, this feature is available on Windows, macOS, and GNU/Linux, but only in the regular Plastic SCM client, and not in Gluon.

For the action to a branch, I'm going to add a custom action to directly apply an attribute to the branch. This is instead of the alternative of having to navigate to attributes, then selecting the attribute I want to apply, and then looking for the value, which is a real hassle if you do this a lot, like we do.

For the action to an item, I'm going to add a custom action to directly open that item in Visual Studio Code.

Ready? Ok, let's go.

First, let me tell you about the configuration file we need to add. It is named externaltools.conf, and you can create it in two different places (or both!): in your local configuration directory, or in the global configuration repository. I'll use the local configuration for the example.

Remember, your local configuration is either in $HOME/.plastic4 if you are using macOS or GNU/Linux, or in %LOCALAPPDATA%\plastic4 if you are using Windows.
You can learn more about the plastic-global-config by reading the Administrator's guide. If you decide to go with the global configuration, the externaltools.conf file must be located in /global-config/externaltools/.

The file has the following format:

<objectType>[:<objectType>]+ | name | exec path | args
  • <objectType>can either be "item", "label", "changeset" or "branch". You can specify more than one type using a ":" as a separator, for example, label:changeset:branch.
  • name is the name of the action in the External Tools menu.
  • exec path is the path of the executable.
  • args are the arguments. You have the keywords @object, @repository and @wkpath available to you. They will be replaced for the object or repository spec, and for the workspace path, before executing the action.

I'm going to add two lines to my externaltools.conf file. You should now be ready to understand them!

branch | Mark this branch as RESOLVED | "C:\Program Files\PlasticSCM5\client\cm.exe" | setattribute "att:status" "@object" RESOLVED -path="@wkpath"
item | Open in VS Code | "C:\Program Files\Microsoft VS Code\Code.exe" | @object

You guessed it right. The first line adds the menu item that you can see at the top of this post, while the second line adds this to my items view:

External tool actions - Branches

From this point on, the ball is in your court! Let your imagination run wild. What are you going to use this feature for? Maybe close the task related to your branch in your issue tracking system? Or, automatically add the object spec to an email so you can tell your colleagues about a specific cset? Maybe, launch a build on a branch, just in one click? Let us know how you use this feature!

If you have any suggestions, doubts, or problems, please, don't hesitate to write us at support@codicesoftware.com, or ping us on Twitter at @plasticscm, and we will answer ASAP.

Enjoy!

Sergio Luis
After an intense internship at Codice during spring and part of summer 2015, I joined the ranks of Plastic SCM as junior developer.
I already contributed code to the Plastic REST API, the HAL Slack bot that controls our CI system, migrated our internal main server to "new" hardware, coded an Android repo browser and hacked wifi-direct for the upcoming Plastic version.
You can reach me at @_sluis_.

0 comentarios: