Encode hg urls

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Felipe Contreras
2022-08-05 18:47:54 -05:00
parent ccee8909ff
commit 8c3cde6be7

View File

@@ -423,6 +423,8 @@ def get_repo(url, alias):
extensions.loadall(myui)
url = url.encode()
if hg.islocal(url) and not os.environ.get('GIT_REMOTE_HG_TEST_REMOTE'):
repo = hg.repository(myui, url)
if not os.path.exists(dirname):
@@ -444,7 +446,7 @@ def get_repo(url, alias):
# setup shared repo (if not there)
try:
hg.peer(myui, {}, shared_path, create=True)
hg.peer(myui, {}, shared_path.encode(), create=True)
except error.RepoError:
pass
@@ -453,12 +455,12 @@ def get_repo(url, alias):
local_path = os.path.join(dirname, 'clone')
if not os.path.exists(local_path):
hg.share(myui, shared_path, local_path, update=False)
hg.share(myui, shared_path.encode(), local_path.encode(), update=False)
else:
# make sure the shared path is always up-to-date
util.writefile(os.path.join(local_path, '.hg', 'sharedpath'), hg_path)
util.writefile(os.path.join(local_path, '.hg', 'sharedpath').encode(), hg_path.encode())
repo = hg.repository(myui, local_path)
repo = hg.repository(myui, local_path.encode())
try:
peer = hg.peer(repo.ui, {}, url)
except: