diff --git a/remotefilelog/fileserverclient.py b/remotefilelog/fileserverclient.py --- a/remotefilelog/fileserverclient.py +++ b/remotefilelog/fileserverclient.py @@ -61,13 +61,19 @@ return os.path.join(pathhash, id) def peersetup(ui, peer): + + try: + from mercurial.wireprotov1peer import future + except (ImportError, AttributeError): + from mercurial.wireproto import future + class remotefilepeer(peer.__class__): @batchable def getfile(self, file, node): if not self.capable('getfile'): raise error.Abort( 'configured remotefile server does not support getfile') - f = wireproto.future() + f = future() yield {'file': file, 'node': node}, f code, data = f.value.split('\0', 1) if int(code): @@ -79,7 +85,7 @@ if not self.capable('getflogheads'): raise error.Abort('configured remotefile server does not ' 'support getflogheads') - f = wireproto.future() + f = future() yield {'path': path}, f heads = f.value.split('\n') if f.value else [] yield heads