Jump to content

Switch to v4 has lost mapping of "cshtml" files as text


Recommended Posts

Hi there. I've only just noticed that now we're using v4 of Plastic SCM cshtml files are once again being seen as 'binary' rather than text. In v3 I remember permanently setting them to text.

The only way I can find of changing it is to manually change every single file. These are scattered throughout lots of sub folders, and it's a slow process. Also if I do it it doesn't seem to change anything for my colleagues. Plus, presumably, ever time we create a new one we'll have to switch it again.

I must be missing something because there's surely no way you wouldn't have some way of setting and resetting the revision on an extension basis. But for the life of me I can't find it.

Thanks.

Link to comment
Share on other sites

Hi, notken:

Plastic 4, uses a different local directory for the settings and preferences. It's under C:\Users\<user>\AppData\Local\plastic4 in windows or $HOME/.plastic4 in linux. In 3.0 this directory was called "plastic". This has been done to avoid re-use non compatible preferences between both versions in the same machine.

There you can create (or copy your old file) a filetypes.conf like this:

http://codicesoftware.blogspot.com/2008/03/custom-file-types.html

Hope this helps,

Luis

Link to comment
Share on other sites

A little bit. But it doesn't seem to behave retroactively. I've added .cshtml:txt to the file, but still all of my views are binary unless I manually change them. Do I take it this only affects new files I subsequently add to Plastic? Also it doesn't seem to have any affect on any other user. Do I really need to tell all my colleagues to add this entry to the filetypes.conf AND go through the entire solution finding every .cshtml file and changing it to text?

If so I really think this is something you should consider fixing for a future release. Or at the very least creating a thorough filetypes.conf file in the first place. We're weeks into using version 4 and have only just spotted it because we've had our first occasion of finding we need to merge some cshtml files. And as I've found to my cost, designers have a habit of just saying "use mine" when presented with what's apparently a binary file clash.

Or can't plastic just make a sensible guess at the file? FTP programs seem to make a pretty good guess at whether a file is binary or not.

Again, maybe I'm missing something here.

Link to comment
Share on other sites

For sure I can tell you that the filetypes.conf must be set up by every user, as it is a user configuration file.

Regarding the automatic detection you are right: the filetypes.conf will apply only for newly added files, but the existent files will still have the bin type. Fortunately you can change all the types in one single step using the crt command:

Changes all revision type of an item.

cm chgrevtype paths -type=type

paths: Item paths to change.

type: Target revisions type (bin, txt, ...)

Remarks:

This command only can be applied to files, not to directories.

The specified type must be a system supported one:

bin

txt

...

Examples:

cm chgrevtype c:\workspace\file.txt -type=txt

cm chgrevtype c:\workspace\file.txt -type=bin

Or even execute a dir /S and redirect the standard input to the crt command in a pipe, something like:

dir /S mydir\*.cshtml | cm crt -type=txt

We implemented a mechanism to automatically detect text files; sadly it's not ready yet in Plastic SCM 4.0, but I'll try to move things forward to get it integrated in the next public release.

So, you're right and we have a good solution for most of your problems; sadly you'll have to set up a filetypes.conf in every machine. Maybe you can create a pattern file and share it with all the team, asking them to set it up in their workstations.

Best,

Luis

Link to comment
Share on other sites

No problem notken,

I think the hacker command Luis gave us will do the work.

dir /S mydir\*.cshtml | cm crt -type=txt

Although I really like the command I also think we have to improve the file type detection, actually it's better in 3.0 than in 4.0. We have to merge the old task into 4.1.

Link to comment
Share on other sites

  • 3 weeks later...

Archived

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

×
×
  • Create New...