Mercurial > public > mercurial-scm > hg
diff mercurial/obsolete.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 | 413b44003462 |
children | 7c3ef55dedbe |
line wrap: on
line diff
--- a/mercurial/obsolete.py Tue May 02 17:05:22 2017 +0900 +++ b/mercurial/obsolete.py Wed Apr 26 21:56:47 2017 +0900 @@ -74,7 +74,6 @@ from .i18n import _ from . import ( - base85, error, node, parsers, @@ -744,7 +743,7 @@ currentlen += len(nextdata) for idx, part in enumerate(reversed(parts)): data = ''.join([_pack('>B', _fm0version)] + part) - keys['dump%i' % idx] = base85.b85encode(data) + keys['dump%i' % idx] = util.b85encode(data) return keys def listmarkers(repo): @@ -761,7 +760,7 @@ if old: repo.ui.warn(_('unexpected old value for %r') % key) return 0 - data = base85.b85decode(new) + data = util.b85decode(new) lock = repo.lock() try: tr = repo.transaction('pushkey: obsolete markers')