Search code examples
mercurialdvcsstarteam

How do I suppress keyword expansion in Starteam at the client level to enable local mirroring to DVCS?


I am trying to mirror my corporate Starteam CM server with a local distributed version controls system (Mercurial). I am running into problems with seeing many changes due to Starteam's keyword expansion on checkout feature. For example, the server is setup to expand $History to a log of each checkins comments and other metadata. These often cause annoying conflicts when I try to merge.

I can manually "un-expand" the keywords, but the codebase is extremely large and this would take a prohibitively long.


Solution

  • Another option on the mercurial side would be to use a precommit hook to automatically un-expand the keywords in your starteam checkout files.

    Something like this in your ~/.hgrc might do the trick:

    [hooks]
    precommit.unexpand_starteam = find . -name '*.cpp' -print0 | xargs -0 perl -pie 's/$History.*?\n\n//m' ; exit 0
    

    That would remove everything from $History through the first blank line in every file right before committing. I've not used starteam, but there must be some way to identity the end of a history block (blank line was a guess), and with the perl line altered to reflect that you should be good to go.