diff --git a/hgext/narrow/narrowchangegroup.py b/hgext/narrow/narrowchangegroup.py --- a/hgext/narrow/narrowchangegroup.py +++ b/hgext/narrow/narrowchangegroup.py @@ -15,12 +15,12 @@ manifest, mdiff, node, + revlog, util, ) from . import ( narrowrepo, - narrowrevlog, ) def setup(): @@ -83,11 +83,11 @@ extensions.wrapfunction( changegroup.cg1packer, 'generatefiles', generatefiles) - def ellipsisdata(packer, rev, revlog, p1, p2, data, linknode): - n = revlog.node(rev) - p1n, p2n = revlog.node(p1), revlog.node(p2) - flags = revlog.flags(rev) - flags |= narrowrevlog.ELLIPSIS_NODE_FLAG + def ellipsisdata(packer, rev, revlog_, p1, p2, data, linknode): + n = revlog_.node(rev) + p1n, p2n = revlog_.node(p1), revlog_.node(p2) + flags = revlog_.flags(rev) + flags |= revlog.ELLIPSIS_NODE_FLAG meta = packer.builddeltaheader( n, p1n, p2n, node.nullid, linknode, flags) # TODO: try and actually send deltas for ellipsis data blocks diff --git a/hgext/narrow/narrowrevlog.py b/hgext/narrow/narrowrevlog.py --- a/hgext/narrow/narrowrevlog.py +++ b/hgext/narrow/narrowrevlog.py @@ -13,11 +13,6 @@ util, ) -ELLIPSIS_NODE_FLAG = 1 << 14 -revlog.REVIDX_KNOWN_FLAGS |= ELLIPSIS_NODE_FLAG -if ELLIPSIS_NODE_FLAG not in revlog.REVIDX_FLAGS_ORDER: - revlog.REVIDX_FLAGS_ORDER.append(ELLIPSIS_NODE_FLAG) - def readtransform(self, text): return text, False @@ -27,7 +22,7 @@ def rawtransform(self, text): return False -revlog.addflagprocessor(ELLIPSIS_NODE_FLAG, +revlog.addflagprocessor(revlog.ELLIPSIS_NODE_FLAG, (readtransform, writetransform, rawtransform)) def setup(): diff --git a/hgext/narrow/narrowtemplates.py b/hgext/narrow/narrowtemplates.py --- a/hgext/narrow/narrowtemplates.py +++ b/hgext/narrow/narrowtemplates.py @@ -8,15 +8,14 @@ from __future__ import absolute_import from mercurial import ( + revlog, revset, templatekw, util, ) -from . import narrowrevlog - def _isellipsis(repo, rev): - if repo.changelog.flags(rev) & narrowrevlog.ELLIPSIS_NODE_FLAG: + if repo.changelog.flags(rev) & revlog.ELLIPSIS_NODE_FLAG: return True return False diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -58,6 +58,7 @@ # Dummy value until file format is finalized. # Reminder: change the bounds check in revlog.__init__ when this is changed. REVLOGV2 = 0xDEAD +ELLIPSIS_NODE_FLAG = (1 << 14) FLAG_INLINE_DATA = (1 << 16) FLAG_GENERALDELTA = (1 << 17) REVLOG_DEFAULT_FLAGS = FLAG_INLINE_DATA @@ -76,6 +77,7 @@ REVIDX_ISCENSORED, REVIDX_ELLIPSIS, REVIDX_EXTSTORED, + ELLIPSIS_NODE_FLAG, ] REVIDX_KNOWN_FLAGS = util.bitsfrom(REVIDX_FLAGS_ORDER)