mercurial/commands.py
changeset 49710 30ac702a7488
parent 49709 459e311f5581
child 49717 f2f4ec857f78
--- a/mercurial/commands.py	Thu Dec 01 02:09:43 2022 +0100
+++ b/mercurial/commands.py	Thu Dec 01 02:11:21 2022 +0100
@@ -7283,6 +7283,7 @@
             d = b'default-push'
         elif b'default' in ui.paths:
             d = b'default'
+        path = None
         if d is not None:
             path = urlutil.get_unique_push_path(b'summary', repo, ui, d)
             dest = path.loc
@@ -7293,7 +7294,7 @@
         revs, checkout = hg.addbranchrevs(repo, repo, (dbranch, []), None)
         if source != dest:
             try:
-                dother = hg.peer(repo, {}, dest)
+                dother = hg.peer(repo, {}, path if path is not None else dest)
             except error.RepoError:
                 if opts.get(b'remote'):
                     raise