Patchwork D2280: remotenames: port partway to python3 by using collections.MutableMapping

login
register
mail settings
Submitter phabricator
Date Feb. 17, 2018, 3:53 a.m.
Message ID <01692223fb24f08cba634e9fdee6ac8a@localhost.localdomain>
Download mbox | patch
Permalink /patch/28004/
State Not Applicable
Headers show

Comments

phabricator - Feb. 17, 2018, 3:53 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG25a7d2761898: remotenames: port partway to python3 by using collections.MutableMapping (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2280?vs=5785&id=5792

REVISION DETAIL
  https://phab.mercurial-scm.org/D2280

AFFECTED FILES
  hgext/remotenames.py

CHANGE DETAILS




To: durin42, #hg-reviewers, yuja
Cc: dlax, yuja, mercurial-devel

Patch

diff --git a/hgext/remotenames.py b/hgext/remotenames.py
--- a/hgext/remotenames.py
+++ b/hgext/remotenames.py
@@ -22,7 +22,7 @@ 
 
 from __future__ import absolute_import
 
-import UserDict
+import collections
 
 from mercurial.i18n import _
 
@@ -57,7 +57,7 @@ 
     default=True,
 )
 
-class lazyremotenamedict(UserDict.DictMixin):
+class lazyremotenamedict(collections.MutableMapping):
     """
     Read-only dict-like Class to lazily resolve remotename entries
 
@@ -110,6 +110,18 @@ 
         else:
             raise KeyError()
 
+    def __iter__(self):
+        return iter(self.potentialentries)
+
+    def __len__(self):
+        return len(self.potentialentries)
+
+    def __setitem__(self):
+        raise NotImplementedError
+
+    def __delitem__(self):
+        raise NotImplementedError
+
     def _fetchandcache(self, key):
         if key in self.cache:
             return self.cache[key]