From patchwork Wed Jul 1 20:05:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [7, of, 9, remotefilelog-ext, getfile-http] fileserverclient: refuse to operate on a non-sshpeer From: Augie Fackler X-Patchwork-Id: 9858 Message-Id: To: durham@fb.com Cc: mercurial-devel@selenic.com Date: Wed, 01 Jul 2015 16:05:44 -0400 # HG changeset patch # User Augie Fackler # Date 1435609544 14400 # Mon Jun 29 16:25:44 2015 -0400 # Node ID d95d09694be01c8423372350ac9bffa876383e0e # Parent 5e58703e43ff3ce67f212de4c4cbc4231b0cf526 fileserverclient: refuse to operate on a non-sshpeer The way the protocol is defined for getfiles interleaves reading filenames and sending file contents, which works fine over ssh but is incompatible with http. This change is probably not neccessary now that remotefilelog correctly checks for its own capability first, but it helped me debug so I left it in for completeness. diff --git a/remotefilelog/fileserverclient.py b/remotefilelog/fileserverclient.py --- a/remotefilelog/fileserverclient.py +++ b/remotefilelog/fileserverclient.py @@ -177,6 +177,8 @@ class fileserverclient(object): if not remote.capable("remotefilelog"): raise util.Abort("configured remotefilelog server" " does not support remotefilelog") + if not isinstance(remote, sshpeer.sshpeer): + raise util.Abort('remotefilelog requires ssh servers') remote._callstream("getfiles") finally: self.ui.verbose = verbose