src/refresh-auth
branchdebian
changeset 229 3a28047ec6dc
parent 217 32b431977bf9
child 242 03d8f07230b3
equal deleted inserted replaced
228:f98f716b2ae8 229:3a28047ec6dc
     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 config.initExe()
       
    18 
    17 # To protect the authorized_keys file for innocent users, you have to have
    19 # To protect the authorized_keys file for innocent users, you have to have
    18 # a ~/.mercurial-server file to run this.
    20 # a ~/.mercurial-server file to run this.
    19 if not paths.configExists():
    21 if not config.configExists():
    20     print >>sys.stderr, "Must be run as the 'hg' user"
    22     print >>sys.stderr, "Must be run as the 'hg' user"
    21     sys.exit(-1)
    23     sys.exit(-1)
    22 
    24 
    23 paths.setExePath()
       
    24 refreshauth.refreshAuth()
    25 refreshauth.refreshAuth()