diff hggit/compat.py @ 1130:80664524802b

compat: add compatibility for 4.6 mercurial.utils
author Sean Farley <sean@farley.io>
date Thu, 24 May 2018 11:26:15 +0200
parents 8ed6c0cae9b8
children 8e03a8ba04af
line wrap: on
line diff
--- a/hggit/compat.py	Thu May 24 09:50:04 2018 +0200
+++ b/hggit/compat.py	Thu May 24 11:26:15 2018 +0200
@@ -37,6 +37,19 @@
     from mercurial import scmutil
     hgvfs = scmutil.vfs
 
+try:
+    from mercurial.utils import procutil, stringutil
+    sshargs = procutil.sshargs
+    shellquote = procutil.shellquote
+    quotecommand = procutil.quotecommand
+    binary = stringutil.binary
+except ImportError:
+    # these were moved in 4.6
+    sshargs = hgutil.sshargs
+    shellquote = hgutil.shellquote
+    quotecommand = hgutil.quotecommand
+    binary = hgutil.binary
+
 
 def gitvfs(repo):
     """return a vfs suitable to read git related data"""