equal
deleted
inserted
replaced
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 |