mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-10-27 22:56:08 +01:00
helper: adjust for hg 6.1
mercurial.util.url became mercurial.utils.urlutil.url in 5.8.
This commit is contained in:
committed by
Mark Nauwelaerts
parent
ebd5bdb111
commit
dfa3ad5fca
@@ -5,6 +5,11 @@
|
|||||||
|
|
||||||
from mercurial import hg, ui, commands, util
|
from mercurial import hg, ui, commands, util
|
||||||
from mercurial import context, subrepo
|
from mercurial import context, subrepo
|
||||||
|
try:
|
||||||
|
# hg >= 5.8
|
||||||
|
from mercurial.utils import urlutil
|
||||||
|
except ImportError:
|
||||||
|
from mercurial import util as urlutil
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
@@ -308,11 +313,11 @@ class GitHgRepo:
|
|||||||
if not kind in (b'hg', b'git'):
|
if not kind in (b'hg', b'git'):
|
||||||
warn('skipping unsupported subrepo type %s' % kind)
|
warn('skipping unsupported subrepo type %s' % kind)
|
||||||
continue
|
continue
|
||||||
if not util.url(src).isabs():
|
if not urlutil.url(src).isabs():
|
||||||
parent = self.get_hg_repo_url(remote)
|
parent = self.get_hg_repo_url(remote)
|
||||||
if not parent:
|
if not parent:
|
||||||
die(b'could not determine repo url of %s' % remote)
|
die(b'could not determine repo url of %s' % remote)
|
||||||
parent = util.url(parent)
|
parent = urlutil.url(parent)
|
||||||
parent.path = posixpath.join(parent.path or b'', src)
|
parent.path = posixpath.join(parent.path or b'', src)
|
||||||
parent.path = posixpath.normpath(parent.path)
|
parent.path = posixpath.normpath(parent.path)
|
||||||
src = bytes(parent)
|
src = bytes(parent)
|
||||||
|
|||||||
Reference in New Issue
Block a user