serve: inline checkrepo() that is used only when --stdio is specified
authorYuya Nishihara <yuya@tcha.org>
Thu, 01 May 2014 19:54:43 +0900
changeset 21818 448714b79d9a
parent 21817 6b0275e5f276
child 21819 816754e75f2f
serve: inline checkrepo() that is used only when --stdio is specified Since e811b93f2cb1, --cmdserver is allowed to start without repository, so checkrepo() function is meaningless.
mercurial/commands.py
--- a/mercurial/commands.py	Sat Jun 28 13:02:44 2014 +0900
+++ b/mercurial/commands.py	Thu May 01 19:54:43 2014 +0900
@@ -5245,13 +5245,10 @@
     if opts["stdio"] and opts["cmdserver"]:
         raise util.Abort(_("cannot use --stdio with --cmdserver"))
 
-    def checkrepo():
+    if opts["stdio"]:
         if repo is None:
             raise error.RepoError(_("there is no Mercurial repository here"
                               " (.hg not found)"))
-
-    if opts["stdio"]:
-        checkrepo()
         s = sshserver.sshserver(ui, repo)
         s.serve_forever()