[PATCH] py3: do not convert rust module/attribute names to bytes

Yuya Nishihara yuya at tcha.org
Sat Aug 17 08:02:18 EDT 2019


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1566005104 -32400
#      Sat Aug 17 10:25:04 2019 +0900
# Node ID 302e4706ab25b4d29d858f93ca2678a609e95570
# Parent  a3c360094c93509ee013ed7f4b7807c74b2d60a4
py3: do not convert rust module/attribute names to bytes

policy.import*() functions expect system strings.

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -25,7 +25,7 @@ from .utils import (
     stringutil,
 )
 
-rustmod = policy.importrust('filepatterns')
+rustmod = policy.importrust(r'filepatterns')
 
 allpatternkinds = ('re', 'glob', 'path', 'relglob', 'relpath', 'relre',
                    'rootglob',
diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -270,8 +270,8 @@ class partialdiscovery(object):
                 sample.update(takefrom[:more])
         return sample
 
-partialdiscovery = policy.importrust('discovery',
-                                     member='PartialDiscovery',
+partialdiscovery = policy.importrust(r'discovery',
+                                     member=r'PartialDiscovery',
                                      default=partialdiscovery)
 
 def findcommonheads(ui, local, remote,
diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -53,7 +53,7 @@ from .utils import (
     stringutil,
 )
 
-rustdirs = policy.importrust('dirstate', 'Dirs')
+rustdirs = policy.importrust(r'dirstate', r'Dirs')
 
 base85 = policy.importmod(r'base85')
 osutil = policy.importmod(r'osutil')


More information about the Mercurial-devel mailing list