Custom file types

Monday, March 24, 2008 3 Comments

Plastic SCM handles two different file types: binaries and text files. By default it tries to identify a newly added file using an internal algorithm and a built-in list of known extensions. But sometimes a file that should be binary is identified as text or viceversa.

When a file type is interpreted by Plastic SCM as binary, it is not possible to show the differences in text mode. This is not a problem because it is possible to change the type of a revision. When you change the type of a revision, future revisions of the item, will be of the same type.

But now, with Plastic SCM 2.0, users can associate file extensions to file types.

For example, if you want to specify that the files with the extension .cpx are text revisions, you must add a line to "filetypes.conf" file which is placed together with your client.conf file (if you're running on Windows chances are it is located in the directory C:\Documents and Settings\Local Settings\Program Data\plastic

For linux users the file is located in /home/XXX/.local/shared/plastic

This file will look like:

  
# PlasticSCM custom file types. 
# Syntax: <extension>:<type> 
# Type can be 'txt' or 'bin'.
# Examples:
#     .cpp:txt
#     .jpg:bin
.cpx:txt

3 comments:

  1. It doesn't work? I have added exceptions to the list, using both ".extension txt" and ".extension:txt" syntax and I still get "Unsupported file types for binary diff" error message.

    ReplyDelete
  2. did not work for me either, common practice of saving react components as .jsx comes up as binary, I changed in my filetypes.conf -> .jsx:txt but still comes up as binary :-(

    ReplyDelete
  3. If the file was already under version control you'll have to change the type manually (using the context menu on the items view).

    But new files being added will take this setting into account.

    ReplyDelete