phabricator: rework phabread to reduce memory usage and round-trips
This patch reworked phabread a bit so it fetches the lightweight
"Differential Revision" metadata for a stack first. Then read other data.
This allows the code to:
a) send 1 request to get all `hg:meta` data instead of N requests
b) patches are read in desired order, no need to buffer the output
"b)" reduces the memory usage from O(N^2) to O(N) since we no longer keep
old patch contents in memory.
The above `N` means the number of patches in the stack.
== Local
Ready.
Un and Deux
Eins und Zwei
One and Two
Nope
Eins und Zwei
Hello, John Smith
Ready.
Uno und Due
== Remote
Ready.
REQ: foo?one=Vo&two=Efvy
-> Vo!boe!Efvy
Un and Deux
REQ: bar?b=Fjot&a=[xfj
-> Fjot!voe![xfj
Eins und Zwei
REQ: batch?cmds=foo:one=Pof,two=Uxp;bar:b=Fjot,a=[xfj
-> Pof!boe!Uxp;Fjot!voe![xfj
REQ: greet?name=Kpio!Tnjui
-> Ifmmp-!Kpio!Tnjui
REQ: batch?cmds=bar:b=Vop,a=Evf
-> Vop!voe!Evf
One and Two
Nope
Eins und Zwei
Hello, John Smith
Ready.
Uno und Due