contrib/hg-ssh
changeset 47620 724066f23e2d
parent 45830 c102b704edb5
child 48875 6000f5b25c9b
equal deleted inserted replaced
47619:f0fbe8f4faa6 47620:724066f23e2d
    29 command="hg-ssh --read-only repos/*"
    29 command="hg-ssh --read-only repos/*"
    30 """
    30 """
    31 from __future__ import absolute_import
    31 from __future__ import absolute_import
    32 
    32 
    33 import os
    33 import os
       
    34 import re
    34 import shlex
    35 import shlex
    35 import sys
    36 import sys
    36 
    37 
    37 # enable importing on demand to reduce startup time
    38 # enable importing on demand to reduce startup time
    38 import hgdemandimport
    39 import hgdemandimport
    49 def main():
    50 def main():
    50     # Prevent insertion/deletion of CRs
    51     # Prevent insertion/deletion of CRs
    51     dispatch.initstdio()
    52     dispatch.initstdio()
    52 
    53 
    53     cwd = os.getcwd()
    54     cwd = os.getcwd()
       
    55     if os.name == 'nt':
       
    56         # os.getcwd() is inconsistent on the capitalization of the drive
       
    57         # letter, so adjust it. see https://bugs.python.org/issue40368
       
    58         if re.match('^[a-z]:', cwd):
       
    59             cwd = cwd[0:1].upper() + cwd[1:]
       
    60 
    54     readonly = False
    61     readonly = False
    55     args = sys.argv[1:]
    62     args = sys.argv[1:]
    56     while len(args):
    63     while len(args):
    57         if args[0] == '--read-only':
    64         if args[0] == '--read-only':
    58             readonly = True
    65             readonly = True