Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 21818:448714b79d9a
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.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 01 May 2014 19:54:43 +0900 |
parents | 6b0275e5f276 |
children | 816754e75f2f |
comparison
equal
deleted
inserted
replaced
21817:6b0275e5f276 | 21818:448714b79d9a |
---|---|
5243 """ | 5243 """ |
5244 | 5244 |
5245 if opts["stdio"] and opts["cmdserver"]: | 5245 if opts["stdio"] and opts["cmdserver"]: |
5246 raise util.Abort(_("cannot use --stdio with --cmdserver")) | 5246 raise util.Abort(_("cannot use --stdio with --cmdserver")) |
5247 | 5247 |
5248 def checkrepo(): | 5248 if opts["stdio"]: |
5249 if repo is None: | 5249 if repo is None: |
5250 raise error.RepoError(_("there is no Mercurial repository here" | 5250 raise error.RepoError(_("there is no Mercurial repository here" |
5251 " (.hg not found)")) | 5251 " (.hg not found)")) |
5252 | |
5253 if opts["stdio"]: | |
5254 checkrepo() | |
5255 s = sshserver.sshserver(ui, repo) | 5252 s = sshserver.sshserver(ui, repo) |
5256 s.serve_forever() | 5253 s.serve_forever() |
5257 | 5254 |
5258 if opts["cmdserver"]: | 5255 if opts["cmdserver"]: |
5259 s = commandserver.server(ui, repo, opts["cmdserver"]) | 5256 s = commandserver.server(ui, repo, opts["cmdserver"]) |