Patchwork [1,of,3] changelog: remove copy of revlog.nodemap()

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 17, 2018, 4:41 a.m.
Message ID <0a01692d0560e11e15b8.1534480903@mimosa>
Download mbox | patch
Permalink /patch/33813/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 17, 2018, 4:41 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1534477724 -32400
#      Fri Aug 17 12:48:44 2018 +0900
# Node ID 0a01692d0560e11e15b8d9c25d944684cc9cab72
# Parent  8547c8590ac1b49a640d64d1c0878cb5364b3a3b
changelog: remove copy of revlog.nodemap()

It's been there since 2012, "clfilter: introduce `filteredrevs` attribute
on changelog." I don't think we can apply changelog filtering to nodemap at
this level, so this patch removes the nodemap stub completely.
Gregory Szorc - Aug. 17, 2018, 11:14 p.m.
On Thu, Aug 16, 2018 at 9:41 PM, Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1534477724 -32400
> #      Fri Aug 17 12:48:44 2018 +0900
> # Node ID 0a01692d0560e11e15b8d9c25d944684cc9cab72
> # Parent  8547c8590ac1b49a640d64d1c0878cb5364b3a3b
> changelog: remove copy of revlog.nodemap()
>

Queued, thanks.


>
> It's been there since 2012, "clfilter: introduce `filteredrevs` attribute
> on changelog." I don't think we can apply changelog filtering to nodemap at
> this level, so this patch removes the nodemap stub completely.
>
> diff --git a/mercurial/changelog.py b/mercurial/changelog.py
> --- a/mercurial/changelog.py
> +++ b/mercurial/changelog.py
> @@ -22,7 +22,6 @@ from . import (
>      error,
>      pycompat,
>      revlog,
> -    util,
>  )
>  from .utils import (
>      dateutil,
> @@ -344,12 +343,6 @@ class changelog(revlog.revlog):
>              if i not in self.filteredrevs:
>                  yield i
>
> -    @util.propertycache
> -    def nodemap(self):
> -        # XXX need filtering too
> -        self.rev(self.node(0))
> -        return self._nodecache
> -
>      def reachableroots(self, minroot, heads, roots, includepath=False):
>          return self.index.reachableroots2(minroot, heads, roots,
> includepath)
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -22,7 +22,6 @@  from . import (
     error,
     pycompat,
     revlog,
-    util,
 )
 from .utils import (
     dateutil,
@@ -344,12 +343,6 @@  class changelog(revlog.revlog):
             if i not in self.filteredrevs:
                 yield i
 
-    @util.propertycache
-    def nodemap(self):
-        # XXX need filtering too
-        self.rev(self.node(0))
-        return self._nodecache
-
     def reachableroots(self, minroot, heads, roots, includepath=False):
         return self.index.reachableroots2(minroot, heads, roots, includepath)