recode text files in repo

Victor Sudakov vas at mpeks.tomsk.su
Wed Aug 28 09:07:00 UTC 2019


Anton Shestakov wrote:
> ср, 28 авг. 2019 г. в 02:08, Victor Sudakov <vas at mpeks.tomsk.su>:
> 
> > 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
> 
> 
> Okay, but what do you want 1.patch to do though? As it is in this example,
> 1.patch reflects what the last commit (rev 3) did

Now I see, my example was incorrect. Of course 1.patch should contain all
changesets from the very start to the tip. If I correct the "hg export" line
to contain all the patches ("hg export -r 0:tip -o ../1.patch") 
it looks like your recipe works in a test environment.

However, on a real repo it fails:

$ cd realrepo
$ env LANG=ru_RU.KOI8-R hg export -o ~/tmp/1.patch -r0:91
$ iconv -f koi8-r -t utf-8 < ~/tmp/1.patch > ~/tmp/2.patch
$ cd ~/tmp/
$ hg init test7 && cd test7
$ hg import ~/tmp/2.patch

and here it opens $HGEDITOR, why?

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



More information about the Mercurial mailing list