phrevset: do not depend on hgsubversion

Summary:
`import hgsubversion` can error out if demandimport is disabled and svn
bindings are not found. In that case, we should be able to continue and
just skip handling svn revisions.

Test Plan: Code review

Reviewers: #mercurial, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3594810

Signature: t1:3594810:1469042572:3f9ab69f5503f6925f455769a78dac42a47087de
This commit is contained in:
Jun Wu 2016-07-20 20:09:29 +01:00
parent eafe319549
commit b0380393f2

View File

@ -29,7 +29,10 @@ from mercurial import error
from mercurial import util as hgutil
from mercurial.i18n import _
from hgsubversion import util as svnutil
try:
from hgsubversion import util as svnutil
except ImportError:
svnutil = None
import os
import signal
@ -188,7 +191,7 @@ def revsetdiff(repo, subset, diffid):
repo.ui.debug('[diffrev] VCS is %s\n' % vcs)
if vcs == 'svn':
if vcs == 'svn' and svnutil:
# commit has landed in svn, parse the description to get the SVN
# revision and delegate to hgsubversion for the rest