Re: [PATCH 1/2] am: preliminary support for hg patches
On Mon, Aug 29, 2011 at 11:05 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
>
>> Nope, it doesn't have index .... lines. Still, the patches seems to
>> apply correctly. Well, the couple of patches I tested did, at least,
>> even though they were marked as diff --git and they were lacking the
>> index ... lines.
>
> Does "am -3" do the right thing when the patch does not apply cleanly, for
> example?
three-way merges are impossible because all hash information is being stripped (hg stores them in the Node ID and Parent metadata, which we strip, and has no index metadata for the actual diff blocks). This is correctly detected by -3, with
Applying: Threeway test
fatal: sha1 information is lacking or useless (dir.h).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Threeway test
The message is a bit misleading (it's not the repo lacking the blobs, it's the patch missing the information), but the process fails as expected.
> What about renaming patches?
They lack similarity indices, but they seem to be properly formated (and the simple cases I tested apply correctly).
In fact, stripping the --git from an hg patch containing a rename makes the patch unusable:
error: datetime.move: does not exist in index Patch failed at 0001 Move
So I think that keeping the --git is the right choice.
--
Giuseppe "Oblomov" Bilotta