py3: manually import getattr where it is needed
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 06 Oct 2019 16:55:18 -0400
changeset 43089 c59eb1560c44
parent 43088 0d612db7047c
child 43090 1f339b503a40
py3: manually import getattr where it is needed The march continues. Differential Revision: https://phab.mercurial-scm.org/D7009
hgext/convert/cvs.py
hgext/convert/transport.py
hgext/fastannotate/context.py
hgext/fastannotate/support.py
hgext/histedit.py
hgext/infinitepush/__init__.py
hgext/keyword.py
hgext/largefiles/storefactory.py
hgext/lfs/blobstore.py
hgext/lfs/wrapper.py
hgext/mq.py
hgext/phabricator.py
hgext/remotefilelog/basepack.py
hgext/remotefilelog/contentstore.py
hgext/strip.py
hgext/win32mbcs.py
mercurial/__init__.py
mercurial/bookmarks.py
mercurial/chgserver.py
mercurial/cmdutil.py
mercurial/color.py
mercurial/commandserver.py
mercurial/config.py
mercurial/context.py
mercurial/crecord.py
mercurial/debugcommands.py
mercurial/dispatch.py
mercurial/encoding.py
mercurial/extensions.py
mercurial/filemerge.py
mercurial/fileset.py
mercurial/filesetlang.py
mercurial/help.py
mercurial/hg.py
mercurial/hgweb/common.py
mercurial/hgweb/hgweb_mod.py
mercurial/hgweb/server.py
mercurial/hgweb/webcommands.py
mercurial/hgweb/wsgicgi.py
mercurial/hook.py
mercurial/httppeer.py
mercurial/i18n.py
mercurial/keepalive.py
mercurial/localrepo.py
mercurial/lock.py
mercurial/lsprof.py
mercurial/mail.py
mercurial/manifest.py
mercurial/mdiff.py
mercurial/narrowspec.py
mercurial/obsolete.py
mercurial/phases.py
mercurial/policy.py
mercurial/posix.py
mercurial/profiling.py
mercurial/pure/osutil.py
mercurial/pycompat.py
mercurial/repoview.py
mercurial/revlog.py
mercurial/revlogutils/deltas.py
mercurial/revset.py
mercurial/revsetlang.py
mercurial/scmposix.py
mercurial/scmutil.py
mercurial/smartset.py
mercurial/sshpeer.py
mercurial/sslutil.py
mercurial/store.py
mercurial/subrepoutil.py
mercurial/templater.py
mercurial/templateutil.py
mercurial/testing/storage.py
mercurial/ui.py
mercurial/unionrepo.py
mercurial/upgrade.py
mercurial/url.py
mercurial/urllibcompat.py
mercurial/util.py
mercurial/utils/compression.py
mercurial/utils/procutil.py
mercurial/vfs.py
mercurial/windows.py
mercurial/wireprotoframing.py
mercurial/wireprototypes.py
mercurial/wireprotov1peer.py
mercurial/wireprotov1server.py
--- a/hgext/convert/cvs.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/convert/cvs.py	Sun Oct 06 16:55:18 2019 -0400
@@ -12,7 +12,10 @@
 import socket
 
 from mercurial.i18n import _
-from mercurial.pycompat import open
+from mercurial.pycompat import (
+    getattr,
+    open,
+)
 from mercurial import (
     encoding,
     error,
--- a/hgext/convert/transport.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/convert/transport.py	Sun Oct 06 16:55:18 2019 -0400
@@ -25,6 +25,7 @@
 Pool = svn.core.Pool
 SubversionException = svn.core.SubversionException
 
+from mercurial.pycompat import getattr
 from mercurial import util
 
 # Some older versions of the Python bindings need to be
--- a/hgext/fastannotate/context.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/fastannotate/context.py	Sun Oct 06 16:55:18 2019 -0400
@@ -14,6 +14,7 @@
 
 from mercurial.i18n import _
 from mercurial.pycompat import (
+    getattr,
     open,
     setattr,
 )
--- a/hgext/fastannotate/support.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/fastannotate/support.py	Sun Oct 06 16:55:18 2019 -0400
@@ -7,6 +7,7 @@
 
 from __future__ import absolute_import
 
+from mercurial.pycompat import getattr
 from mercurial import (
     context as hgcontext,
     dagop,
--- a/hgext/histedit.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/histedit.py	Sun Oct 06 16:55:18 2019 -0400
@@ -206,7 +206,10 @@
 import struct
 
 from mercurial.i18n import _
-from mercurial.pycompat import open
+from mercurial.pycompat import (
+    getattr,
+    open,
+)
 from mercurial import (
     bundle2,
     cmdutil,
--- a/hgext/infinitepush/__init__.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/infinitepush/__init__.py	Sun Oct 06 16:55:18 2019 -0400
@@ -103,7 +103,10 @@
 
 from mercurial.i18n import _
 
-from mercurial.pycompat import open
+from mercurial.pycompat import (
+    getattr,
+    open,
+)
 
 from mercurial.utils import (
     procutil,
--- a/hgext/keyword.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/keyword.py	Sun Oct 06 16:55:18 2019 -0400
@@ -90,6 +90,7 @@
 import weakref
 
 from mercurial.i18n import _
+from mercurial.pycompat import getattr
 from mercurial.hgweb import webcommands
 
 from mercurial import (
--- a/hgext/largefiles/storefactory.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/largefiles/storefactory.py	Sun Oct 06 16:55:18 2019 -0400
@@ -6,7 +6,7 @@
 import re
 
 from mercurial.i18n import _
-
+from mercurial.pycompat import getattr
 from mercurial import (
     error,
     hg,
--- a/hgext/lfs/blobstore.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/lfs/blobstore.py	Sun Oct 06 16:55:18 2019 -0400
@@ -16,6 +16,7 @@
 import socket
 
 from mercurial.i18n import _
+from mercurial.pycompat import getattr
 
 from mercurial import (
     encoding,
--- a/hgext/lfs/wrapper.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/lfs/wrapper.py	Sun Oct 06 16:55:18 2019 -0400
@@ -11,7 +11,10 @@
 
 from mercurial.i18n import _
 from mercurial.node import bin, hex, nullid, short
-from mercurial.pycompat import setattr
+from mercurial.pycompat import (
+    getattr,
+    setattr,
+)
 
 from mercurial import (
     bundle2,
--- a/hgext/mq.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/mq.py	Sun Oct 06 16:55:18 2019 -0400
@@ -76,7 +76,10 @@
     nullrev,
     short,
 )
-from mercurial.pycompat import open
+from mercurial.pycompat import (
+    getattr,
+    open,
+)
 from mercurial import (
     cmdutil,
     commands,
--- a/hgext/phabricator.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/phabricator.py	Sun Oct 06 16:55:18 2019 -0400
@@ -49,6 +49,7 @@
 
 from mercurial.node import bin, nullid
 from mercurial.i18n import _
+from mercurial.pycompat import getattr
 from mercurial import (
     cmdutil,
     context,
--- a/hgext/remotefilelog/basepack.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/remotefilelog/basepack.py	Sun Oct 06 16:55:18 2019 -0400
@@ -9,7 +9,10 @@
 import time
 
 from mercurial.i18n import _
-from mercurial.pycompat import open
+from mercurial.pycompat import (
+    getattr,
+    open,
+)
 from mercurial import (
     node as nodemod,
     policy,
--- a/hgext/remotefilelog/contentstore.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/remotefilelog/contentstore.py	Sun Oct 06 16:55:18 2019 -0400
@@ -3,6 +3,7 @@
 import threading
 
 from mercurial.node import hex, nullid
+from mercurial.pycompat import getattr
 from mercurial import (
     mdiff,
     pycompat,
--- a/hgext/strip.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/strip.py	Sun Oct 06 16:55:18 2019 -0400
@@ -6,6 +6,7 @@
 from __future__ import absolute_import
 
 from mercurial.i18n import _
+from mercurial.pycompat import getattr
 from mercurial import (
     bookmarks as bookmarksmod,
     cmdutil,
--- a/hgext/win32mbcs.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/hgext/win32mbcs.py	Sun Oct 06 16:55:18 2019 -0400
@@ -50,7 +50,7 @@
 import sys
 
 from mercurial.i18n import _
-from mercurial.pycompat import setattr
+from mercurial.pycompat import getattr, setattr
 from mercurial import (
     encoding,
     error,
--- a/mercurial/__init__.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/__init__.py	Sun Oct 06 16:55:18 2019 -0400
@@ -171,7 +171,7 @@
                 r, c = t.start
                 l = (
                     b'; from mercurial.pycompat import '
-                    b'delattr, getattr\n'
+                    b'delattr\n'
                 )
                 for u in tokenize.tokenize(io.BytesIO(l).readline):
                     if u.type in (tokenize.ENCODING, token.ENDMARKER):
@@ -220,7 +220,7 @@
     # ``replacetoken`` or any mechanism that changes semantics of module
     # loading is changed. Otherwise cached bytecode may get loaded without
     # the new transformation mechanisms applied.
-    BYTECODEHEADER = b'HG\x00\x10'
+    BYTECODEHEADER = b'HG\x00\x11'
 
     class hgloader(importlib.machinery.SourceFileLoader):
         """Custom module loader that transforms source code.
--- a/mercurial/bookmarks.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/bookmarks.py	Sun Oct 06 16:55:18 2019 -0400
@@ -17,6 +17,7 @@
     short,
     wdirid,
 )
+from .pycompat import getattr
 from . import (
     encoding,
     error,
--- a/mercurial/chgserver.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/chgserver.py	Sun Oct 06 16:55:18 2019 -0400
@@ -51,7 +51,10 @@
 import time
 
 from .i18n import _
-from .pycompat import setattr
+from .pycompat import (
+    getattr,
+    setattr,
+)
 
 from . import (
     commandserver,
--- a/mercurial/cmdutil.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/cmdutil.py	Sun Oct 06 16:55:18 2019 -0400
@@ -20,6 +20,7 @@
     short,
 )
 from .pycompat import (
+    getattr,
     open,
     setattr,
 )
--- a/mercurial/color.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/color.py	Sun Oct 06 16:55:18 2019 -0400
@@ -10,6 +10,7 @@
 import re
 
 from .i18n import _
+from .pycompat import getattr
 
 from . import (
     encoding,
--- a/mercurial/commandserver.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/commandserver.py	Sun Oct 06 16:55:18 2019 -0400
@@ -24,6 +24,7 @@
     from .thirdparty import selectors2 as selectors
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     encoding,
     error,
--- a/mercurial/config.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/config.py	Sun Oct 06 16:55:18 2019 -0400
@@ -11,6 +11,7 @@
 import os
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     error,
     pycompat,
--- a/mercurial/context.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/context.py	Sun Oct 06 16:55:18 2019 -0400
@@ -23,7 +23,10 @@
     wdirfilenodeids,
     wdirhex,
 )
-from .pycompat import open
+from .pycompat import (
+    getattr,
+    open,
+)
 from . import (
     copies,
     dagop,
--- a/mercurial/crecord.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/crecord.py	Sun Oct 06 16:55:18 2019 -0400
@@ -16,7 +16,10 @@
 import signal
 
 from .i18n import _
-from .pycompat import open
+from .pycompat import (
+    getattr,
+    open,
+)
 from . import (
     encoding,
     error,
--- a/mercurial/debugcommands.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/debugcommands.py	Sun Oct 06 16:55:18 2019 -0400
@@ -32,7 +32,10 @@
     nullrev,
     short,
 )
-from .pycompat import open
+from .pycompat import (
+    getattr,
+    open,
+)
 from . import (
     bundle2,
     changegroup,
--- a/mercurial/dispatch.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/dispatch.py	Sun Oct 06 16:55:18 2019 -0400
@@ -20,6 +20,7 @@
 
 
 from .i18n import _
+from .pycompat import getattr
 
 from hgdemandimport import tracing
 
--- a/mercurial/encoding.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/encoding.py	Sun Oct 06 16:55:18 2019 -0400
@@ -11,6 +11,7 @@
 import os
 import unicodedata
 
+from .pycompat import getattr
 from . import (
     error,
     policy,
--- a/mercurial/extensions.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/extensions.py	Sun Oct 06 16:55:18 2019 -0400
@@ -19,6 +19,7 @@
     gettext,
 )
 from .pycompat import (
+    getattr,
     open,
     setattr,
 )
--- a/mercurial/filemerge.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/filemerge.py	Sun Oct 06 16:55:18 2019 -0400
@@ -18,7 +18,10 @@
     nullid,
     short,
 )
-from .pycompat import open
+from .pycompat import (
+    getattr,
+    open,
+)
 
 from . import (
     encoding,
--- a/mercurial/fileset.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/fileset.py	Sun Oct 06 16:55:18 2019 -0400
@@ -11,6 +11,7 @@
 import re
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     error,
     filesetlang,
--- a/mercurial/filesetlang.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/filesetlang.py	Sun Oct 06 16:55:18 2019 -0400
@@ -8,6 +8,7 @@
 from __future__ import absolute_import
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     error,
     parser,
--- a/mercurial/help.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/help.py	Sun Oct 06 16:55:18 2019 -0400
@@ -16,6 +16,7 @@
     _,
     gettext,
 )
+from .pycompat import getattr
 from . import (
     cmdutil,
     encoding,
--- a/mercurial/hg.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/hg.py	Sun Oct 06 16:55:18 2019 -0400
@@ -16,6 +16,7 @@
 
 from .i18n import _
 from .node import nullid
+from .pycompat import getattr
 
 from . import (
     bookmarks,
--- a/mercurial/hgweb/common.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/hgweb/common.py	Sun Oct 06 16:55:18 2019 -0400
@@ -14,7 +14,10 @@
 import os
 import stat
 
-from ..pycompat import open
+from ..pycompat import (
+    getattr,
+    open,
+)
 from .. import (
     encoding,
     pycompat,
--- a/mercurial/hgweb/hgweb_mod.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/hgweb/hgweb_mod.py	Sun Oct 06 16:55:18 2019 -0400
@@ -18,6 +18,7 @@
     permhooks,
     statusmessage,
 )
+from ..pycompat import getattr
 
 from .. import (
     encoding,
--- a/mercurial/hgweb/server.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/hgweb/server.py	Sun Oct 06 16:55:18 2019 -0400
@@ -17,7 +17,10 @@
 import wsgiref.validate
 
 from ..i18n import _
-from ..pycompat import open
+from ..pycompat import (
+    getattr,
+    open,
+)
 
 from .. import (
     encoding,
--- a/mercurial/hgweb/webcommands.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/hgweb/webcommands.py	Sun Oct 06 16:55:18 2019 -0400
@@ -14,6 +14,7 @@
 
 from ..i18n import _
 from ..node import hex, short
+from ..pycompat import getattr
 
 from .common import (
     ErrorResponse,
--- a/mercurial/hgweb/wsgicgi.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/hgweb/wsgicgi.py	Sun Oct 06 16:55:18 2019 -0400
@@ -12,6 +12,7 @@
 
 import os
 
+from ..pycompat import getattr
 from .. import pycompat
 
 from ..utils import procutil
--- a/mercurial/hook.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/hook.py	Sun Oct 06 16:55:18 2019 -0400
@@ -11,6 +11,7 @@
 import sys
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     demandimport,
     encoding,
--- a/mercurial/httppeer.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/httppeer.py	Sun Oct 06 16:55:18 2019 -0400
@@ -16,6 +16,7 @@
 import weakref
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     bundle2,
     error,
--- a/mercurial/i18n.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/i18n.py	Sun Oct 06 16:55:18 2019 -0400
@@ -12,6 +12,7 @@
 import os
 import sys
 
+from .pycompat import getattr
 from . import (
     encoding,
     pycompat,
--- a/mercurial/keepalive.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/keepalive.py	Sun Oct 06 16:55:18 2019 -0400
@@ -92,6 +92,7 @@
 import threading
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     node,
     pycompat,
--- a/mercurial/localrepo.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/localrepo.py	Sun Oct 06 16:55:18 2019 -0400
@@ -23,6 +23,7 @@
     nullrev,
     short,
 )
+from .pycompat import getattr
 from . import (
     bookmarks,
     branchmap,
--- a/mercurial/lock.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/lock.py	Sun Oct 06 16:55:18 2019 -0400
@@ -16,6 +16,7 @@
 import warnings
 
 from .i18n import _
+from .pycompat import getattr
 
 from . import (
     encoding,
--- a/mercurial/lsprof.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/lsprof.py	Sun Oct 06 16:55:18 2019 -0400
@@ -3,6 +3,8 @@
 import _lsprof
 import sys
 
+from .pycompat import getattr
+
 Profiler = _lsprof.Profiler
 
 # PyPy doesn't expose profiler_entry from the module.
--- a/mercurial/mail.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/mail.py	Sun Oct 06 16:55:18 2019 -0400
@@ -19,7 +19,10 @@
 import time
 
 from .i18n import _
-from .pycompat import open
+from .pycompat import (
+    getattr,
+    open,
+)
 from . import (
     encoding,
     error,
--- a/mercurial/manifest.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/manifest.py	Sun Oct 06 16:55:18 2019 -0400
@@ -19,6 +19,7 @@
     nullid,
     nullrev,
 )
+from .pycompat import getattr
 from . import (
     error,
     mdiff,
--- a/mercurial/mdiff.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/mdiff.py	Sun Oct 06 16:55:18 2019 -0400
@@ -12,7 +12,10 @@
 import zlib
 
 from .i18n import _
-from .pycompat import setattr
+from .pycompat import (
+    getattr,
+    setattr,
+)
 from . import (
     encoding,
     error,
--- a/mercurial/narrowspec.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/narrowspec.py	Sun Oct 06 16:55:18 2019 -0400
@@ -8,6 +8,7 @@
 from __future__ import absolute_import
 
 from .i18n import _
+from .pycompat import getattr
 from .interfaces import repository
 from . import (
     error,
--- a/mercurial/obsolete.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/obsolete.py	Sun Oct 06 16:55:18 2019 -0400
@@ -74,6 +74,7 @@
 import struct
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     encoding,
     error,
--- a/mercurial/phases.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/phases.py	Sun Oct 06 16:55:18 2019 -0400
@@ -113,7 +113,10 @@
     nullrev,
     short,
 )
-from .pycompat import setattr
+from .pycompat import (
+    getattr,
+    setattr,
+)
 from . import (
     error,
     pycompat,
--- a/mercurial/policy.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/policy.py	Sun Oct 06 16:55:18 2019 -0400
@@ -10,6 +10,8 @@
 import os
 import sys
 
+from .pycompat import getattr
+
 # Rules for how modules can be loaded. Values are:
 #
 #    c - require C extensions
--- a/mercurial/posix.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/posix.py	Sun Oct 06 16:55:18 2019 -0400
@@ -21,7 +21,10 @@
 import unicodedata
 
 from .i18n import _
-from .pycompat import open
+from .pycompat import (
+    getattr,
+    open,
+)
 from . import (
     encoding,
     error,
--- a/mercurial/profiling.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/profiling.py	Sun Oct 06 16:55:18 2019 -0400
@@ -10,7 +10,10 @@
 import contextlib
 
 from .i18n import _
-from .pycompat import open
+from .pycompat import (
+    getattr,
+    open,
+)
 from . import (
     encoding,
     error,
--- a/mercurial/pure/osutil.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/pure/osutil.py	Sun Oct 06 16:55:18 2019 -0400
@@ -13,6 +13,7 @@
 import socket
 import stat as statmod
 
+from ..pycompat import getattr
 from .. import (
     encoding,
     pycompat,
--- a/mercurial/pycompat.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/pycompat.py	Sun Oct 06 16:55:18 2019 -0400
@@ -355,6 +355,7 @@
     strurl = identity
     bytesurl = identity
     open = open
+    getattr = getattr
     hasattr = hasattr
     setattr = setattr
 
--- a/mercurial/repoview.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/repoview.py	Sun Oct 06 16:55:18 2019 -0400
@@ -12,7 +12,10 @@
 import weakref
 
 from .node import nullrev
-from .pycompat import setattr
+from .pycompat import (
+    getattr,
+    setattr,
+)
 from . import (
     obsolete,
     phases,
--- a/mercurial/revlog.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/revlog.py	Sun Oct 06 16:55:18 2019 -0400
@@ -35,6 +35,7 @@
     wdirrev,
 )
 from .i18n import _
+from .pycompat import getattr
 from .revlogutils.constants import (
     FLAG_GENERALDELTA,
     FLAG_INLINE_DATA,
--- a/mercurial/revlogutils/deltas.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/revlogutils/deltas.py	Sun Oct 06 16:55:18 2019 -0400
@@ -15,6 +15,7 @@
 # import stuff from node for others to import from revlog
 from ..node import nullrev
 from ..i18n import _
+from ..pycompat import getattr
 
 from .constants import (
     REVIDX_ISCENSORED,
--- a/mercurial/revset.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/revset.py	Sun Oct 06 16:55:18 2019 -0400
@@ -10,6 +10,7 @@
 import re
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     dagop,
     destutil,
--- a/mercurial/revsetlang.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/revsetlang.py	Sun Oct 06 16:55:18 2019 -0400
@@ -10,6 +10,7 @@
 import string
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     error,
     node,
--- a/mercurial/scmposix.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/scmposix.py	Sun Oct 06 16:55:18 2019 -0400
@@ -6,6 +6,7 @@
 import os
 import sys
 
+from .pycompat import getattr
 from . import (
     encoding,
     pycompat,
--- a/mercurial/scmutil.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/scmutil.py	Sun Oct 06 16:55:18 2019 -0400
@@ -26,6 +26,7 @@
     wdirid,
     wdirrev,
 )
+from .pycompat import getattr
 
 from . import (
     copies as copiesmod,
--- a/mercurial/smartset.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/smartset.py	Sun Oct 06 16:55:18 2019 -0400
@@ -7,6 +7,7 @@
 
 from __future__ import absolute_import
 
+from .pycompat import getattr
 from . import (
     encoding,
     error,
--- a/mercurial/sshpeer.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/sshpeer.py	Sun Oct 06 16:55:18 2019 -0400
@@ -11,6 +11,7 @@
 import uuid
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     error,
     pycompat,
--- a/mercurial/sslutil.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/sslutil.py	Sun Oct 06 16:55:18 2019 -0400
@@ -15,6 +15,7 @@
 import ssl
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     encoding,
     error,
--- a/mercurial/store.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/store.py	Sun Oct 06 16:55:18 2019 -0400
@@ -14,6 +14,7 @@
 import stat
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     changelog,
     error,
--- a/mercurial/subrepoutil.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/subrepoutil.py	Sun Oct 06 16:55:18 2019 -0400
@@ -13,6 +13,7 @@
 import re
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     config,
     error,
--- a/mercurial/templater.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/templater.py	Sun Oct 06 16:55:18 2019 -0400
@@ -68,6 +68,7 @@
 import os
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     config,
     encoding,
--- a/mercurial/templateutil.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/templateutil.py	Sun Oct 06 16:55:18 2019 -0400
@@ -11,6 +11,7 @@
 import types
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     error,
     pycompat,
--- a/mercurial/testing/storage.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/testing/storage.py	Sun Oct 06 16:55:18 2019 -0400
@@ -14,6 +14,7 @@
     nullid,
     nullrev,
 )
+from ..pycompat import getattr
 from .. import (
     error,
     mdiff,
--- a/mercurial/ui.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/ui.py	Sun Oct 06 16:55:18 2019 -0400
@@ -23,6 +23,7 @@
 from .i18n import _
 from .node import hex
 from .pycompat import (
+    getattr,
     open,
     setattr,
 )
--- a/mercurial/unionrepo.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/unionrepo.py	Sun Oct 06 16:55:18 2019 -0400
@@ -14,6 +14,7 @@
 from __future__ import absolute_import
 
 from .i18n import _
+from .pycompat import getattr
 
 from . import (
     changelog,
--- a/mercurial/upgrade.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/upgrade.py	Sun Oct 06 16:55:18 2019 -0400
@@ -10,6 +10,7 @@
 import stat
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     changelog,
     error,
--- a/mercurial/url.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/url.py	Sun Oct 06 16:55:18 2019 -0400
@@ -15,6 +15,7 @@
 import sys
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     encoding,
     error,
--- a/mercurial/urllibcompat.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/urllibcompat.py	Sun Oct 06 16:55:18 2019 -0400
@@ -6,6 +6,7 @@
 # GNU General Public License version 2 or any later version.
 from __future__ import absolute_import
 
+from .pycompat import getattr
 from . import pycompat
 
 _sysstr = pycompat.sysstr
--- a/mercurial/util.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/util.py	Sun Oct 06 16:55:18 2019 -0400
@@ -36,6 +36,7 @@
 
 from .thirdparty import attr
 from .pycompat import (
+    getattr,
     open,
     setattr,
 )
--- a/mercurial/utils/compression.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/utils/compression.py	Sun Oct 06 16:55:18 2019 -0400
@@ -10,6 +10,7 @@
 import collections
 import zlib
 
+from ..pycompat import getattr
 from .. import (
     error,
     i18n,
--- a/mercurial/utils/procutil.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/utils/procutil.py	Sun Oct 06 16:55:18 2019 -0400
@@ -20,7 +20,10 @@
 import time
 
 from ..i18n import _
-from ..pycompat import open
+from ..pycompat import (
+    getattr,
+    open,
+)
 
 from .. import (
     encoding,
--- a/mercurial/vfs.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/vfs.py	Sun Oct 06 16:55:18 2019 -0400
@@ -14,7 +14,10 @@
 import threading
 
 from .i18n import _
-from .pycompat import setattr
+from .pycompat import (
+    getattr,
+    setattr,
+)
 from . import (
     encoding,
     error,
--- a/mercurial/windows.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/windows.py	Sun Oct 06 16:55:18 2019 -0400
@@ -16,6 +16,7 @@
 import sys
 
 from .i18n import _
+from .pycompat import getattr
 from . import (
     encoding,
     error,
--- a/mercurial/wireprotoframing.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/wireprotoframing.py	Sun Oct 06 16:55:18 2019 -0400
@@ -15,6 +15,7 @@
 import struct
 
 from .i18n import _
+from .pycompat import getattr
 from .thirdparty import attr
 from . import (
     encoding,
--- a/mercurial/wireprototypes.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/wireprototypes.py	Sun Oct 06 16:55:18 2019 -0400
@@ -10,6 +10,7 @@
     hex,
 )
 from .i18n import _
+from .pycompat import getattr
 from .thirdparty import attr
 from . import (
     error,
--- a/mercurial/wireprotov1peer.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/wireprotov1peer.py	Sun Oct 06 16:55:18 2019 -0400
@@ -13,7 +13,10 @@
 
 from .i18n import _
 from .node import bin
-from .pycompat import setattr
+from .pycompat import (
+    getattr,
+    setattr,
+)
 from . import (
     bundle2,
     changegroup as changegroupmod,
--- a/mercurial/wireprotov1server.py	Sun Oct 06 16:39:13 2019 -0400
+++ b/mercurial/wireprotov1server.py	Sun Oct 06 16:55:18 2019 -0400
@@ -15,6 +15,7 @@
     hex,
     nullid,
 )
+from .pycompat import getattr
 
 from . import (
     bundle2,