What's better than having to parse patch files? Not having to parse
them.
The current text-based patch file format used by hg export is good
for humans to exchange. But for machines, it is better to use a
data format that is more structured.
We recently introduced support for CBOR. CBOR is a great, binary
preserving data format (unlike JSON), and I think we should use it
heavily for data interchange.
This commit teaches hg export to write data to CBOR. It adds a
--format argument. Hopefully this is the most controversial part of
this patch. I thought about using --template/-T. We already have
-Tjson. -Tcbor seems like a reasonable feature addition. That might
be the right way forward. I'm not sure. I didn't want to scope bloat
the patch. At least not initially. (The code for exporting a patch
is a bit wonky and I'm not very comfortable with the templating
layer.)