So, there is a project that I forked, and then I worked on it in my own branch, and pushed to my own fork. So let's say the last/tip of the original project was revision 5000; when I started working in my branch I made revision 5001, and now at the end, my branch tip is at revision 5050.
Now, if I use
hg export 5001:5050
... I get all the changesets in a single patch, which is however signed. This is great, but it makes reading for review difficult.
If i use:
hg diff -r 5000:5050
... or just hg diff -r 5000
, I get all of the changes from all the changesets "collapsed" or "compressed" into a single changeset - this is great for reading for review, but does not include any signing, as in:
# HG changeset patch
# User username <user@e.mail>
# Date 1545633736 -3600
# Mon Dec 24 07:42:16 2018 +0100
...
... and does not include binary files, like hg export --git
does.
So, is it possible to get an output like hg export --git R1+1:R2
(which includes signatures and binary files) - however, where all changes are collapsed like in hg diff -r R1:R2
?
Note that I just want to generate a patch file, I do not want to mess with the history neither in my local copy of the fork, nor with the fork on the server - I mention this because I've seen With Mercurial, how can I "compress" a series of changesets into one before pushing?, and a lot of answers there talk about history rewriting and such...
EDIT: sort of got this with running these two commands in bash
:
hg export | head -9 > ../mybranch.5050.patch
hg diff --git -r 5000 >> ../mybranch.5050.patch
... however, clearly the hg export
header will be wrong, so I'd bet hg import
will refuse it... So it would still be nice to know, if there is a way to get something like this, that hg import
would accept...