diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -53,6 +53,7 @@
     phases,
     pushkey,
     pycompat,
+    rcutil,
     repoview,
     revset,
     revsetlang,
@@ -676,7 +677,7 @@
     configs are loaded. For example, an extension may wish to pull in
     configs from alternate files or sources.
     """
-    if b'HGRCSKIPREPO' in encoding.environ:
+    if not rcutil.use_repo_hgrc():
         return False
     try:
         ui.readconfig(hgvfs.join(b'hgrc'), root=wdirvfs.base)
diff --git a/mercurial/rcutil.py b/mercurial/rcutil.py
--- a/mercurial/rcutil.py
+++ b/mercurial/rcutil.py
@@ -112,3 +112,8 @@
     intended to be set before starting a pager.
     '''
     return {b'LESS': b'FRX', b'LV': b'-c'}
+
+
+def use_repo_hgrc():
+    """True if repositories `.hg/hgrc` config should be read"""
+    return b'HGRCSKIPREPO' not in encoding.environ