diff hgsubversion/wrappers.py @ 1551:22137e94411f

wrappers: cope with removal of text= kwarg on vfs Fixes #472.
author Augie Fackler <raf@durin42.com>
date Sat, 24 Mar 2018 15:16:11 -0400
parents 0212c3a84ccd
children cff81f35b31e
line wrap: on
line diff
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -688,7 +688,11 @@ def clone(orig, ui, source, dest=None, *
 
     if dstrepo.local() and srcrepo.capable('subversion'):
         dst = dstrepo.local()
-        fd = dst.vfs("hgrc", "a", text=True)
+        try:
+            # hg before 4.5 requires text=True here
+            fd = dst.vfs("hgrc", "a", text=True)
+        except TypeError:
+            fd = dst.vfs("hgrc", "a")
         preservesections = set(s for s, v in optionmap.itervalues())
         preservesections |= extrasections
         for section in preservesections: