diff mercurial/sshserver.py @ 25692:9f6e0e7ef828

sshserver: drop ancient do_{lock,unlock,addchangegroup} methods These were marked as deprecated and dangerous way back in e8c4f3d3df8c, which was first included in Mercurial 0.9.1. While it's possible that clients from that long ago are still around somewhere, they're risky for servers in that they want to lock the repo, and then might leave it locked if they died before finishing their transaction. Given that it's been 9 years, let's go ahead and cut this last lingering tie with a basically-untested protocol.
author Augie Fackler <augie@google.com>
date Mon, 29 Jun 2015 17:10:36 -0400
parents e2806b8613ca
children 72b36785d7f4
line wrap: on
line diff
--- a/mercurial/sshserver.py	Mon Jun 29 12:35:31 2015 -0400
+++ b/mercurial/sshserver.py	Mon Jun 29 17:10:36 2015 -0400
@@ -6,7 +6,7 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-import util, hook, wireproto, changegroup
+import util, hook, wireproto
 import os, sys
 
 class sshserver(wireproto.abstractserverproto):
@@ -120,33 +120,6 @@
             else: self.sendresponse("")
         return cmd != ''
 
-    def do_lock(self):
-        '''DEPRECATED - allowing remote client to lock repo is not safe'''
-
-        self.lock = self.repo.lock()
-        return ""
-
-    def do_unlock(self):
-        '''DEPRECATED'''
-
-        if self.lock:
-            self.lock.release()
-        self.lock = None
-        return ""
-
-    def do_addchangegroup(self):
-        '''DEPRECATED'''
-
-        if not self.lock:
-            self.sendresponse("not locked")
-            return
-
-        self.sendresponse("")
-        cg = changegroup.cg1unpacker(self.fin, "UN")
-        r = changegroup.addchangegroup(self.repo, cg, 'serve', self._client())
-        self.lock.release()
-        return str(r)
-
     def _client(self):
         client = os.environ.get('SSH_CLIENT', '').split(' ', 1)[0]
         return 'remote:ssh:' + client