From b0380393f234a5b38c0c607e758b711c1ee0a6fa Mon Sep 17 00:00:00 2001 From: Jun Wu Date: Wed, 20 Jul 2016 20:09:29 +0100 Subject: [PATCH] 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 --- hgext3rd/phrevset.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hgext3rd/phrevset.py b/hgext3rd/phrevset.py index cc81404522..6bf6fed63d 100644 --- a/hgext3rd/phrevset.py +++ b/hgext3rd/phrevset.py @@ -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