exchangev2: fetch and apply phases data
Now that the server supports emitting phases data, we can request it
and apply it on the client.
Because we may receive phases-only updates from the server, we no
longer conditionally perform the "changesetdata" command depending
on whether there are revisions to fetch. In the previous wire
protocol, this case would result in us falling back to performing
"listkeys" commands to look up phases, bookmarks, etc data. But
since "changesetdata" is smart enough to handle metadata only
fetches, we can keep things consistent.
It's worth noting that because of the unified approach to changeset
data retrieval, phase handling code in wire proto v2 exchange is
drastically simpler. Contrast with all the code in exchange.py
dealing with all the variations for obtaining phases data.
Differential Revision: https://phab.mercurial-scm.org/D4484
from __future__ import absolute_import
from mercurial.utils import (
procutil,
)
# XXX: we should probably offer a devel option to do this in blackbox directly
def getuser():
return b'bob'
def getpid():
return 5000
# mock the date and user apis so the output is always the same
def uisetup(ui):
procutil.getuser = getuser
procutil.getpid = getpid