recode text files in repo

Victor Sudakov vas at mpeks.tomsk.su
Wed Aug 28 02:04:18 UTC 2019


Anton Shestakov wrote:

[dd]
> >
> > It does not. It turned out that the result of "hg export" cannot be
> > easily "hg import"-ed, because "hg import" tries to commit and generates
> > errors.
> >
> 
> I've tried to see what errors it generates and this minimalistic example
> worked:
> 
> hg init repo-koi8 && cd repo-koi8
> echo 'фальшивый экземпляр' | iconv -t koi8 - -o koi8.txt
> hg ci -qAm 0
> hg export -o ../koi8.patch
> 
> cd ..
> iconv -f koi8 koi8.patch -o utf8.patch
> 
> hg init repo-utf8 && cd repo-utf8
> hg import ../utf8.patch

For some reason, your minimalistic example does not work for me (even
without any recoding) if there are several commits:

$ hg init repo1 ; cd repo1
$ fortune > test.txt ; hg commit -A -m test
adding test.txt
$ fortune > test.txt ; hg commit -A -m test
$ fortune > test.txt ; hg commit -A -m test
$ fortune > test.txt ; hg commit -A -m test
$ hg export -o ../1.patch
$ cd ..
$ hg init repo2 ; cd repo2
$ hg import ../1.patch
applying ../1.patch
unable to find 'test.txt' for patching
(use '--prefix' to apply patch relative to the current directory)
1 out of 1 hunks FAILED -- saving rejects to file test.txt.rej
abort: patch failed to apply
$
$ hg import --bypass ../1.patch
applying ../1.patch
unable to find 'test.txt' for patching
(use '--prefix' to apply patch relative to the current directory)
abort: patch failed to apply
$


What am I doing wrong? Can you try your example if you already have
several commits in repo-koi8?


-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49 at fidonet http://vas.tomsk.ru/



More information about the Mercurial mailing list