August 17, 2006

Reminder for p4 filetypes

You can tell Perforce to automatically mark certain files as type 'ktext', which is necessary to expand the RCS-like keywords. Unfortunately you have to do this on a per-depot basis[1] and I forget to do so when creating/using a new one. So this post is to remember two things:

  1. The command for editing the mapping of depot + extension to file type is 'p4 typemap'; it's not anywhere that I saw in the Win32 GUI so don't even try looking.
  2. If you forget to add your filetype before importing a bunch of stuff, there's hope. </li> This perl script will invoke the 'p4' command-line client to modify the filetype for those file extensions you specify. The only requirement is IPC::Run, which at least on ActivePerl is there by default.

[1] Technically you don't have to (you can use the '//...' depot map) but if you're working in an org with many different development groups, some of which don't have much contact with one another, it's pretty rude to create a global type map.

Next: An addition to Brooks
Previous: What Barb's taken away from international soccer