mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2026-03-22 17:41:29 +01:00
Encode hg urls
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user