Mercurial > hg
comparison mercurial/exchange.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 | 42efb1b2cfb8 |
children | 6068712cbf03 |
comparison
equal
deleted
inserted
replaced
32200:2d84947cd85d | 32201:4462a981e8df |
---|---|
14 from .node import ( | 14 from .node import ( |
15 hex, | 15 hex, |
16 nullid, | 16 nullid, |
17 ) | 17 ) |
18 from . import ( | 18 from . import ( |
19 base85, | |
20 bookmarks as bookmod, | 19 bookmarks as bookmod, |
21 bundle2, | 20 bundle2, |
22 changegroup, | 21 changegroup, |
23 discovery, | 22 discovery, |
24 error, | 23 error, |
1507 if 'dump0' in remoteobs: | 1506 if 'dump0' in remoteobs: |
1508 tr = pullop.gettransaction() | 1507 tr = pullop.gettransaction() |
1509 markers = [] | 1508 markers = [] |
1510 for key in sorted(remoteobs, reverse=True): | 1509 for key in sorted(remoteobs, reverse=True): |
1511 if key.startswith('dump'): | 1510 if key.startswith('dump'): |
1512 data = base85.b85decode(remoteobs[key]) | 1511 data = util.b85decode(remoteobs[key]) |
1513 version, newmarks = obsolete._readmarkers(data) | 1512 version, newmarks = obsolete._readmarkers(data) |
1514 markers += newmarks | 1513 markers += newmarks |
1515 if markers: | 1514 if markers: |
1516 pullop.repo.obsstore.add(tr, markers) | 1515 pullop.repo.obsstore.add(tr, markers) |
1517 pullop.repo.invalidatevolatilesets() | 1516 pullop.repo.invalidatevolatilesets() |