changeset 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 67b28d657f62
children ed2df771f578
files hgsubversion/wrappers.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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: