# HG changeset patch # User Mads Kiilerich # Date 2018-05-11 14:26:48 # Node ID 03dfcbe52906693498320b6e00b34d62bd15611c # Parent bc5e635afef78a7790104cf8e8bced5e3871bf59 hg: support sshpeer renaming to sshv1peer in Mercurial 4.6 This is only used for URL validation. diff --git a/kallithea/lib/vcs/utils/hgcompat.py b/kallithea/lib/vcs/utils/hgcompat.py --- a/kallithea/lib/vcs/utils/hgcompat.py +++ b/kallithea/lib/vcs/utils/hgcompat.py @@ -26,7 +26,10 @@ from mercurial.encoding import tolocal from mercurial.discovery import findcommonoutgoing from mercurial.hg import peer from mercurial.httppeer import httppeer -from mercurial.sshpeer import sshpeer +try: # sshpeer was renamed in Mercurial 4.6 (625038cb4b1d), but v1 is still good enough + from mercurial.sshpeer import sshv1peer as sshpeer +except ImportError: + from mercurial.sshpeer import sshpeer from mercurial.util import url as hg_url from mercurial.scmutil import revrange from mercurial.node import nullrev