Skip to content
Snippets Groups Projects
Commit 233623d5 authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

push: move discovery in its own function

Now that every necessary information is held in the `pushoperation` object, we
can extract the discovery logic to it's own function.

This changeset is pure code movement only.
parent 170f7106
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,6 @@
if not pushop.remote.canpush():
raise util.Abort(_("destination does not support push"))
unfi = pushop.repo.unfiltered()
# get local lock as we might write phase data
locallock = None
try:
......@@ -100,17 +99,7 @@
if not unbundle:
lock = pushop.remote.lock()
try:
# discovery
fci = discovery.findcommonincoming
commoninc = fci(unfi, pushop.remote, force=pushop.force)
common, inc, remoteheads = commoninc
fco = discovery.findcommonoutgoing
outgoing = fco(unfi, pushop.remote, onlyheads=pushop.revs,
commoninc=commoninc, force=pushop.force)
pushop.outgoing = outgoing
pushop.remoteheads = remoteheads
pushop.incoming = inc
_pushdiscovery(pushop)
if _pushcheckoutgoing(pushop):
_pushchangeset(pushop)
_pushsyncphase(pushop)
......@@ -125,6 +114,19 @@
_pushbookmark(pushop)
return pushop.ret
def _pushdiscovery(pushop):
# discovery
unfi = pushop.repo.unfiltered()
fci = discovery.findcommonincoming
commoninc = fci(unfi, pushop.remote, force=pushop.force)
common, inc, remoteheads = commoninc
fco = discovery.findcommonoutgoing
outgoing = fco(unfi, pushop.remote, onlyheads=pushop.revs,
commoninc=commoninc, force=pushop.force)
pushop.outgoing = outgoing
pushop.remoteheads = remoteheads
pushop.incoming = inc
def _pushcheckoutgoing(pushop):
outgoing = pushop.outgoing
unfi = pushop.repo.unfiltered()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment