changeset 39771:a063786c89fb

narrow: remove narrowrevlog Core now automatically enables ellipsis support on revlogs when repositories have narrow enabled. So, we no longer need to globally register the revlog flag as part of activating the narrow extension and this code can be deleted. A side effect of this change is that repositories will now raise an error on encountering an ellipsis flag when the narrow extension is loaded. Previously, loading the narrow extension on a non-narrow repo could result in silent usage of the ellipsis flag. This could lead to undetected bugs. I think the new behavior is more correct. Differential Revision: https://phab.mercurial-scm.org/D4649
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 18 Sep 2018 15:32:11 -0700
parents 7aa440222323
children ae531f5e583c
files hgext/narrow/TODO.rst hgext/narrow/__init__.py hgext/narrow/narrowrevlog.py
diffstat 3 files changed, 1 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/narrow/TODO.rst	Thu Sep 13 15:57:18 2018 -0700
+++ b/hgext/narrow/TODO.rst	Tue Sep 18 15:32:11 2018 -0700
@@ -7,18 +7,11 @@
 came up the import to hgext, but nobody's got concrete improvement
 ideas as of then.
 
-Fold most (or preferably all) of narrowrevlog.py into core.
-
-Address commentary in narrowrevlog.excludedmanifestrevlog.add -
+Address commentary in manifest.excludedmanifestrevlog.add -
 specifically we should improve the collaboration with core so that
 add() never gets called on an excluded directory and we can improve
 the stand-in to raise a ProgrammingError.
 
-Figure out how to correctly produce narrowmanifestrevlog and
-narrowfilelog instances instead of monkeypatching regular revlogs at
-runtime to our subclass. Even better, merge the narrowing logic
-directly into core.
-
 Reason more completely about rename-filtering logic in
 narrowfilelog. There could be some surprises lurking there.
 
--- a/hgext/narrow/__init__.py	Thu Sep 13 15:57:18 2018 -0700
+++ b/hgext/narrow/__init__.py	Tue Sep 18 15:32:11 2018 -0700
@@ -28,7 +28,6 @@
     narrowcopies,
     narrowpatch,
     narrowrepo,
-    narrowrevlog,
     narrowtemplates,
     narrowwirepeer,
 )
@@ -58,7 +57,6 @@
 def uisetup(ui):
     """Wraps user-facing mercurial commands with narrow-aware versions."""
     localrepo.featuresetupfuncs.add(featuresetup)
-    narrowrevlog.setup()
     narrowbundle2.setup()
     narrowcommands.setup()
     narrowwirepeer.uisetup()
--- a/hgext/narrow/narrowrevlog.py	Thu Sep 13 15:57:18 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-# narrowrevlog.py - revlog storing irrelevant nodes as "ellipsis" nodes
-#
-# Copyright 2017 Google, Inc.
-#
-# This software may be used and distributed according to the terms of the
-# GNU General Public License version 2 or any later version.
-
-from __future__ import absolute_import
-
-from mercurial import (
-   revlog,
-)
-
-revlog.addflagprocessor(revlog.REVIDX_ELLIPSIS, revlog.ellipsisprocessor)
-
-def setup():
-    # We just wanted to add the flag processor, which is done at module
-    # load time.
-    pass