changeset 7271:03dfcbe52906

hg: support sshpeer renaming to sshv1peer in Mercurial 4.6 This is only used for URL validation.
author Mads Kiilerich <mads@kiilerich.com>
date Fri, 11 May 2018 14:26:48 +0200
parents bc5e635afef7
children 61fd14c13e60
files kallithea/lib/vcs/utils/hgcompat.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/vcs/utils/hgcompat.py	Fri May 11 14:26:48 2018 +0200
+++ b/kallithea/lib/vcs/utils/hgcompat.py	Fri May 11 14:26:48 2018 +0200
@@ -26,7 +26,10 @@
 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