changeset 36090:9445a3141501

narrow: move from ELLIPSIS_NODE_FLAG to revlog.REVIDX_ELLIPSIS We should have been using this value all along. Sigh. Differential Revision: https://phab.mercurial-scm.org/D2008
author Augie Fackler <augie@google.com>
date Fri, 02 Feb 2018 10:37:29 -0500
parents e14821b290eb
children ea02be8665ef
files hgext/narrow/narrowchangegroup.py hgext/narrow/narrowrevlog.py hgext/narrow/narrowtemplates.py
diffstat 3 files changed, 9 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/narrow/narrowchangegroup.py	Fri Feb 02 10:28:57 2018 -0500
+++ b/hgext/narrow/narrowchangegroup.py	Fri Feb 02 10:37:29 2018 -0500
@@ -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.REVIDX_ELLIPSIS
         meta = packer.builddeltaheader(
             n, p1n, p2n, node.nullid, linknode, flags)
         # TODO: try and actually send deltas for ellipsis data blocks
--- a/hgext/narrow/narrowrevlog.py	Fri Feb 02 10:28:57 2018 -0500
+++ b/hgext/narrow/narrowrevlog.py	Fri Feb 02 10:37:29 2018 -0500
@@ -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.REVIDX_ELLIPSIS,
                         (readtransform, writetransform, rawtransform))
 
 def setup():
--- a/hgext/narrow/narrowtemplates.py	Fri Feb 02 10:28:57 2018 -0500
+++ b/hgext/narrow/narrowtemplates.py	Fri Feb 02 10:37:29 2018 -0500
@@ -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.REVIDX_ELLIPSIS:
         return True
     return False