Mercurial > hg
comparison hgext/convert/cvs.py @ 5304:b85f7cc133cc
convert: avoid interpreting Windows path as CVS connection strings.
CVS connection strings regexp detect colons to separate protocols from path and login. Unfortunately, Windows paths contains colons and were interpreted as rsh connection strings.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Fri, 14 Sep 2007 22:17:53 +0200 |
parents | a76c61679b71 |
children | 87348cdce88c |
comparison
equal
deleted
inserted
replaced
5303:a76c61679b71 | 5304:b85f7cc133cc |
---|---|
147 if not conntype: | 147 if not conntype: |
148 # :ext:user@host/home/user/path/to/cvsroot | 148 # :ext:user@host/home/user/path/to/cvsroot |
149 if root.startswith(":ext:"): | 149 if root.startswith(":ext:"): |
150 root = root[5:] | 150 root = root[5:] |
151 m = re.match(r'(?:([^@:/]+)@)?([^:/]+):?(.*)', root) | 151 m = re.match(r'(?:([^@:/]+)@)?([^:/]+):?(.*)', root) |
152 if not m: | 152 # Do not take Windows path "c:\foo\bar" for a connection strings |
153 if os.path.isdir(root) or not m: | |
153 conntype = "local" | 154 conntype = "local" |
154 else: | 155 else: |
155 conntype = "rsh" | 156 conntype = "rsh" |
156 user, host, root = m.group(1), m.group(2), m.group(3) | 157 user, host, root = m.group(1), m.group(2), m.group(3) |
157 | 158 |