3

Our team are using mercurial both on Windows and Linux, and many members have their own customized .hgrc files in their home directories in order to convert source code;
We're using .hgrc files (in home directory) with non-empty [encode]/[decode] sections.

Recently, we created a new repository for a project in which encoding of text files plays a key role. We have multiple files with same extension, in various encoding forms. (e.g., .html files in Shift-JIS, euc-japan-unix, utf8, and so on.)

In order to preserve encoding forms in this repository, we want to unset all names in a section.

Currently, we are dealing with this issue by listing all extension names that may be listed in .hgrc file in home directories, in hgrc file of the project.

So our hgrc file looks like this:

[encode]
%unset **.js
%unset **.txt
%unset **.html

[decode]
%unset **.js
%unset **.txt
%unset **.html

This method works, but is painful. (we might have to add more extension names to unset in the future.) Is there any way to unset all names in a section, without pain?

  • Do you use editors which *change* the encoding or line endings of existing files? If not, then I don't see how those sections are needed at all... They are only needed if you want to commit them with a different encoding than you work on them. If your editors are bad or badly configured, I suggest to change rather those... – planetmaker Nov 09 '15 at 09:21
  • Thank you for your comment. We don't use such editors, but our legacy system to build c++ programs, which runs on our Linux server, does not allow us to discard our (somewhat dirty) `.hgrc` files in our home directory. – Kota Ishihara Nov 09 '15 at 10:59

0 Answers0