Jump to content

RCS-style keywords


deanaug

Recommended Posts

I'm a new user of Plastic (and this forum as well), so hope this isn't a repeat:

Are there any plans to add RCS keyword ($File$, $Author$, etc...) expansion functionality to Plastic?

As an alternative, would it be possible to write a triggered script (either check in or client checkin?) to do this for you? My only experience so far with triggers is reading the manual, so I don't know all the capabilities possible here.

Thanks in advance for any advice!!

Link to comment
Share on other sites

  • 4 weeks later...

I did get this to work. Wound up using a before-clientcheckin trigger. Looking at the list of RCS keywords available, I decided the following made the most sense based on use of Plastic and requirements of our project:

$Author$

- From cm whoami command

$Date$

- From Windows date and time commands

$File$

- From full path of file being checked in (provided by trigger), with path stripped off (called $RCSFile$ in RCS "standard" list)

$Revision$

- Branch and NEW rev number of file, after checkin. This part took some work, since I couldn't see a direct way to get what the new revision number would be. I did the following:

* Use cm find with file owner, rev number=CO, and item=filename to get branch checked out on

* Use cm hist for the filename to get all history for file

* Go through history to get rev number prior to CO on branch, to get OLD rev number of file

* Increment result to get NEW rev number of file

$Source$

- From full path of file being checked in, provided by trigger

Most of the work is done in a batch file called for the trigger, there's also a Perl script called from the batch file that does the actual regular-expression substitutions of the lines with keywords.

Link to comment
Share on other sites

Dean, great! thank you for sharing this with the community.

Indeed, you will find Plastic CLI is very powerful, there are a bunch of undocumented commands that we are also working on to make it visible to the end user, but what we have now should answer most needs.

cheers,

Miller

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...