diff --git a/mercurial/commands.py b/mercurial/commands.py
index 1441f4d570834d521ada1b01d8e9f41e0f8aca63_bWVyY3VyaWFsL2NvbW1hbmRzLnB5..777e8d88f703017557527a1c2d8f886cc0dfdafb_bWVyY3VyaWFsL2NvbW1hbmRzLnB5 100644
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2227,10 +2227,9 @@
                 raise error.InputError(
                     _(b"repository is not shared; can't use --shared")
                 )
-                if requirements.SHARESAFE_REQUIREMENT not in repo.requirements:
-                    raise error.InputError(
-                        _(
-                            b"share safe feature not unabled; "
-                            b"unable to edit shared source repository config"
-                        )
+            if requirements.SHARESAFE_REQUIREMENT not in repo.requirements:
+                raise error.InputError(
+                    _(
+                        b"share safe feature not enabled; "
+                        b"unable to edit shared source repository config"
                     )
@@ -2236,4 +2235,5 @@
                     )
+                )
             paths = [vfsmod.vfs(repo.sharedpath).join(b'hgrc')]
         elif opts.get(b'non_shared'):
             paths = [repo.vfs.join(b'hgrc-not-shared')]