Restore use of $LP_ENABLE_HG_OUTGOING
Restore some changes from official branch.