Patchwork localrepo: remove a couple of local type aliases

login
register
mail settings
Submitter Augie Fackler
Date May 6, 2016, 6:27 p.m.
Message ID <5bf9cc307f6f9eee39b2.1462559230@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/14951/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Augie Fackler - May 6, 2016, 6:27 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1462548689 14400
#      Fri May 06 11:31:29 2016 -0400
# Node ID 5bf9cc307f6f9eee39b28899bdb1a67553130146
# Parent  fe50341de1fff843ae633d7ad7be908100c09cdc
localrepo: remove a couple of local type aliases

The local aliases are unused now, and were confusing mypy's type
checker.
Sean Farley - May 6, 2016, 6:28 p.m.
Augie Fackler <raf@durin42.com> writes:

> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1462548689 14400
> #      Fri May 06 11:31:29 2016 -0400
> # Node ID 5bf9cc307f6f9eee39b28899bdb1a67553130146
> # Parent  fe50341de1fff843ae633d7ad7be908100c09cdc
> localrepo: remove a couple of local type aliases
>
> The local aliases are unused now, and were confusing mypy's type
> checker.

Looks good.
Yuya Nishihara - May 9, 2016, 12:02 p.m.
On Fri, 06 May 2016 14:27:10 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1462548689 14400
> #      Fri May 06 11:31:29 2016 -0400
> # Node ID 5bf9cc307f6f9eee39b28899bdb1a67553130146
> # Parent  fe50341de1fff843ae633d7ad7be908100c09cdc
> localrepo: remove a couple of local type aliases

LGTM. Pushed to the committed repo per Sean's review, thanks.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -57,12 +57,10 @@  from . import (
 )
 
 release = lockmod.release
-propertycache = util.propertycache
 urlerr = util.urlerr
 urlreq = util.urlreq
-filecache = scmutil.filecache
 
-class repofilecache(filecache):
+class repofilecache(scmutil.filecache):
     """All filecache usage on repo are done for logic that should be unfiltered
     """
 
@@ -78,7 +76,7 @@  class storecache(repofilecache):
     def join(self, obj, fname):
         return obj.sjoin(fname)
 
-class unfilteredpropertycache(propertycache):
+class unfilteredpropertycache(util.propertycache):
     """propertycache that apply to unfiltered repo only"""
 
     def __get__(self, repo, type=None):
@@ -87,7 +85,7 @@  class unfilteredpropertycache(propertyca
             return super(unfilteredpropertycache, self).__get__(unfi)
         return getattr(unfi, self.name)
 
-class filteredpropertycache(propertycache):
+class filteredpropertycache(util.propertycache):
     """propertycache that must take filtering in account"""
 
     def cachevalue(self, obj, value):