mercurial/hg.py
changeset 49686 229e0ed88895
parent 49685 d9791643aab7
child 49687 b478e1b132e9
--- a/mercurial/hg.py	Tue Nov 29 19:54:55 2022 +0100
+++ b/mercurial/hg.py	Wed Nov 30 11:12:48 2022 +0100
@@ -299,8 +299,13 @@
 ):
     '''create a shared repository'''
 
-    if not islocal(source):
-        raise error.Abort(_(b'can only share local repositories'))
+    not_local_msg = _(b'can only share local repositories')
+    if util.safehasattr(source, 'local'):
+        if source.local() is None:
+            raise error.Abort(not_local_msg)
+    elif not islocal(source):
+        # XXX why are we getting bytes here ?
+        raise error.Abort(not_local_msg)
 
     if not dest:
         dest = defaultdest(source)