builtin-am: support and auto-detect mercurial patches
authorPaul Tan <pyokagan@gmail.com>
Tue, 4 Aug 2015 13:52:02 +0000 (21:52 +0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Aug 2015 05:02:11 +0000 (22:02 -0700)
commit94cd175cff196d2571bc2e17ad8e9f47ef4b3911
treee37d5045c7009b5680329ea2a5028e86989bb399
parent336108c1563c23e1af5b7b7e6fbe52f511c21748
builtin-am: support and auto-detect mercurial patches

Since 0cfd112 (am: preliminary support for hg patches, 2011-08-29),
git-am.sh could convert mercurial patches to an RFC2822 mail patch
suitable for parsing with git-mailinfo, and queue them in the state
directory for application.

Since 15ced75 (git-am foreign patch support: autodetect some patch
formats, 2009-05-27), git-am.sh was able to auto-detect mercurial
patches by checking if the file begins with the line:

# HG changeset patch

Re-implement the above in builtin/am.c.

Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c