localrepo: refactor prepush logic
Simplifies the prepush check logic and makes it a lot more direct and
comprehensible. Instead of comparing the total local vs. remote head count, it
compares the number of new vs. removed heads.
% test default params, display nothing because of delay
% test with delay=0, refresh=0
loop [ ] 0/3
loop [=====================> ] 1/3
loop [============================================> ] 2/3
% test refresh is taken in account
% test format options 1
0/2 loop lo
1/2 loop lo
% test format options 2
0/2 p.0 [ ]
1/2 p.1 [=================================> ]
% test format options and indeterminate progress
0 loop.0 [ <=> ]
1 loop.1 [ <=> ]
% test immediate progress completion