recode text files in repo

Steve Fink sphink at gmail.com
Tue Aug 27 04:08:38 UTC 2019


One way would be `hg convert` with a custom conversion script. See the
"Customization" example at the bottom of
<https://www.mercurial-scm.org/wiki/ConvertExtension>. It looks like
you could override only getfile(), and make it return modified data.

On Mon, Aug 26, 2019 at 2:13 AM Victor Sudakov <vas at mpeks.tomsk.su> wrote:
>
> Dear Colleagues,
>
> I have a mercurial repository with text files in Russian. At some point
> in time, I converted them from the KOI8-R encoding to UTF-8, and
> committed the converted files.
>
> Now I'm in an awkward position. To see the text files (and diffs) before
> the conversion point, I have to switch my locale and terminal settings
> back from UTF-8 to KOI8-R.
>
> Is there a way to hack the history or repository itself so that the
> files look like they have always been in the UTF-8 encoding, from the
> very beginning?
>
> I did this job once with CVS, recoding the ,v files in a text editor,
> but there were few of them, and they were plain text.
>
> --
> Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
> 2:5005/49 at fidonet http://vas.tomsk.ru/
> _______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial



More information about the Mercurial mailing list