comparison mercurial/commands.py @ 2363:fa4c11751367

Give a response to unknown SSH commands
author Matt Mackall <mpm@selenic.com>
date Sun, 04 Jun 2006 18:05:52 +0100
parents 482d3fb47d80
children e9d402506514
comparison
equal deleted inserted replaced
2362:482d3fb47d80 2363:fa4c11751367
2474 2474
2475 while 1: 2475 while 1:
2476 cmd = fin.readline()[:-1] 2476 cmd = fin.readline()[:-1]
2477 if cmd == '': 2477 if cmd == '':
2478 return 2478 return
2479 if cmd == "heads": 2479 elif cmd == "heads":
2480 h = repo.heads() 2480 h = repo.heads()
2481 respond(" ".join(map(hex, h)) + "\n") 2481 respond(" ".join(map(hex, h)) + "\n")
2482 if cmd == "lock": 2482 elif cmd == "lock":
2483 lock = repo.lock() 2483 lock = repo.lock()
2484 respond("") 2484 respond("")
2485 if cmd == "unlock": 2485 elif cmd == "unlock":
2486 if lock: 2486 if lock:
2487 lock.release() 2487 lock.release()
2488 lock = None 2488 lock = None
2489 respond("") 2489 respond("")
2490 elif cmd == "branches": 2490 elif cmd == "branches":
2521 continue 2521 continue
2522 respond("") 2522 respond("")
2523 2523
2524 r = repo.addchangegroup(fin, 'serve') 2524 r = repo.addchangegroup(fin, 'serve')
2525 respond(str(r)) 2525 respond(str(r))
2526
2527 else:
2528 respond("")
2526 2529
2527 optlist = ("name templates style address port ipv6" 2530 optlist = ("name templates style address port ipv6"
2528 " accesslog errorlog webdir_conf") 2531 " accesslog errorlog webdir_conf")
2529 for o in optlist.split(): 2532 for o in optlist.split():
2530 if opts[o]: 2533 if opts[o]: