CmdRunner power!

Wednesday, January 25, 2012 0 Comments


The CmdRunner library is a tiny c# project that allows you to create porcelain applications using the “cm shell” strength.

What is the “cm shell” feature? The “cm shell” utility is able to execute cm commands like flash! It opens a shell interface where you can start issuing cm commands! Test it! first run four or five “cm lrep” lonely commands, not a big deal... Now try to issue “cm shell” and then type lrep & enter, lrep & enter, lrep & enter, lrep & enter... much faster!! ain’t it cool?

Using the CmdRunner library you will be able to use this incredible speed running cm commands and create small or big utilities for your daily work with PlasticSCM.

Let's see some examples, for example, if you want to list all the changesets inside the “default” repository you just need to write something like this:

You can also perform write operations, this example will return 0 or 1 regarding if the checkout operation was successful or not:

After the checkin you may want to modify the file and finally commit it:

You can go further! for example you can create your own c# replication scheduler, launch replication operations is as simple as this:

You only have to surround the cm commands with your stuff and you will able to create everything you can want!!! Every single cm command you can imagine can be executed by our CmdRunner! Some of our plugins are using this library to work! so can create big things!!

You can download the CmdRunner source code and easy examples here: http://www.plasticscm.com/externalcontent/CmdRunnerVS2010.zip

The VisualStudio solution can be opened with VS 2010. The "CmdRunnerExample" project contains code examples to start playing.

Have fun!


0 comentarios: