mercurial/commands.py
changeset 50444 45c7bada5200
parent 50437 3a2df812e1c7
child 50715 0ab3956540a6
equal deleted inserted replaced
50443:afb27fc92717 50444:45c7bada5200
    67     vfs as vfsmod,
    67     vfs as vfsmod,
    68     wireprotoserver,
    68     wireprotoserver,
    69 )
    69 )
    70 from .utils import (
    70 from .utils import (
    71     dateutil,
    71     dateutil,
       
    72     procutil,
    72     stringutil,
    73     stringutil,
    73     urlutil,
    74     urlutil,
    74 )
    75 )
    75 
    76 
    76 table = {}
    77 table = {}
  6670     if opts[b"stdio"]:
  6671     if opts[b"stdio"]:
  6671         if repo is None:
  6672         if repo is None:
  6672             raise error.RepoError(
  6673             raise error.RepoError(
  6673                 _(b"there is no Mercurial repository here (.hg not found)")
  6674                 _(b"there is no Mercurial repository here (.hg not found)")
  6674             )
  6675             )
  6675         s = wireprotoserver.sshserver(ui, repo)
  6676         accesshidden = False
       
  6677         if repo.filtername is None:
       
  6678             allow = ui.configlist(
       
  6679                 b'experimental', b'server.allow-hidden-access'
       
  6680             )
       
  6681             user = procutil.getuser()
       
  6682             if allow and scmutil.ismember(ui, user, allow):
       
  6683                 accesshidden = True
       
  6684             else:
       
  6685                 msg = (
       
  6686                     _(
       
  6687                         b'ignoring request to access hidden changeset by '
       
  6688                         b'unauthorized user: %s\n'
       
  6689                     )
       
  6690                     % user
       
  6691                 )
       
  6692                 ui.warn(msg)
       
  6693 
       
  6694         s = wireprotoserver.sshserver(ui, repo, accesshidden=accesshidden)
  6676         s.serve_forever()
  6695         s.serve_forever()
  6677         return
  6696         return
  6678 
  6697 
  6679     service = server.createservice(ui, repo, opts)
  6698     service = server.createservice(ui, repo, opts)
  6680     return server.runservice(opts, initfn=service.init, runfn=service.run)
  6699     return server.runservice(opts, initfn=service.init, runfn=service.run)