rebase: keep original mq patch format (Issue1574)
Rebase now doesn't make assumptions about which format has been
used for a mq patch (git or normal).
Before finalizing a patch it keeps track of the original format,
by reading its header, and then restores the format when reimporting
it.
This way it also allows for having mixed styles.
Note: this version corrects a failure in the test
adding a
now at: a.patch
applying b.patch
applying c.patch
now at: c.patch
now at: b.patch
% Using index
now at: a.patch
applying b.patch
applying c.patch
now at: c.patch
% No warnings when using index
now at: b.patch
applying c.patch
applying bug314159
now at: bug314159
% Detect ambiguous non-index
patch name "14" is ambiguous:
bug314159
bug141421
abort: patch 14 not in series