diff mercurial/pvec.py @ 32201:4462a981e8df

base85: proxy through util module I'm going to replace hgimporter with a simpler import function, so we can access to pure/cext modules by name: # util.py base85 = policy.importmod('base85') # select pure.base85 or cext.base85 # cffi/base85.py from ..pure.base85 import * # may re-export pure.base85 functions This means we'll have to use policy.importmod() function in place of the standard import statement, but we wouldn't want to write it every place where C extension modules are used. So this patch makes util host base85 functions.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 26 Apr 2017 21:56:47 +0900
parents 983e93d88193
children e7aa113b14f7
line wrap: on
line diff
--- a/mercurial/pvec.py	Tue May 02 17:05:22 2017 +0900
+++ b/mercurial/pvec.py	Wed Apr 26 21:56:47 2017 +0900
@@ -52,7 +52,6 @@
 
 from .node import nullrev
 from . import (
-    base85,
     util,
 )
 
@@ -166,13 +165,13 @@
                 else:
                     pvc[n] = _mergevec(pvc[p1], pvc[p2], node)
     bs = _join(*pvc[ctx.rev()])
-    return pvec(base85.b85encode(bs))
+    return pvec(util.b85encode(bs))
 
 class pvec(object):
     def __init__(self, hashorctx):
         if isinstance(hashorctx, str):
             self._bs = hashorctx
-            self._depth, self._vec = _split(base85.b85decode(hashorctx))
+            self._depth, self._vec = _split(util.b85decode(hashorctx))
         else:
             self._vec = ctxpvec(hashorctx)