Patchwork D2847: remotenames: work around move of ABCs in collections

login
register
mail settings
Submitter phabricator
Date March 15, 2018, 2:43 p.m.
Message ID <97d70b68ae6521e5d3b9e8dc7801f8bf@localhost.localdomain>
Download mbox | patch
Permalink /patch/29543/
State Not Applicable
Headers show

Comments

phabricator - March 15, 2018, 2:43 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG623193ef691b: remotenames: work around move of ABCs in collections (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2847?vs=7037&id=7065

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

AFFECTED FILES
  hgext/remotenames.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/remotenames.py b/hgext/remotenames.py
--- a/hgext/remotenames.py
+++ b/hgext/remotenames.py
@@ -22,22 +22,28 @@ 
 
 from __future__ import absolute_import
 
-import collections
-
 from mercurial.i18n import _
 
 from mercurial.node import (
     bin,
 )
 from mercurial import (
     logexchange,
     namespaces,
+    pycompat,
     registrar,
     revsetlang,
     smartset,
     templateutil,
 )
 
+if pycompat.ispy3:
+    import collections.abc
+    mutablemapping = collections.abc.MutableMapping
+else:
+    import collections
+    mutablemapping = collections.MutableMapping
+
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
 # be specifying the version(s) of Mercurial they are tested with, or
@@ -56,7 +62,7 @@ 
     default=True,
 )
 
-class lazyremotenamedict(collections.MutableMapping):
+class lazyremotenamedict(mutablemapping):
     """
     Read-only dict-like Class to lazily resolve remotename entries