helper: adjust to Mercurial 4.6 wrt subrepo helper functions

... now in a separate module as of 55e8efa2451a0999b56978e471dc31dc8066a0fb
This commit is contained in:
Mark Nauwelaerts
2018-05-14 21:22:43 +02:00
parent 679e016943
commit ad36a25064

View File

@@ -239,7 +239,12 @@ class GitHgRepo:
if not repo:
die('no hg repo for alias %s' % remote)
ctx = self.dictmemctx(repo, files)
state = subrepo.state(ctx, ui.ui())
# helpers moved around 4.6
if hasattr(subrepo, 'state'):
state = subrepo.state(ctx, ui.ui())
else:
from mercurial import subrepoutil
state = subrepoutil.state(ctx, ui.ui())
log('obtained state %s', state)
# now filter on type and resolve relative urls