src/refresh-auth
changeset 211 0cd59649772c
parent 165 3606d60b07e5
child 217 32b431977bf9
equal deleted inserted replaced
208:31e862df1884 211:0cd59649772c
     6 # file every time it is run
     6 # file every time it is run
     7 # WARNING
     7 # WARNING
     8 
     8 
     9 import sys
     9 import sys
    10 import os
    10 import os
    11 from mercurialserver import refreshauth, paths
    11 from mercurialserver import refreshauth, config
    12 
    12 
    13 if len(sys.argv) != 1:
    13 if len(sys.argv) != 1:
    14     sys.stderr.write("refresh-auth: must be called with no arguments (%s)\n" % sys.argv)
    14     sys.stderr.write("refresh-auth: must be called with no arguments (%s)\n" % sys.argv)
    15     sys.exit(-1)
    15     sys.exit(-1)
    16 
    16 
    17 # To protect the authorized_keys file for innocent users, you have to have
    17 # To protect the authorized_keys file for innocent users, you have to have
    18 # a ~/.mercurial-server file to run this.
    18 # a ~/.mercurial-server file to run this.
    19 if not paths.configExists():
    19 if not config.configExists():
    20     print >>sys.stderr, "Must be run as the 'hg' user"
    20     print >>sys.stderr, "Must be run as the 'hg' user"
    21     sys.exit(-1)
    21     sys.exit(-1)
    22 
    22 
    23 paths.setExePath()
    23 config.setExePath()
    24 refreshauth.refreshAuth()
    24 refreshauth.refreshAuth()