diff --git a/remotefilelog/remotefilelogserver.py b/remotefilelog/remotefilelogserver.py --- a/remotefilelog/remotefilelogserver.py +++ b/remotefilelog/remotefilelogserver.py @@ -7,7 +7,8 @@ from __future__ import absolute_import from mercurial import wireproto, changegroup, match, util, changelog, context -from mercurial import exchange, store, error +from mercurial import store, error +from mercurial import streamclone from mercurial.extensions import wrapfunction from mercurial.node import bin, hex, nullid, nullrev from mercurial.i18n import _ @@ -28,13 +29,6 @@ _sshv1server = wireprotoserver.sshv1protocolhandler try: - from mercurial import streamclone - streamclone._walkstreamfiles - hasstreamclone = True -except Exception: - hasstreamclone = False - -try: # hg 4.6 and later from mercurial import wireprotoserver as httpprotocol httpprotocol.HTTP_OK # force demandimport @@ -183,13 +177,7 @@ for x in orig(repo): yield x - # This function moved in Mercurial 3.5 and 3.6 - if hasstreamclone: - wrapfunction(streamclone, '_walkstreamfiles', _walkstreamfiles) - elif util.safehasattr(wireproto, '_walkstreamfiles'): - wrapfunction(wireproto, '_walkstreamfiles', _walkstreamfiles) - else: - wrapfunction(exchange, '_walkstreamfiles', _walkstreamfiles) + wrapfunction(streamclone, '_walkstreamfiles', _walkstreamfiles) # We no longer use getbundle_shallow commands, but we must still # support it for migration purposes