git-hg plugin, problems with the patch.

Simon King simon at simonking.org.uk
Fri Sep 16 15:13:03 UTC 2016


On Fri, Sep 16, 2016 at 2:27 PM, Simon King <simon at simonking.org.uk> wrote:
> On Fri, Sep 16, 2016 at 1:55 PM, Uwe Brauer <oub at mat.ucm.es> wrote:
>>
>>    > On Fri, Sep 16, 2016 at 11:01 AM, Uwe Brauer <oub at mat.ucm.es> wrote:
>>
>>    > If you look at mypatch.patch here, you'll see that it actually
>>    > contains multiple patches, one for each revision that you specified.
>>    > If you look at the help for "hg export", you'll see that the "-o"
>>    > option is meant to specify a *format string*, such as
>>    > "mypatch.patch.%n".
>>
>>
>>    > "hg import" expects the file to only contain a single patch. I don't
>>    > know the patch format well enought to know if it is possible to detect
>>    > that the file contains multiple patches, but for the moment at least,
>>    > "hg import" has tried to apply what is effectively a single corrupt
>>    > patch.
>>
>>    > If you use the suggested format string for "hg export", you will get 5
>>    > patch files which you can import individually.
>>
>> Thanks a lot, but I beg to differ.
>>
>> I did run a test.
>>
>>
>> In dir orgin I run create-repo-orgin.sh which creates a repo with 5
>> commit containing one branch
>>
>> I run hg export -r 1::3 -o mybranch.patch
>>
>> In dir target I run create-repo-target.sh
>> which create a similar repo but without that branch
>>
>>
>>
>>  and then
>>
>>  hg import mybranch.patch
>>
>> And everything works as expected.
>>
>> So the patch I mentioned must be somehow corrupt.....
>>
>
> Sorry, you're right. "hg import" does indeed handle multiple patches
> in the same file.
>
> The auctex repo isn't loading for me at the moment so I can't check,
> but has anyone modified auctex.texi since you made your changes? That
> would be one reason for the patch not applying.
>
> Also, I noticed that the attachments on your previous email had CRLF
> line endings. Have you somehow ended up in a situation where your
> patch has one style of line endings but the files you are trying to
> apply them to have a different style?
>

Ah, your "hg export" is still missing one of your changes. You didn't
include 6846, which modified that same file. This is likely to be the
reason why the patch doesn't apply.

Simon



More information about the Mercurial mailing list