Skip to content

Commit 83a1fe0

Browse files
committed
Remove limitation for URL-based repositories
1 parent 57374b1 commit 83a1fe0

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

mbed/mbed.py

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -948,34 +948,33 @@ def clone(self, url, path, depth=None, protocol=None, **kwargs):
948948
sorted_scms = sorted(sorted_scms, key=lambda (m, _): not m)
949949

950950
for _, scm in sorted_scms:
951-
if scm.isurl(formaturl(url, 'https')):
952-
main = True
953-
cache = self.get_cache(url)
954-
955-
# Try to clone with cache ref first
956-
if cache:
957-
try:
958-
scm.clone(url, path, depth=depth, protocol=protocol, cache=cache, **kwargs)
959-
main = False
960-
except ProcessException, e:
961-
if os.path.isdir(path):
962-
rmtree_readonly(path)
963-
964-
# Main clone routine if the clone with cache ref failed (might occur if cache ref is dirty)
965-
if main:
966-
try:
967-
scm.clone(url, path, depth=depth, protocol=protocol, **kwargs)
968-
except ProcessException:
969-
if os.path.isdir(path):
970-
rmtree_readonly(path)
971-
continue
972-
973-
self.scm = scm
974-
self.url = url
975-
self.path = os.path.abspath(path)
976-
self.ignores()
977-
self.set_cache(url)
978-
return True
951+
main = True
952+
cache = self.get_cache(url)
953+
954+
# Try to clone with cache ref first
955+
if cache:
956+
try:
957+
scm.clone(url, path, depth=depth, protocol=protocol, cache=cache, **kwargs)
958+
main = False
959+
except ProcessException, e:
960+
if os.path.isdir(path):
961+
rmtree_readonly(path)
962+
963+
# Main clone routine if the clone with cache ref failed (might occur if cache ref is dirty)
964+
if main:
965+
try:
966+
scm.clone(url, path, depth=depth, protocol=protocol, **kwargs)
967+
except ProcessException:
968+
if os.path.isdir(path):
969+
rmtree_readonly(path)
970+
continue
971+
972+
self.scm = scm
973+
self.url = url
974+
self.path = os.path.abspath(path)
975+
self.ignores()
976+
self.set_cache(url)
977+
return True
979978
else:
980979
return False
981980

0 commit comments

Comments
 (0)