Give a response to unknown SSH commands
authorMatt Mackall <mpm@selenic.com>
Sun, 04 Jun 2006 18:05:52 +0100
changeset 2363 fa4c11751367
parent 2362 482d3fb47d80
child 2397 e9d402506514
Give a response to unknown SSH commands
mercurial/commands.py
--- a/mercurial/commands.py	Thu Jun 01 19:08:29 2006 +0200
+++ b/mercurial/commands.py	Sun Jun 04 18:05:52 2006 +0100
@@ -2476,13 +2476,13 @@
             cmd = fin.readline()[:-1]
             if cmd == '':
                 return
-            if cmd == "heads":
+            elif cmd == "heads":
                 h = repo.heads()
                 respond(" ".join(map(hex, h)) + "\n")
-            if cmd == "lock":
+            elif cmd == "lock":
                 lock = repo.lock()
                 respond("")
-            if cmd == "unlock":
+            elif cmd == "unlock":
                 if lock:
                     lock.release()
                 lock = None
@@ -2524,6 +2524,9 @@
                 r = repo.addchangegroup(fin, 'serve')
                 respond(str(r))
 
+            else:
+                respond("")
+
     optlist = ("name templates style address port ipv6"
                " accesslog errorlog webdir_conf")
     for o in optlist.split():